Timeout connecting to localhost
Some of my mailinglists have been remarkably quiet of late. And some specific mail I’ve been expecting has … also gone quiet.
That’s the kind of thing you furrow your brow at first time, and get increasingly concerned if it persists. Today I reached a critical point: chased down the problem and sorted it.
Background: I run an IMAP server that manages most of my mail. It’s on the server that receives mail for my most widely-used address, and it collects mail from from other servers with a cron job running fetchmail. One of those servers is apache’s minotaur (people.apache.org), which collects all mail addressed to my @apache.org address. And that had stopped working. Not just an occasional failure (that’s usual), but persistently over several days.
I had already logged in to minotaur, and with a local mailer (alpine) verified that mail was arriving for that address. So it’s the fetchmail that was failing. I logged into the imap server, and tried running fetchmail from the commandline. It timed out trying to connect to minotaur.
OK, that’s a POP3 connection tunneled over ssh. What happens if I log in to minotaur and try to connect to POP3 directly from there?
minotaur% telnet localhost pop3 Trying ::1... telnet: connect to address ::1: Operation timed out Trying 127.0.0.1... Connected to localhost.apache.org.
Right. It’s trying an IPv6 connection. But there’s none to be had, and evidently no TCP response. So it’s timing out like a sticky firewall. It stuck on “Trying ::1…” for a very long time – enough for fetchmail to time out.
Solution: change “localhost” to “127.0.0.1” in my .fetchmailrc. Now to wade through all that newly-collected mail😦