Created
May 17, 2017 09:52
-
-
Save mjs/e50dc58938691d39faf7c4eeacc23323 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imap = imapclient.IMAPClient(server) | |
imap.login(username, getpass()) | |
imap.select_folder('INBOX') | |
messages = imap.search(['NOT', 'DELETED']) | |
for message_id, data in imap.fetch(messages, ['RFC822']).iteritems(): | |
body = data['RFC822'] | |
# do stuff with message_id and body... | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment