-
Notifications
You must be signed in to change notification settings - Fork 50
Description
Hi,
the parameter RELAYHOST_MAP does not work as advertised.
RELAYHOST_MAP - Sender dependent relayhost map in format: RELAYHOST_MAP=@domain1.com:smtp.example.com:587,@domain2.com:[smtp.example.com]:587
I expect that, depending on the sender domain, the message will be routed to the given hosts listed in the map.
Instead, each message is sent to the host found in the MX record of the recipient's domain, and this setting is completely ignored.
The container log say:
postfix >> Generating relayhost map
postfix >> Adding from @regalgrid.com with smtp: [regalgrid-com.mail.protection.outlook.com]:25.
postfix >> Adding from @cogenera-italia.it with smtp: [cogeneraitalia-it02b.mail.protection.outlook.com]:25.
But this configuration is missing from /etc/postfix/main.cf and the postconf output.
The fix is adding this to main.cf
sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost-map
or rather, this command to line 166 of this file https://github.com/panubo/docker-postfix/blob/main/s6/postfix/run
postconf -e sender_dependent_relayhost_maps="hash:/etc/postfix/relayhost-map"