Project Page | Downloads | Contact
The libgmail project is a pure Python binding to provide access to Google's Gmail web-mail service.
Please note: Always download and test the CVS version of libgmail if you are having problems.
The following code logs into an account, retrieves a list of threads, displays information about them and displays the source of the individual messages.
import libgmail ga = libgmail.GmailAccount("firstname.lastname@example.org", "mymailismypass") ga.login() folder = ga.getMessagesByFolder('inbox') for thread in folder: print thread.id, len(thread), thread.subject for msg in thread: print " ", msg.id, msg.number, msg.subject print msg.source
The library currently ships with one demonstration utility to archive messages from an Gmail account into mbox files, suitable for importing into a local email client.
The library now includes a demonstration utility gmailsmtp.py that sets up a SMTP proxy on port 8025 of your computer to enable you to use a standard mail client (e.g. Mozilla, Mail.app) to send messages. (Attachments are now supported.)
The library now includes a demonstration utility gmailpopd.py that sets up a POP3 proxy on port 8110 of your computer to enable you to use a standard mail client (e.g. Mozilla, Mail.app) to retrieve messages.
The included demonstration gmailftpd.py sets up a download-only FTP proxy on port 8021 of your computer to enable you to use a standard ftp client to retrieve message attachments that have the label 'ftp'.
License: GPL 2.0