Created
January 25, 2017 09:20
-
-
Save peko/00cc6de0c35220771f41524884967169 to your computer and use it in GitHub Desktop.
Trash gmail
This file contains hidden or 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
#!usr/bin/python | |
import email, imaplib | |
user = 'xxx' | |
pwd = 'xxx' | |
m = imaplib.IMAP4_SSL("imap.gmail.com") | |
m.login(user,pwd) | |
m.select("some_gmail_label") | |
m.store("1:*",'+X-GM-LABELS', '\\Trash') | |
m.expunge() # should be useless, but gmail server says it is ok |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment