mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2025-12-06 08:52:55 +01:00
Shutdown IMAP connection when done with it.
This commit is contained in:
parent
637c6e3cc3
commit
921f8c287b
1 changed files with 76 additions and 73 deletions
|
|
@ -193,6 +193,7 @@ def get_urls_from_imap(srv,user,passwd,folder,markread=True,normalize_urls=False
|
|||
|
||||
# logger.debug("get_urls_from_imap srv:(%s)"%srv)
|
||||
mail = imaplib.IMAP4_SSL(srv)
|
||||
try:
|
||||
status = mail.login(user, passwd)
|
||||
if status[0] != 'OK':
|
||||
raise FetchEmailFailed("Failed to login to mail server")
|
||||
|
|
@ -277,6 +278,8 @@ def get_urls_from_imap(srv,user,passwd,folder,markread=True,normalize_urls=False
|
|||
[ urls.add(x) for x in urllist ]
|
||||
|
||||
return urls
|
||||
finally:
|
||||
mail.shutdown()
|
||||
|
||||
# used by drag-n-drop of email from thunderbird onto Calibre.
|
||||
def get_urls_from_mime(mime_data):
|
||||
|
|
|
|||
Loading…
Reference in a new issue