Warning (7/13/2007): Some users have reported having their accounts locked after using iGmail. This page is being left up for reference purposes only; you should not use this software.
The folk at Gmail have yet to provide an IMAP interface to their email service. While POP access is nice, there is no folder support and the messages are stateless (cannot be marked read, unread, important, etc.). iGmail is an IMAP server that runs between you and Gmail. You can use any IMAP client (outlook, outlook express, thunderbird, etc.) to connect to your gateway. iGmail is open source, and has been released under the GNU GPL v2.
Note (6/15/2007): The bug preventing msg importing has been fixed. Use version 0.2 from the releases page. The Windows binary version has *not* been updated yet.
iGmail will run on all platforms that python will run on (Windows, Linux, Unix, Mac OS X, OS/2, etc.). First, install python. Then, install Twisted. Then get the iGmail code. There are two ways to do this; if you have subversion installed you can do a svn co https://svn.butterfat.net/public/igmail/trunk iGmail. If not, you can download the package from here.
After uncompressing the files, edit the config.xml file. The datadir attribute at the top should contain the full path to an empty directory on your machine. This directory will contain the state information about your messages. If you would like to restrict access to your server to only certain named accounts, you can add user elements as shown in the comments in the config.xml file.
It's then recommended that you run the importmail.py script which will create the initial cache for the IMAP server. This may take a while. You run the script with python ./importmail.py email@example.com password. Running this initial import script is not necessary, but if you have a lot of messages in Gmail it is a good idea (this prevents your mail client from having to wait after it's first request to your server). Then you can start up the server with the twistd command (in Windows you may have to add C:\Python24\Scripts to your PATH environment variable). To start the server with logging to your current window, use twistd -noy igmail.tac.
You can now connect to your server using any IMAP mail client. Just set up a new IMAP account in your client, using a location of localhost for your incoming server location. The username you send to the server is the same username you use when you check your Gmail on Google.
Additional option for Windows:
You can download and run a binary distribution. There is no installation or need to have python, just set up your config.xml with the location of an empty data directory, then run the importmail program (from the command line):
C:\igmail> importmail.exe firstname.lastname@example.org mypassword
Then run igmail.exe. A command window will be open while igmail is running. You can stop the program by either closing the window or pressing ctrl-c. A nasty interface, I know; if anyone cares, I can make a prettier GUI version.
This part assumes you can connect to your server and see your folders. You can use your IMAP mail client now just as you would for any other IMAP account, with a few exceptions.
What does work
What sort of works
What does not work
Q. Why aren't all of my folders/labels showing up?
Q. Can I run importmail while the server is running?
Q. Do I have to run importmail or can I just start the server?
Q. How many people can log into the gateway at the same time?
Q. What is the air speed velocity of an unladen swallow?
Q. Why do I have to run this gateway instead of you running a general service for everyone?
Q. What information is cached in files by the gateway?
Q. Does iGmail send mail too?
Q. Who wrote this code and why is it shoddy?
How It Works
iGmail uses a modified version of libgmail to "talk" to Gmail's http interface. When you first log in to the iGmail gateway all of your message threads in all of your folders have to be "visited" (pulled via HTTP) to extract their message ids and create a message list to send to your mail client. Then, by implementing some interfaces with Twisted's IMAP server, you've got a working IMAP gateway. Every time your client asks for new messages, the gateway passes that request along to Google. When you get new mail, the message ids are added to the cache as well as their state ("Unread", etc), and then the message information is sent back to your mail client. The message ids and states are cached to provide instant responses to mail client queries for whole mailboxes. Note that when you have an attachment in a message, the attachment must first be downloaded by the gateway (it's actually a part of the message) before it can be sent to your client. This may cause a lengthy delay when downloading large attachments.
According to the Program Policies for Gmail, users may not Modify, adapt, translate, or reverse engineer any portion of the Gmail Service. Violation of the program policies could result in termination of service. Due to this policy, the iGmail software should not be used by anyone at any time for any purpose. I have released the code merely as an academic exercise; all references to actual usage should be considered purely hypothetical and disregarded.