On 06.05.21 10:37, Vytenis Adm wrote:
We have a postfix server, which forwards all customer's outbound emails to a "relayhost". Our "relayhost" is somewhat costly, so our goal is to minimize it's usage. MX is served by separate Postfix instance.

Our goal is to deliver local emails to our MX directly, bypassing "relayhost". Several clients are sharing the infrastructure, so querying DB to see whether the domain is local is tricky: this may lead to abuse when the domain changes ownership, or emails delivered locally when MX is remote, as some customers have their own NS.

"check_recipient_mx_access" option looked promising.

this applies for incoming mail, not outgoing.

Unfortunately, some clients have our MX as a secondary, and "check_recipient_mx_access" ignores the fact that primary MX is remote. Also, it ignores the fact that emails contain remote addresses in CC

Option we're considering is using a DNS response rewriting. If the MX is not matching as a local one - rewrite it to "relayhost". This sounds like a dirty hack however.

Maybe there are other options or ideas?

tried looking at transport_maps ?
http://www.postfix.org/postconf.5.html#transport_maps

you should be able to configure where to send mail to different domains, and
"relayhost" would only be applied for default mail
--
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Saving Private Ryan...
Private Ryan exists. Overwrite? (Y/N)

Reply via email to