On Sun, 22 Jan 2023 16:28:55 -0500 Dan Ritter <d...@randomstring.org> wrote:
> Celejar wrote: > > Hello, > > > > My Debian Sid system, including its networking system, has been > > working fine for a while. Recently, Gmail has not been working properly > > on the system: sending (via SMTP with SSL) times out, and receiving > > (via POP3 and IMAP) takes abnormally long. Today I finally made some > > efforts to understand what's going on. Here's what I know / > > understand / have been able to establish: > > > > 1) My ISP provides me with only IPv4, not IPv6. > > > > 2) Trying to send email through Gmail using "smtp.gmail.com", via > > Sylpheed and Swaks, times out without getting anywhere. For example: > > > > $ swaks -t cele...@gmail.com -s smtp.gmail.com:587 -tls -a LOGIN > > Username: celejar > > Password: ******** > > === Trying smtp.gmail.com:587... > > *** Error connecting to smtp.gmail.com:587: > > *** IO::Socket::INET6: connect: timeout > > > > 3) Forcing the use of IPv4 fixes the timeout problem. In particular, > > both of the following work (in the second command, the IPv4 address is > > the one returned by "dig" and "host" for "smtp.gmail.com"): > > > > $ swaks -t cele...@gmail.com -4 -s smtp.gmail.com:587 -tls -a LOGIN > > $ swaks -t cele...@gmail.com -s 142.251.163.109:587 -tls -a LOGIN > > > > So, what's going on here? I suppose I don't really need IPv6 on my > > system, but everything I've read says that it should be left enabled and > > not disabled. Is something misconfigured on my system, is this a Gmail > > problem, or am I missing something else? > > Your system expects to be able to use IPv4 and IPv6. Google > handles both. Your ISP does not. DNS returns both IPv4 A records > and IPv6 AAAA records for smtp.gmail.com. > > In this particular case, you should change your system > preference to IPv4 first. > > In /etc/gai.conf: > > UNcomment > > precedence ::ffff:0:0/96 100 > > and that should solve the issue immediately, at the cost of > making IPv6 unusable until you re-comment that. Thank you very much - this seems to have worked! I understand now that the reason I only had the problem with Gmail and not with the other major commercial email provider I use, GMX, is that "smtp.gmx.com" has only an IPv4 address record and no IPv6 address record. And I suppose the reason I wasn't seeing this problem with web browsing is that web browsers (on their default settings?) try both IPv4 and IPv6 simultaneously, and use whatever responses they get without waiting. Shouldn't this be included somewhere prominently in the Debian documentation, in the form of a Big Fat Warning that the standard dual-stack condiguration used by Debian can cause serious breakage if one's ISP doesn't support IPv6? (I'd be happy to add a warning to, say, https://wiki.debian.org/DebianIPv6, if I thought I understood the issues well enough to get it right.) -- Celejar