Multiple recipients and separate transport (via FILTER) per recipient
(too old to reply)
2020-11-15 15:56:09 UTC

I have set up a default smart host/relay host for all external mail as follows:


relayhost = []:587

However, I want mail for recipients with specific MX (n.b. *google.com) to be sent directly, bypassing the relayhost, so I did:


smtpd_recipient_restrictions =
check_recipient_mx_access pcre:/etc/postfix/mxtransport

/google\.com$/ FILTER smtp:
/googlemail\.com$/i FILTER smtp:

This is working as expected for a single recipient. However, if mail is addressed to multiple recipients (using To:/Cc:/Bcc:) and some of the specified recipients satisfy the mxtransport rule and some do not, Postfix sends mail to ALL recipients directly, ignoring the default relayhost definition.

For example, if I send email to ***@gmail.com, Postfix correctly sets the filter and sends mail directly without using smarthost. However, if I send mail to multiple recipients: ***@outlook.com, ***@gmail.com, it would skip smarthost and send mail directly to both recipients, if FILTER rule had been applied to both.

Is it possible to have different transport per recipient when multiple recipients are specified?
2020-11-16 12:59:37 UTC
I am hoping my question is not difficult to coprehend and that it describes well enough the issue I am having? Any ideas how to solve this issue would be greatly appreciated! Thanks.