Score:0

How can I configure postfix to allow relay for one specific recipient/destination email address?

ie flag
rvh

My postfix install denies relaying. But I'd like to configure it to make an exception for one specific destination address or a specific domain?

For example, allow relaying of all messages from anyone destined for [email protected] or @example.com, but continue to deny relaying for all other cases.

How would that exception be configured in postfix?

FatRabbit avatar
in flag
can you show us at least your postfix configuration?
Score:0
us flag
Rob

allow relaying of all messages from anyone destined for [email protected] or @example.com

Which parameter is used to configure relaying based on destination domain is explained in the manual:

https://www.postfix.org/BASIC_CONFIGURATION_README.html#relay_to

In other words, add example.com to relayhost = separated with a comma and/or whitespace from any existing entries.

For a single address, no idea.

Score:0
ie flag
rvh

some trial and error but finally figured this out.

tested and confirmed on postfix versions 2.10.1 and 3.4.13.

start with a postfix server that blocks all relays.

to allow relaying for one specific recipient address, such as [email protected], create a file like, /etc/postfix/relay_recipients.

in the file add the line: [email protected] x

then create a lookup table using this command:

postmap /etc/postfix/relay_recipients

then in main.cf add:

relay_domains = example.com
relay_recipient_maps = hash:/etc/postfix/relay_recipients

restart postfix.

now postfix will continue to block all relays, except when the recipient email address is [email protected].

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.