Skip to content

RELAYHOST_MAP is ignored #53

@valentinomariotto

Description

@valentinomariotto

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions