4

I am trying to setup MTA which should submit different intranet mail gateways based on the recipient's domain. For that I thinks transport_maps in postfix should be setup for selective domains; if recipient domain is not matched with any line in transport_maps than it will do default delivery which is smtp. What I am confused is whether to use relay or use smtp as transport types and what difference will it make.

Based on received answers one difference is MX priortization, but I turn off mx discovery by enclosing ip/domain in big brackets, will both of them be same or is there any other difference which I am missing.

2 Answers 2

3

relay tells postfix to deliver emails via a specific mailserver. You can see it as a simplified and faster delivery protocols, which does not obey to things as MX priority specifications.

smtp transport is the full SMTP implementation, which strictly follows the relative RFCs.

To sent emails for a domain via a specific server I would use relay. This is consistent with transport man page:

relay_transport (default: relay:)

6
  • But I turn off mx discovery by enclosing ip in big brackets, will both of them be same or is there any other difference which I am missing. Dec 4, 2023 at 1:35
  • 1
    In this case they would be very similar except that mails will be queued into two different queues, which can be useful to decrease contention / increase performance.
    – shodanshok
    Dec 4, 2023 at 7:00
  • I may sound stupid but can you please explain why different queues. Dec 4, 2023 at 13:12
  • Because different transport processes/protocols use different queues - by design. From here: 'This uses the "relay" delivery transport (a copy of the default "smtp" delivery transport) to forward inbound mail. This can improve performance of deliveries to internal domains because they will compete for SMTP clients from the "relay" delivery transport, instead of competing with other SMTP deliveries for SMTP clients from the default "smtp" delivery transport.'
    – shodanshok
    Dec 4, 2023 at 16:58
  • Thanks a lot. But while going through the standard configuration you gave I have another doubt that how "parent_domain_matches_subdomains = debug_peer_list, smtpd_access_maps" this would help in blocking sub domains fron reception. Say if I have a single line which allows only my domain emails in access maps it will make the matter worse by matching sub domains with that line too, isn't it. Dec 4, 2023 at 23:44
1

When the transport is relay, Postfix will not send to the backup MX. This can be used on said backup MX, to avoid loops to itself.

In general, I would not use fallback MX BTW. They are often targetted by spammers.

1
  • 1
    Please see modified question. Dec 4, 2023 at 1:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .