[2023-10-18 11:42] Omar Polo <o...@omarpolo.com> > On 2023/10/18 08:40:14 +0100, Stuart Henderson <s...@spacehopper.org> wrote: > > On 2023/10/17 22:27, Philipp wrote: > > > [2023-10-17 17:32] Omar Polo <o...@omarpolo.com> > > > > [...] > > > > But I don't think your proposed patch is a good solution, because the > > > result depend on the order of the RR in the repsonse. The problem is > > > when the first entry in the response is a Null MX your patch truncate > > > the other results and a bounce is generated. But when the Null MX is > > > later in the response the other entries are used to deliver the mail. > > that's true; I fell for a shorter diff. I've attached below a version > that doesn't depend on the order.
Your patch looks mostly good. I only have a small nitpick style comment: > + > + if (rr.rr.mx.preference == 0 && !strcmp(buf, "")) { strcmp doesn't return a bool like value. Something like: if (rr.rr.mx.preference == 0 && strcmp(buf, "") == 0) is imho better to read.