Fetchmail produced a number of errors like: connection to localhost:smtp [::1/25] failed: Connection refused. These appeared to be caused by this /etc/hosts file: 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 which has two possible resolutions for localhost, one of which, namely "::1", isn't recognized. I attempted to fix things by eliminating the "::1" line, to produce the hosts file: 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 But using this file causes mounts on /media to fail (in my case a detachable hard drive and a camera). Both problems are cured with this hosts file: 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost6 localhost6.localdomain6
All this seems related to IPV6 configuration, but how isn't clear to me. Can anyone elucidate? Should I file a bug against the original /etc/hosts ?
Thanks - jon
Jonathan Ryshpan writes:
Fetchmail produced a number of errors like: connection to localhost:smtp [::1/25] failed: Connection refused. These appeared to be caused by this /etc/hosts file: 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 which has two possible resolutions for localhost, one of which, namely "::1", isn't recognized. I attempted to fix things by eliminating the "::1" line, to produce the hosts file: 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 But using this file causes mounts on /media to fail (in my case a detachable hard drive and a camera). Both problems are cured with this hosts file: 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost6 localhost6.localdomain6
All this seems related to IPV6 configuration, but how isn't clear to me. Can anyone elucidate? Should I file a bug against the original /etc/hosts ?
No. The ::1 entry is correct. Put it back. This is the IPv6 loopback address.
It seems that the current convention is that localhost4 and localhost4.localdomain4 are the fake hostnames for the IPv4 loopback address, localhost6 and localhost6.localdomain6 for the IPv6 loopback address, and localhost and localhost.localdomain is both. That seems reasonable to me.
fetchmail is reporting an error connecting to the local smtp daemon. Whatever you're running, postfix or sendmail, or something else, is not binding to the IPv6 port 25. I don't know if fetchmail tries IPv6 or IPv4 second, or the other way around. Either fetchmail is trying IPv6 first, fails to connect, then tries IPv4 and succeeds, or you don't have anything listening on port 25, either IPv4 and IPv6, and fetchmail is whining about both, and you're zeroing in on the IPv6 complaint.
In either case, the issue is not the hosts file, but either fetchmail or your smtp server configuration.
On 3/17/10 7:03 PM, Jonathan Ryshpan wrote:
Fetchmail produced a number of errors like: connection to localhost:smtp [::1/25] failed: Connection refused. These appeared to be caused by this /etc/hosts file: 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 which has two possible resolutions for localhost, one of which, namely "::1", isn't recognized. I attempted to fix things by eliminating the "::1" line, to produce the hosts file: 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 But using this file causes mounts on /media to fail (in my case a detachable hard drive and a camera). Both problems are cured with this hosts file: 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost6 localhost6.localdomain6
All this seems related to IPV6 configuration, but how isn't clear to me. Can anyone elucidate? Should I file a bug against the original /etc/hosts ?
In explanation, "::1" is the IPV6 equivalent of the IPV4 "127.0.0.1". There is nothing inherently wrong with having two IPs for a given host name (often done in DNS for "DNS round robin load balancing"), although it's not often done mixing IPV4 and IPV6.
As to why stuff on /mount would fail, that should have nothing to do with networking, unless the mounts are NFS or Samba mounts.