I try to remove message from inbox folder and all alright, but when i switched to All Mail folder the removing does not work. expunge()
method returns (\'
it moves all the mail in a given gmail label to the gmail Trash
#!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
Remember to refresh your gmail interface cause it has cache