Merge pull request #4 from kacperkwapisz/fix/detect-drafts-folder

Fix drafts folder detection using non-existent imapclient constant
This commit is contained in:
0xK
2026-03-24 16:41:12 +01:00
committed by GitHub
+4 -5
View File
@@ -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