Merge pull request #33164 from sokumon/handle-logout
fix: handle abort while logout
This commit is contained in:
commit
baca028f83
1 changed files with 8 additions and 4 deletions
|
|
@ -162,10 +162,14 @@ class EmailServer:
|
|||
return res[0] == "OK" # The folder exists TODO: handle other responses too
|
||||
|
||||
def logout(self):
|
||||
if cint(self.settings.use_imap):
|
||||
self.imap.logout()
|
||||
else:
|
||||
self.pop.quit()
|
||||
try:
|
||||
if cint(self.settings.use_imap):
|
||||
self.imap.logout()
|
||||
else:
|
||||
self.pop.quit()
|
||||
except imaplib.IMAP4.abort:
|
||||
self.connect()
|
||||
self.logout()
|
||||
return
|
||||
|
||||
def get_messages(self, folder="INBOX"):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue