Wietse Venema wrote on 2/17/23 10:26:
D. R. Evans:
I must be doing something particularly obviously stupid, because doing my best
to follow the advice from Wietse in the thread "different treatment for
different From: domains", I have tried everything I can think of, and am
unable to get sender_dependent_relayhost_maps to actually change the relayhost
for mails from a particular domain.

1. I created the following /etc/postfix/relayhost_maps file:

----
@arrl.net       [smtp.pobox.com]:587
----

2. I added the following to main.cf:

sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_maps

3. I executed:

postmap /etc/postfix/relayhost_maps
     and
postfix reload

My understanding from the little I can find on the subject is that
with this configuration, when the server receives an e-mail from
my address n...@arrl.net, it should now forward it to smtp.pobox.com:587.
But it doesn't.  It still forwards it to the host identified by
the ordinary relayhost= line in main.cf.

Basic questions:

1) Does Postfix log n...@arrl.net as the envelope sender?

     <date> <time> host postfix/qmgr[pid]: queueid: from=<???>,
        size=nnn, nrcpt=nnn (queue active)

Copied from the mail.info file, for a test e-mail I sent a couple of minutes 
ago:

Feb 22 10:22:53 localhost postfix/qmgr[1891610]: 16CC8174: from=<n...@arrl.net>, size=1673, nrcpt=1 (queue active)

2) Are there any settings that OVERRIDE sender_dependent_relayhost_maps?
As documented, sender_dependent_relayhost_maps is overruled with
relay_transport, sender_dependent_default_transport_maps,
default_transport and with the transport(5) table.

AH!! Brilliant, sir!

I checked all of those in turn, and discovered that there is indeed an old transport table that directs outbound mail for @gmail.com to go to a relay that is no longer the one that I wanted.

I eliminated the transport table, and voilĂ !, it works.

I had carefully gone through all of those possible entries in the main.cf file, because I had seen that they override sender_dependent_relayhost_maps, but I completely forgot about the possibility that there might be an old transport table in place. Thank you for forcing me to go through it all again, but with greater care.

In one sense, this is an embarrassing failure on my part. In mitigation, I plead that postfix has so many interacting configurations, though, that I do think I was right to come and ask for expert assistance. I had spent a lot of time on this without spotting the issue of an extant transport table.

Thank you so much.

  Doc

--
Web:  http://enginehousebooks.com/drevans

Reply via email to