Peter Wienemann via Postfix-users: > Dear Wietse, > > On 2023-12-15 22:17:08 +0100, Wietse Venema via Postfix-users wrote: > > Peter Wienemann via Postfix-users: > >> 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: > > > > No. Given destinations (d1, d2), the pesudocode is: > > > > for each destination d in (d1, d2): > > > > try to deliver the remaining recipients to destination d > > > > if no recipients remain, stop. > > > > defer any remaining recipients > > > > The "program then "executes" the following steps: > > > > try to deliver the remaining recipients to destination d1 > > > > if no recipients remain, stop. > > > > try to deliver the remaining recipients to destination d2 > > > > if no recipients remain, stop. > > > > defer any remaining recipients. > > > >> (falling back to A/AAAA records after trying MX records) > > > > There is no such thing as falling back to A or AAAA records after > > trying MX records. The two are mutually exclusive. > > I am confused by the last two sentences. Let us consider a relay host
And then shows some examples that deminstarte that the using MX records is mutually exclusive with using address (A or AAAA) records. > If this is the case, I wonder what happens in the following situation: > > relayhost = example1.com, example2.com > > with the following DNS entries: > > example1.com: > A: ip4 > > example2.com: > MX: host5 (with ip5) > A: ip6 > > Assuming all IPs are accessible, will Postfix deliver emails to ip4 > (because example1.com is first in the relayhost list) or ip5 (because MX > records "win")? WTF. Given two destinations (d1, d2) were: d1 = example1.com d2 = example2.com The pesudocode is: for each destination d in (d1, d2): try to deliver the remaining recipients to destination d if no recipients remain, stop. defer any remaining recipients stop The "program" then "executes" the following steps: try to deliver the remaining recipients to destination d1 if no recipients remain, stop. try to deliver the remaining recipients to destination d2 if no recipients remain, stop. defer any remaining recipients. stop There is no way that Postfix will deliver to d2 (example2.com) before d1 (example.com). If these abstractions are too difficult, then perhaps you need to find a different line of bnusiness. Wietse _______________________________________________ Postfix-users mailing list -- postfix-users@postfix.org To unsubscribe send an email to postfix-users-le...@postfix.org