目前,我用如何使用exchangelib從所有文件夾中獲取最新電子郵件?
latest_mails = account.inbox.filter(datetime_received__gt=emails_since)
但似乎錯過接收到的電子郵件這是在子文件夾。
打印所有文件夾與
for f in account.root.get_folders():
print(f)
給出類似
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)
所以我只是想看看「信息」的文件夾,但是所有的人。這是可能的(不使用account.root.get_folders()
)和循環結果(大約需要5分鐘)
另請參閱:https://github.com/ecederstrand/exchangelib/issues/30#issuecomment-257429078 - 但我不知道「Messages」來自哪裏。 –
'from exchangelib.folders import Messages'似乎是 –