catch SSL/TLS errors on stale IMAP connections

workspace
Brendan Howell 5 years ago
parent 515ad8e325
commit 92108a875a

@ -10,6 +10,7 @@ import string
import imapclient
import kode256
from ssl import SSLSyscallError
from bureau import Bureau, add_command, add_api
@ -75,7 +76,7 @@ class MailRoom(Bureau):
"""
try:
self.imapserv.select_folder("INBOX")
except self.imapserv.AbortError as err:
except (self.imapserv.AbortError, SSLSyscallError) as err:
self.log.debug("reconnecting after imap connection error: ", err)
self.imapserv.logout()
self.imapserv = imapclient.IMAPClient(self.host, use_uid=True, ssl=self.imap_ssl)

Loading…
Cancel
Save