Fix ipv6 configuration handling

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 <stgraber@ubuntu.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Stéphane Graber 2017-02-03 01:11:56 +01:00 committed by Nicolas Sebrecht
parent 4df06d57c3
commit e3bbf75feb

View File

@ -222,7 +222,7 @@ class IMAPRepository(BaseRepository):
return self.getconfint('remoteport', None) return self.getconfint('remoteport', None)
def getipv6(self): def getipv6(self):
return self.getconfboolean('ipv6', False) return self.getconfboolean('ipv6', None)
def getssl(self): def getssl(self):
return self.getconfboolean('ssl', True) return self.getconfboolean('ssl', True)