]> code.delx.au - offlineimap/commit
Check all resolved addresses [deb #413030]
authorJohn Goerzen <jgoerzen@complete.org>
Thu, 8 Mar 2007 01:59:32 +0000 (02:59 +0100)
committerJohn Goerzen <jgoerzen@complete.org>
Thu, 8 Mar 2007 01:59:32 +0000 (02:59 +0100)
commit82d5d5e675ca44c35dd1b1295c065d3b34d339f2
tree072881f8fb0e48a64353250955e2a6549b6693e4
parentca3a306eccc21e7df7e73610c209bb58ab8ff14b
Check all resolved addresses [deb #413030]

From: Mark Brown <broonie@sirena.org.uk>
Currently offlineimap will attempt to connect to the first address
returned by addrinfo() for the remote system and will fail if that fails
even if another result would have worked.  This is particularly common
when the remote system supports both IPv4 and IPv6 - a laptop may in
some environments have no routable IPv6 connectivity so if the IPv6
address is returned first the connect will fail even though IPv4 would
have worked.

This is actually a bug in imaplib, a copy of which is included in
offlineimap.  This patch fixes the problem by looping over all the
results returned by getaddrinfo().  Unfortunately it mangles the error
reporting slightly since I couldn't work out how to raise an appropriate
exception, though given that that that was a Python backtrace there was
work to do there anyway.

Note that I have only tested the SSL case.
offlineimap/imaplib.py