From e3bbf75feb1f4259ee1a8da14bb2ea9acd92a496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Fri, 3 Feb 2017 01:11:56 +0100 Subject: [PATCH] Fix ipv6 configuration handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to documentation and the code, the following behavior is expected: ipv6 = no AF_INET is used ipv6 = yes AF_INET6 is used ipv6 undefined AF_UNDEF is used Unfortunately the code parsing the "ipv6" configuration option was returning "False" rather than "None" when failing to locate the option, making it impossible to detect whether "ipv6" isn't set or if it was set to "false" and leading offlineimap to use AF_INET for the connection. This fixes the use of offlineimap on hosts that occasionaly are connected to IPv6-only networks. Signed-off-by: Stéphane Graber Signed-off-by: Nicolas Sebrecht --- offlineimap/repository/IMAP.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py index 9c0ee20..7581858 100644 --- a/offlineimap/repository/IMAP.py +++ b/offlineimap/repository/IMAP.py @@ -222,7 +222,7 @@ class IMAPRepository(BaseRepository): return self.getconfint('remoteport', None) def getipv6(self): - return self.getconfboolean('ipv6', False) + return self.getconfboolean('ipv6', None) def getssl(self): return self.getconfboolean('ssl', True)