imapfilter
imapfilter copied to clipboard
Can't search email in folder / label
I don't how to "select"/search all messages of a user defined folder / tag / label (don't know the right term for Gmail), I thought it was:
messages = account1["Lecture"]
print(#messages)
But it print 0
I'me sure I have message in this folder because I moved one just before with imapfilter:
messages = account1.INBOX:contain_subject("test imapfilter")
messages:move_messages(account1["Lecture"])
Thanks
The account1["Lecture"] is a mailbox object, not a collection of all messages of the mailbox. You need to send a search query for all messages, and you do that with select_all():
messages = account1["Lecture"]:select_all()
print(#messages)