Skip to content

Instantly share code, notes, and snippets.

/filter.py Secret

Created August 29, 2013 14:33
Show Gist options
  • Save anonymous/bd96cbcd768ce9c2647d to your computer and use it in GitHub Desktop.
Save anonymous/bd96cbcd768ce9c2647d to your computer and use it in GitHub Desktop.
import gmail
import time
g = gmail.Gmail()
g.login()
print "login status: %s" % g.logged_in
time.sleep(2)
emails = g.inbox().mail(sender="example@example.org")
amt = len(emails)
print "Processing %s emails" % amt
if len(emails) > 0:
for mail in emails:
mail.read()
mail.archive()
g.logout()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment