Re: Really not prefer IPv6 MX

Alessandro Vesely <[email protected]> Wed, 4 Dec 2024 13:21:31 +0100
Newsgroups gmane.mail.imap.courier.general
Message-ID <[email protected]>
On Tue 03/Dec/2024 22:29:48 +0100 Sam Varshavchik wrote:
> Alessandro Vesely writes: 
>> On Tue 03/Dec/2024 14:30:26 +0100 Sam Varshavchik wrote:
>>> Alessandro Vesely writes:
>>>>
>>>> I have ESMTP_PREFER_IPV6_MX=0 in courierd.  It doesn't seem to have any 
>>>> effect, as I introduced it after having fared without it for a while and 
>>>> didn't see much difference (similar preference is probably driven by 
>>>> gai.conf).  I get sporadic rejects like so:
>>>
>>> How recent is the code you're running? There were some issues related to 
>>> that which were fixed in 1.3.7, but having said that:
>>>
>>> ESMTP_PREFER_IPV6_MX=0 does not mean no IPv6 ever, it means that IPv4 is 
>>> tried first before trying IPv6. So if there was a connection failure to the 
>>> IPv4 address then the IPv6 address gets attempted, so in the outlined 
>>> scenario you could still get an occasional failure, because of that.
>>
>> I'm still at 1.3.5.  I browsed the code and that confirms me that setting 
>> ESMTP_PREFER_IPV6_MX=0 is the same as not setting it.  To get the behavior 
>> I'd like one would have to code something like, say,
>>
>>    if (rc == MX_OK && *prefer_ipv6 == 'N') rc2 = MX_NONE;
>>
>> That is, if IPv6 is really not preferred and IPv4 exist, pretend IPv6 does 
>> not.  But I won't propose a patch of that kind if I'd be the only one who 
>> ever uses it.  What you think?
> 
> Not sure where the above snippet is from, but 1.3.7 made some changes to this 
> logic, addressing some flaws that result in failures in some edge cases. Also, 
> there's still code that extracts A and AAAA records from MX query responses.


I had in mind to patch add_records(), in rfc1035mxlist.c, as it's the only 
place where ESMTP_PREFER_IPV6_MX is looked up, but at a closer look it wouldn't 
have worked.


> I think this change needs to be done at a higher level, in libesmtp.c when it 
> actually goes through the list of MXes, and then introduce the logic there to 
> skip unwanted IP addresses.


I just upgraded to 1.3.13;  I'll see what happens.


Best
Ale
-- 






_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users