ikvk / imap_tools

Work with email by IMAP
Apache License 2.0
713 stars 82 forks source link

folder exists check function misbehavior #243

Open zssng opened 2 weeks ago

zssng commented 2 weeks ago

mailbox.folder.exists check "70 发票/lli哦i哦 噢" folder always return False, even if it exist

ikvk commented 2 weeks ago

hi, ill see it

ikvk commented 2 weeks ago

I have checked it and it works. Try to check delimiters, for example for YANDEX box name will be: folder_name = '70 发票|lli哦i哦 噢' Delimiter is "|"

zssng commented 2 weeks ago

image image 😅,I have the folder,but code return false

zssng commented 2 weeks ago

image image

zssng commented 2 weeks ago

I can create subfolder with "70 发票/lli哦i哦 噢", just can't check if it exists

ikvk commented 2 weeks ago

Try to run with debugger. What mailbox provider?

zssng commented 2 weeks ago

exmail.qq.com

ikvk commented 2 weeks ago
folder_name = '70 发票|lli哦i哦 噢'
for f in mailbox.folder.list():
    print(f.name)
print('exists:', mailbox.folder.exists(folder_name))

INBOX 70 发票 70 发票|lli哦i哦 噢 ... exists: True

Try to see at debugger, it is interesting - what is wrong.

ikvk commented 1 week ago

@zssng, whats news )?

zssng commented 1 week ago

image image image it seems like list func return None

ikvk commented 1 week ago

Try to run code like this: mailbox.folder.list('', 'INDEX') Is it works?

Then some more complex: mailbox.folder.list('', 'INDEX/123') ...