Currently, I use
latest_mails = account.inbox.filter(datetime_received__gt=emails_since)
But it seems to miss received emails which are in subfolders.
Printing all folders with
for f in account.root.get_folders():
print(f)
gives something like
Calendar (Kalender)
Contacts (Kontakte)
Contacts (Vorgeschlagene Kontakte)
Folder (AllItems)
Folder (Calendar Logging)
Folder (Common Views)
Folder (Conversation Action Settings)
Folder (Deferred Action)
Folder (Deletions)
Folder (Erinnerungen)
Folder (ExchangeSyncData)
Folder (Finder)
Folder (Infected Items)
Folder (Journal)
Folder (Location)
Folder (MailboxAssociations)
Folder (Notizen)
Folder (Recipient Cache)
Folder (Recoverable Items)
Folder (Schedule)
Folder (Shortcuts)
Folder (Spooler Queue)
Folder (System)
Folder (Versions)
Folder (Views)
Folder (WorkingSet)
Messages (Postausgang)
Messages (Posteingang)
Messages (foo)
Messages (bar)
Messages (something is)
Messages (here)
Messages (Gelöschte Elemente)
Messages (Gesendete Elemente)
Messages (Junk-E-Mail)
Messages (Meine Kontakte)
Messages (MyContactsExtended)
Messages (Nachverfolgte E-Mail-Verarbeitung)
Messages (Zugang)
Tasks (Aufgaben)
Tasks (Aufgabensuche)
So I only want to look at the "Messages" folders, but at all of them. Is that possible (without using account.root.get_folders()
) and looping over the results (which took about 5 minutes)