Gmail IMAP

25 10 2007

The big news in the blogosphere today is that Gmail is now supporting IMAP connections – or they will soon. This is a quick set of instructions to get Gmail working “right” with Thunderbird, because initially, Thunderbird and Gmail don’t quite gel like they should.

First, follow the instructions here. That should get basic IMAP functionality going. Then a few things you need to do:

  1. In Thunderbird, find Account Settings (either under Tools or Edit). Find your Gmail account in the resulting window and select “Copies & Folders”.
  2. Under “Place a copy in:”, choose Other, and pick Sent Mail under Gmail > [Gmail]. Apparently, it “just works”.
  3. Repeat as appropriate for Drafts.
  4. Close out Thunderbird completely (make sure you’ve caught every last pesky hidden window).
  5. Find and open up prefs.js in your choice of editor. You should also make a backup of prefs.js.
  6. Figure out which of the servers is your Gmail account – this means basically, find the line that says “user_pref(“mail.server.server#.hostname”, “imap.gmail.com”);”. Make a note of that server#.
  7. Add the following below that line: “user_pref(“mail.server.server#.trash_folder_name”, “[Gmail]/Trash”);” replacing # with the server you identified in the step above.
  8. Save and close out the prefs.js file.
  9. This is key – start Thunderbird and check that Trash is not appearing immediately below Inbox. If it is, then there was a glitch somewhere and it did not work because of the glitch. Where the glitch is… I don’t know, it seems to be random, so try restarting Thunderbird. It doesn’t matter what icon the folder has – it took between two and three restarts of Thunderbird for the icon to show up correctly.
  10. Finally, once all of this is working okay, fire up Gmail’s webmail interface and choose to edit labels, deleting any [IMAP] labels that may have appeared. Note that this doesn’t actually delete any messages tagged with it – just the label itself.

One thing I’ve not managed to figure out is whether step #2 is necessary – I think it is, but it’s also possible Gmail automatically places a copy of everything you send through the Gmail SMTP server there. I’ll do some more sleuthing and figure that out when I get a chance. Gmail saves all mail you send through your SMTP server automatically to your sent mail folder, so you don’t need to get Thunderbird to place a copy there as well. In fact, you’ll end up with duplicates.

Good luck and hooray for Gmail IMAP.


Actions

Informations

10 responses to “Gmail IMAP”

27 10 2007
hurcane (15:08:25) :

You can disable the option to save a copy of sent mail in Thunderbird. If the message is sent through smtp.gmail.com, it will show up in the Sent Mail folder. If Thunderbird makes a copy, you will see two copies in Gmail. There will be a single conversation, but the conversation will have both messages in it.

29 10 2007
Thunderbird POP to Gmail IMAP (18:48:46) :

[...] of doing this by adding a new string within config but I could not get this to work whereas this tutorial worked [...]

21 11 2007
Dimitri Alexeev (09:07:09) :

I used “[Google Mail]/Trash” instead of “[Gmail]/Trash”.
now it works

21 11 2007
varun (09:13:51) :

Indeed – should work for UK and Germany based Google Mail accounts since the GMail trademark isn’t held by Google there.

24 11 2007
Nevergrowup - Software and Fun (11:27:46) :

Trash in Google IMAP and Thunderbird …

We all know now about the great new option Gmail has given us: IMAP. Where POP just downloads your mail from the gmail-servers once (and maybe even removes them from the server), IMAP synchronizes your mail-client with the server. Thus making it possi…

13 09 2008
Ravan (07:41:14) :

Thanks for this How-to :) only…

Funny how this does not seem to work for a SECOND gmail imap account in Thunderbird…

Only the first one (with lower #) will get that proper Trash folder set up. That works perfetly. But with the second one, the local trash disappears but when deleing messages, nothing happens! :(

Any idea how to get around this one?

14 09 2008
Varun (09:30:56) :

Interesting – I’ve never seen that glitch. Two things you may want to try: empty the trash once in Gmail’s web interface and see if that improves things; and, just check to make sure the string in your .trash_folder_name is correct – [GMail]/Trash. (The second suggestion is to cover bases, not to imply PEBKAC; a number of people have contact me to ask about that, and it’s been fixed just like that…)

Unfortunately, I often find that if something goes wrong in Thunderbird, you basically have no choice but to start over. If you’re on a reasonably fast connection, why not delete the account and start over? That way if there is a problem with your specific config, it ought to be cleaned up. If it reoccurs, see if a fresh install (ThunderbirdPortable, perhaps?) works for you.

24 09 2008
Lazy_R (16:08:12) :

When you’re moving a file to the [GMail]/Trash folder, you’re actually telling GMail to remove ALL other labels, apply the [GMail]/Trash label and delete it entirely after 30 days.

You should be careful with that. Because when you ‘copy’ a file from on folder to another by accident in Thunderbird and decide to delete it, it will be removed from all ‘folders’ including ‘All messages’.

The best option IMHO is to set Thunderbird to Remove it immediately at the Server Settings. This way you remove the labels one by one. Also you can’t remove the [Gmail]/All messages label. It will dissapear in thunderbird, but after a refresh it’s gone.
*(I had to restart Thunderbird twice before the trash icon disappeared from Thunderbird).

When you want to get rid of an e-mail entirely, from all folders/labels, including All messages, you can manually move it to the [GMail]/Trash folder. GMail will remove it from there after 30 days.

24 09 2008
Lazy_R (16:15:59) :

<q cite=”It will dissapear in thunderbird, but after a refresh it’s gone.”

Of course I ment: After a refresh it’s back

29 09 2008
Lazy_R (11:14:40) :

…Apparantly, when you move the messages to [GMail]/Trash and delete it from there (with Thunderbird), they are actually gone.

Well… at least you can’t find them anymore ;-) . Of course ALL of your e-mail is stored on the Google servers, even after deletion. It doesn’t matter whether you choose to use the web interface or not.

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>