Merge pull request #4 from kacperkwapisz/fix/detect-drafts-folder
Fix drafts folder detection using non-existent imapclient constant
This commit is contained in:
+4
-5
@@ -353,11 +353,10 @@ def detect_archive_folder(client: IMAPClient) -> str:
|
||||
|
||||
|
||||
def detect_drafts_folder(client: IMAPClient) -> str:
|
||||
import imapclient as imc
|
||||
|
||||
result = client.find_special_folder(imc.DRAFTS)
|
||||
if result:
|
||||
return result
|
||||
folders = client.list_folders()
|
||||
for flags, _delim, name in folders:
|
||||
if b"\\Drafts" in flags:
|
||||
return name
|
||||
for name in ("Drafts", "[Gmail]/Drafts", "INBOX.Drafts"):
|
||||
if client.folder_exists(name):
|
||||
return name
|
||||
|
||||
Reference in New Issue
Block a user