Archiving emails in Gmail

Thomas Jollans thomas at jollans.com
Tue Jun 15 05:39:43 EDT 2010


On 06/15/2010 11:07 AM, teja wrote:
> And there's a email library provided in Python (supports both POP and
> SMTP) but I dont know whether it allows us to archive mails or mark
> them as read for that matter.

POP (the protocol) only allows downloading messages, AFAIK. SMTP is for
sending. A more powerful e-mail protocol is IMAP, which gmail also
supports. I don't know about Python libraries, you'll probably find a
reasonably full-featured one, but IMAP supports marking messages as read.

As for archiving, I'm guessing that this'd be implemented by moving
messages to an "archive" folder.

Maybe you should connect to gmail with an email client (Thunderbird is
nice) via IMAP and check
 1. whether you can archive mails from there
 2. how exactly gmail archiving maps to IMAP
and then implement it using IMAP, having your script just do the same
thing you did in Thunderbird, WLM, Sylpheed, Mail.app, or whatever
you're using.

Have fun,
Thomas




More information about the Python-list mailing list