imaplib

How to get UID of mail in All Maill folder if I have UID of this mail in inbox using imaplib? (GMail)

How to get UID of mail in All Maill folder if I have UID of this mail in inbox using imaplib? As you know the google store mails in the two instances in All Mail and in inbox I whant to move this to mail in trash folder using imaplib ...

parsing parenthesized list in python's imaplib

I am looking for simple way to split parenthesized lists that come out of IMAP responses into Python lists or tuples. I want to go from '(BODYSTRUCTURE ("text" "plain" ("charset" "ISO-8859-1") NIL NIL "quoted-printable" 1207 50 NIL NIL NIL NIL))' to (BODYSTRUCTURE, ("text", "plain", ("charset", "ISO-8859-1"), None, None, "quoted-prin...

Problem with removing mail message. use imap4

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 ('OK', [None]) and message was not removed: >>>import imaplib >>>server = imaplib.IMAP4_SSL('imap.gmail.com','993') >>>server.login('[email protected]','Password') >>>server.select('...

python email encoding problem

I am extracting emails from Gmail using the following: def getMsgs(): try: conn = imaplib.IMAP4_SSL("imap.gmail.com", 993) except: print 'Failed to connect' print 'Is your internet connection working?' sys.exit() try: conn.login(username, password) except: print 'Failed to login' print 'Is the username...