[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postfix-users
Subject:    Re: sender_dependent_relayhost_maps
From:       "D. R. Evans" <doc.evans () gmail ! com>
Date:       2023-02-22 17:40:04
Message-ID: 29de3fb4-8423-1c56-3a3f-2a1255e233ad () gmail ! com
[Download RAW message or body]

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 N7DR@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 N7DR@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=<N7DR@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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic