On 2023-12-12 15:51:58 +0100, Wietse Venema via Postfix-users wrote:
Peter Wienemann via Postfix-users:
Dear Postfix experts,

checking the documentation for the relayhost parameter [0] I find no
indication how Postfix behaves in case of multiple relay hosts with
multiple DNS entries. Let us assume the following setting:

     for each destination d in relayhost:

         try to deliver the remaining recipients to destination d

         if no recipients remain, stop.

     defer any remaining recipients

Perhaps surprisingly, Postfix delivers mail to "destination d" for
all supported forms of "d", whether that is a domain name, [hostname],
[ipaddress], and with or without an explicit :port.

Thanks Wietse! Your pseudo-code clarifies the approach chosen by Postfix. What still remains unclear to me is the order in which destinations are tried. Let us again consider the following example:

relayhost = mail1.example.com, mail2.example.com

I think RFC 5321 requires that one starts with MX records before falling back to A or AAAA records (unless [] notation is used). So my guess is that the trial sequence starts in the following way:

1. Try all MX records for mail1.example.com.

2. What comes next? Try all MX records for mail2.example.com? Or try A records for mail1.example.com? Or try AAAA records for mail1.example.com? Or is some randomness involved?

Best regards,

Peter
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to