Configuring Thunderbird for Gmail IMAP the way it should be done

I recently made a post on how to configure Windows Live Mail Beta (client) for Gmail’s new IMAP offering. I wasn’t very comfortable with the application and wanted to give Thunderbird a try (again). Although Foxmail has been my primary e-mail client, it does not support IMAP.

The first step is to follow the instructions at the Gmail Help Center for setting up Thunderbird as you IMAP client. Once that is done you still have to configure your folders to map accordingly Gmail.

When you follow the steps at the Gmail Help Center, you end up with a folder list like the following:

Gmail Folders

The [Gmail] folder has sub folders containing the your actual primary set of folders of your Gmail account (Inbox, Starred, Sent Mail, Drafts, All Mail, Spam & Trash). All your labels are shown as folders outside of this. There is an easy method to map your primary folders correctly to Gmail’s, but doing so will deprive you of access to your labels (which show up as folders in Thunderbird).

So the cleanest way to map the folders is to do the following:

1. In Thunderbird select Tools->Account Settings and select the account that you are using for Gmail IMAP.

2. Select Copies & Folders under that.

3. Sent Mail: Choose ‘Other’ for the “When sending messages, automatically: ” and from the drop down select “AccountName”->[Gmail]->Sent Mail

4. Drafts: For drafts as well, choose “Other” and from the drop down select “AccountName”->[Gmail]->Drafts

5. Spam: Select “Junk Settings”, check the “Move junk messages to”, select “Other” and from the drop down select “AccountName”->[Gmail]->Spam

Copies and Folders

This fixes most of your folders. The only remaining one is “Trash” and fixing this folder is a bit cumbersome, but it is worth it. By default Deleting a message does not send it to your Gmails “Trash” folder, instead it sends it to Thunderbirds Trash folder. The way IMAP is set up is that Thunderbirds Trash folder is mapped to [IMAP]/Trash on Gmail. So here are your options

1. Let it remain as is and you will have an extra label called [IMAP]/Trash in Gmail, under which all your deleted mails will reside.

2. If you want your deleted mails to be removed from your inbox, but still exist (in your ‘All Mails’ section) then map your trash to ‘[Gmail]/All Mails’

3. If you want your deleted mails to be removed from your inbox, and actually be trashed then map your trash to ‘[Gmail]/Trash’

(1) requires no further action on your part, but (2) & (3) are essentially the same thing, only differing in folder names.

So here’s how you go about fixing your trash folder:

1. Close Thunderbird

2. Go to C:\Documents and Settings\<windows_username>\Application Data\Thunderbird\Profiles\<profile_name>, where <windows_username> is your windows logon and <profile_name> is the current Thunderbird profile you are using.

3. Open prefs.js in your favorite text editor and search for a line that says user_pref(”mail.server.server#.directory-rel”, “[ProfD]ImapMail/imap.gmail.com”);

Here server# refers to your server number. Basically we have to find out which server number is being used for our Gmail IMAP

4. Just below that line, add an additional line that says user_pref(”mail.server.server#.trash_folder_name”, “[Gmail]/Trash”);

5. Startup Thunderbird again and your Trash folder below the Inbox should no longer be there. Instead it will use [Gmail]/Trash. If it does show up, then restart Thunderbird a couple of times until the Trash folder below the Inbox goes away. I have no clue why this happens, but this is a quirk I’ve noticed.

Now anything you delete would go to the actual Trash. If you wanted it archived instead of trashing it, specify [Gmail]/All Mail as the trash_folder_name.

Thunderbird should now be configured to properly work with Gmail’s IMAP.

Fireshot Firefox Addon

Ever wanted to take screenshots of a web page in its entirety? Ever wanted to crop out a portion of it, highlight a portion of it, blur out specific details? There are times when I’d wished I have a tool to do that and now it exists. I’ve been using Screengrab! up until now, but after seeing Fireshot I don’t think I’ll be going back. Here’s a screenshot of it in action

Fireshot

It has a lot of features for grabbing the whole page, a part of it, annotating it, blurring it out, etc. Definitely worth being in your palette of Firefox Add-ons.

Download the Fireshot Addon.

Gmail IMAP and Windows Live Mail Beta (client)

Gmail has finally started giving users IMAP access and I think that its going to be very useful for a lot of users. Up until now I have been using Gmails POP service in conjunction with Foxmail. I loved Foxmail for the fact that you could create multiple accounts and have each of them password protected. This allows many users for a computer but at the same time keeps your data private (you could use different users on the system, but I also have multiple mail accounts, some of which I want password protected). I have not been able to find another application yet that provides the same password protection feature of Foxmail.

Unfortunately Foxmail does not support IMAP as of now, so I have decided to switch to either Thunderbird or Windows Live Mail Beta (henceforth referred to as WLMB). I managed to get WLMB up and running satisfactorily with Gmail IMAP. Here’s how I went about it.

Download WLMB here and install it.

Once done we can begin setting up our account for using IMAP.

Head to your Gmail account and on the Settings->Forwarding and POP/IMAP page (if you don’t see it, its probably because Google is still rolling it out to users, it will show up in a few days).

Enable IMAP

Once that’s done, fire up WMLB and Add an account.

Enter your e-mail address, password and select ‘Manually configure settings for email account’.

Put in the following settings (don’t forget to specify the login ID):

addsettings

Once done, WLMB will download your folders and display the list:

List of Folders in Windows Live Mail Beta

The problem is that the folders on your drive do not get automatically mapped to the right folders within Gmail, but rather get mapped to the subfolders within the Gmail folder.

To fix this right click on your account and choose properties->IMAP and specify the following settings:

IMAP Settings for Gmail

Once done, your final list of folders should look like this:

List of Folders in Windows Live Mail Beta after adjusting

Some points to note however are :

  1. Flagging an item in WMLB Star’s it in Gmail.
  2. Labels in Gmail show up as folders.
  3. To add a new Label, add a new folder.
  4. To apply multiple labels to a message you have to copy them into all the corresponding folders :(
  5. When you “delete” an item, it gets “archived” (I have looked high and dry for a solution to this however I have not found one. If anyone has a clue, do let me know)
  6. Messages moved to Trash get deleted.

Well there you have it. Gmail IMAP all set up and ready to go in your Windows Live Mail Beta.

Tag Autocompletion

When I started using Wordpress for blogging, I realized that my tags would soon build up if there was no way of viewing the tags I’d already used while specifying tags for a post. A little hunting around brought me to a plugin - Simple Tags, which I got from here. Very useful, must add plugin is what I would say.

Update: This plugin is much more useful… I just looked at the options for it.

Order By clause not so useful

If you have ever come across this error in SQL

The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP or FOR XML is also specified.

then all SQL is trying to tell you is that you cannot use your ORDER BY clause within a subquery.

So if you have something like this, it sure as hell won’t work:


SELECT x, y, z

UNION

SELECT * FROM(
SELECT DISTINCT x, y, z
FROM (

SELECT x, y, z
FROM a
WHERE

UNION
SELECT x, y, z
FROM b
WHERE
)

ORDER BY z
)

Work arounds? A little hunting around showed that you could “use” a ORDER BY in a subquery if you used the TOP X PERCENT in your SELECT statement which would go something like this:


SELECT x, y, z

UNION

SELECT * FROM(
SELECT TOP 100 PERCENT x, y, z
FROM (

SELECT x, y, z
FROM a
WHERE

UNION
SELECT x, y, z
FROM b
WHERE
)

ORDER BY z
)

Why I stressed on “use” there is because although you can use it, it doesn’t make life any easier. Basically it allows the usage of ORDER BY, but it never does ORDER BY anything. You get back an unordered result set.

The workaround I used was adding an extra column that had blank data for the row I wanted sorted on the top and the actual data I wanted sorted by for the rest of the rows; then sorted it based on this extra column. Crude, but it works.

I thought this would be an easy thing to do, but it doesn’t seem so.

MacBook…

I’ve been thinking about purchasing a MacBook as my next laptop, but a few things concern me. Even though I’ve read a whole lot about the interoperability with Windows, its the other things that I’m more worried about. The fact that the touchpad does not support taps in order to click is on the topmost of the list. Also that there is only one button on the touchpad… This basically means that there is absolutely no way that you can use the Mac with only one hand if you had to. Well all things apart, the functionality that it provides looks pretty amazing and convincing.

My other deciding factor is the pricing. The MacBook is fine, but it seems like a steep price for a 13″ screen. Also it will almost be like downgrading from my current 14″ screen.

My other question… Do I really need a new laptop?

Web 2.0 in a flash…

This is one really well done video, I loved it…

Here’s the link to the original content - Mediatedcultures

No ’switch’ in Python

After a first afternoon with Python, I noticed it misses the ’switch’ statement which I always thought was very useful. I’m not sure why it has been removed, however I’m sure there is some workaround for it. Hopefully I will go the whole mile this time and not ditch the language in between. I’ve always been wondering whether to Ruby or to Python and after reading many a blogs/articles on which one to start out with I’ve settled on Python.

GPS is in the algorithm

I recently had the opportunity to use two different GPS systems, one by Mio and the other by Magellan. Apart from the fact that the interfaces varied greatly I was wondering how the underlying technology worked. Reading lots of reviews and stumbling upon a site catered to GPS systems ( GPS Magazine ) I finally found that Mio, Magellan, Garmin, Google, Yahoo!, Microsoft and probably every other person who makes use of maps in their products uses data provided by either Navteq or TeleNav. After all the reviews (that have been extremely well done by the site) it boils down to the fact that it is the algorithm that makes the difference in providing the routes.

How intelligence is built into the system is a whole different issue, but just providing the shortest routes from the point of departure to the point of destination itself seems like a major task. I was just wondering how primitive the traveling salesman/shortest path algorithms might be in comparison to what these guys might have built to provide the routing.

However, none of the systems seem to have enough intelligence to know how to take shortcuts. Probably its there on the higher end systems, but then I haven’t tested/tried any of them. Sometime in the future I see myself sitting in a car, punching in my destination and not even having to lift another finger. I will be there. (Considering Lexus already has the autopark feature done)

Take your LJ and run with it…

I was always skeptical of shifting to another blogging platform because I thought that all of my earlier posts would be lost. I did recently shift however and thanks to the requirement of a friend, learnt that I can now safely backup my posts as well as comments and move.

We’ve both had our blogs on LJ and she recently shifted over as well. So she asked me if I knew any way to transfer the posts as well as comments. A little Googling and I found this tool called LJArchive. It allows you to take a complete backup of your data on LJ and export it to a XML file that Wordpress can then import.

Amazingly (and I’m not sure since when), Wordpress can consume quite a few formats. Plus I can also now take a backup of my existing wordpress blog, which is a feature I’ve always looked for in blogging platforms. I believe the same should hold good for any web application out on the Internet. You should be able to take your data and run with it. If not, its not “your” data per se.