martinrusev / imbox

Python IMAP for Human beings
MIT License
1.18k stars 190 forks source link

Filter multiple emails by "sent_from" feature doesn't work when multiple parameters are used. #238

Open Ezj-Amon opened 1 year ago

Ezj-Amon commented 1 year ago

I want to filter multiple emails in the 'sent_from' parameter of messages, but it only works when the parameter is a single email address. I tried giving it a list or tuple, but it doesn't work.

for example: it works: all_inbox_messages = imbox.messages(sent_from='xxx@xxx.com')

it doesn't work: all_inbox_messages = imbox.messages(sent_from=['xxx@xxx.com','yyy@yy.com'])

AT0myks commented 1 year ago

This is not supported right now, giving a sequence to sent_from will produce a search for (FROM "['xxx@xxx.com', 'yyy@yy.com']") which means that it will search for emails sent by the address ['xxx@xxx.com', 'yyy@yy.com']. This is obviously not a valid address, and that's why no results are returned.

Ezj-Amon commented 1 year ago

This is not supported right now, giving a sequence to sent_from will produce a search for (FROM "['xxx@xxx.com', 'yyy@yy.com']") which means that it will search for emails sent by the address ['xxx@xxx.com', 'yyy@yy.com']. This is obviously not a valid address, and that's why no results are returned.

OK,thankyou