Merge pull request #27 from thekix/master
Include imaplib debug and avoid crash in search without results
This commit is contained in:
commit
33d9270d5a
@ -238,7 +238,7 @@ class IMAPFolder(BaseFolder):
|
|||||||
|
|
||||||
# Then, I can do the check in the same way than Python 2
|
# Then, I can do the check in the same way than Python 2
|
||||||
# with string comparison:
|
# with string comparison:
|
||||||
if ' ' in res_data[0] or res_data[0] == '':
|
if len(res_data) > 0 and (' ' in res_data[0] or res_data[0] == ''):
|
||||||
res_data = res_data[0].split()
|
res_data = res_data[0].split()
|
||||||
# Some servers are broken.
|
# Some servers are broken.
|
||||||
if 0 in res_data:
|
if 0 in res_data:
|
||||||
|
@ -515,6 +515,10 @@ class IMAPServer:
|
|||||||
curThread = currentThread()
|
curThread = currentThread()
|
||||||
imapobj = None
|
imapobj = None
|
||||||
|
|
||||||
|
imap_debug = 0
|
||||||
|
if 'imap' in self.ui.debuglist:
|
||||||
|
imap_debug = 5
|
||||||
|
|
||||||
if len(self.availableconnections): # One is available.
|
if len(self.availableconnections): # One is available.
|
||||||
# Try to find one that previously belonged to this thread
|
# Try to find one that previously belonged to this thread
|
||||||
# as an optimization. Start from the back since that's where
|
# as an optimization. Start from the back since that's where
|
||||||
@ -547,6 +551,7 @@ class IMAPServer:
|
|||||||
imapobj = imaplibutil.IMAP4_Tunnel(
|
imapobj = imaplibutil.IMAP4_Tunnel(
|
||||||
self.tunnel,
|
self.tunnel,
|
||||||
timeout=socket.getdefaulttimeout(),
|
timeout=socket.getdefaulttimeout(),
|
||||||
|
debug=imap_debug,
|
||||||
use_socket=self.proxied_socket,
|
use_socket=self.proxied_socket,
|
||||||
)
|
)
|
||||||
success = True
|
success = True
|
||||||
@ -563,6 +568,7 @@ class IMAPServer:
|
|||||||
ca_certs=self.sslcacertfile,
|
ca_certs=self.sslcacertfile,
|
||||||
cert_verify_cb=self.__verifycert,
|
cert_verify_cb=self.__verifycert,
|
||||||
ssl_version=self.sslversion,
|
ssl_version=self.sslversion,
|
||||||
|
debug=imap_debug,
|
||||||
timeout=socket.getdefaulttimeout(),
|
timeout=socket.getdefaulttimeout(),
|
||||||
fingerprint=self.fingerprint,
|
fingerprint=self.fingerprint,
|
||||||
use_socket=self.proxied_socket,
|
use_socket=self.proxied_socket,
|
||||||
@ -576,6 +582,7 @@ class IMAPServer:
|
|||||||
self.hostname, self.port,
|
self.hostname, self.port,
|
||||||
timeout=socket.getdefaulttimeout(),
|
timeout=socket.getdefaulttimeout(),
|
||||||
use_socket=self.proxied_socket,
|
use_socket=self.proxied_socket,
|
||||||
|
debug=imap_debug,
|
||||||
af=self.af,
|
af=self.af,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user