12 December, 2007

Google Apps e-mail with Google Toolbar

So I've more or less switched to using only Google Apps' Webmail (Gmail with your own domain), making Thunderbird obsolete. To that end I've been trying to find a way to make mailto links launch my Google Apps composer window rather than the default Gmail composer window, and also how to make Gmail start by default in https (secure) mode rather than http (plain) mode.

In my search I've stumbled upon several resources, most pointing to using GreaseMonkey and a small script that re-writes all mailto links, another resource pointing to Gmail Manager saying it could handle Google Hosted Accounts (aka. Google Apps accounts), as well as some sites that explains how you fix the Gmail button for Google Toolbar to launch Gmail as https by default.

Of the resources pointed out in regards to the mailto handling, I found several GreaseMonkey scripts that did this job very well, although I didn't really relish the idea of having that addon installed merely because I needed 1 script to handle mailto links, so I decided to try Gmail Manager instead

Gmail Manager was very easy to set up to handle Google Apps accounts in regards to checking e-mails, opening inbox and a few other minor things. All I had to do was type in my e-mail address and my password. Gmail Manager also handles mailto links, at least it opens my inbox when clicking a mailto link, but that isn't enough for me, I want it to open the actual compose window. I decided it probably just was some hidden configuration option so I decided to muck around a bit in about:config, and behold: There I found "google.toolbar.mailto.providers.Gmail", which contained the URL that Google Toolbar uses to open the composer window, when clicking mailto links.

So basically, all I had to do from the start was this:

Edit the Gmail button to open the Google Apps account instead of the Gmail account, and in https rather than http

  1. Go into Google Toolbar Options, under the Buttons tab

  2. Mark the Gmail button and click "Edit..."

  3. In the dialog that opens up click the "Use the advanced editor..." link

  4. There are 3 places that needs to be fixed:
    Change:
    http://mail.google.com/mail/?search=query&view=tl&start=0&init=1&fs=1&q={query}&source=navclient

    To:
    https://mail.google.com/a/MYDOMAIN.TLD?search=query&view=tl&start=0&init=1&fs=1&q={query}&source=navclient

    Change:
    http://mail.google.com/?source=navclient

    To:
    https://mail.google.com/a/MYDOMAIN.TLD?source=navclient

    Change:
    http://mail.google.com/mail?atom_browser_auth&source=navclient

    To:
    https://mail.google.com/a/MYDOMAIN.TLD?atom_browser_auth&source=navclient

    (Note: Replace MYDOMAIN.TLD with your own domain)

  5. Click "Save to Google Toolbar..."

  6. When/if asked to replace the Gmail button just click "Replace".

Thanks to Stefano Savanelli for his comment referring to this following link where you can add a Google Apps e-mail button:
http://code.google.com/p/gtb-gmail-apps-button/


Now the Gmail button is fixed, now to make Google Toolbar send e-mail using the Google Apps account:

  1. Enable "Send with Gmail" in the Google Toolbar Options, under the More tab.

  2. Open about:config and locate "google.toolbar.mailto.providers.Gmail" (filtering by "gmail" makes it easier to find).

  3. Change the value
    From: firetool-mail:http://mail.google.com/mail/?view=cm&fs=1@to=to&subject=su&body=body&cc=cc&bcc=bcc&name=Gmail
    To: firetool-mail:https://mail.google.com/a/MYDOMAIN.TLD?view=cm&fs=1&tf=1@to=to&subject=su&body=body&cc=cc&bcc=bcc&name=Gmail
    (Note: Replace MYDOMAIN.TLD with your own domain)

By adding the "&tf=1" variable to the URL the composer window will open "full screen", without the folder list to the left and the search bar at the top.

There.. Now we have made Google Toolbar handle all aspects of our Google Apps account :)