I have a vanilla install of Ubuntu Hardy Heron. In Firefox, when I click someone’s email that uses the mailto link, it opens up the Evolution email client. This is the suck if you don’t use a desktop email client which more and more smart people are doing these days.
I use an email with my own domain, hosted on Google Apps for all my email needs. With a little inspiration from this page, I got Google Apps to be the default email client instead. Here’s how…
- Fire up your favorite text editor
- Copy and paste the following code:
#!/bin/sh
firefox "https://mail.google.com/a/yourdomain.org/mail?view=cm&tf=0&to=`echo $1 | sed 's/mailto://'`"
Replace “yourdomain.org” with your hosted Google Apps domain
- Save the file with the “.sh” extension (example: “google_apps_mailto.sh”)
- Use a terminal to make the file executable with the following command:
$ chmod u+x path_to_file
The path_to_file is the location of the script. (example: “~/google_apps_mailto.sh”)
- In Firefox, go to Edit > Preferences > Applications > mailto > Use other…
- Browse to and select the file you just created earlier
Woohoo! Now when you click a mailto link, it should compose a new email in the browser using Google Apps. Test it out by emailing me if it worked info@ozz314.org.
Update:
Thanks to this comment, there’s a more elegant way to do this.
- In Firefox’s address bar, copy and paste the following and hit enter:
about:config - Click “I’ll be careful, I promise!” when the warning appears
- In the “Filter:” field, copy and paste:
gecko.handlerService.allowRegisterFromDifferentHost - Double click the found result to change the boolean value from false to true
- In the address bar, copy and paste the following:
javascript:window.navigator.registerProtocolHandler("mailto","http://mail.google.com/a/yourdomain.org/mail/?extsrc=mailto&url=%s","Google Apps") - Replace “yourdomain.org” with your own Google Apps hosted domain and hit enter
- Click “Add Application” when it asks you a question
- go to Edit > Preferences > Applications > mailto
- Choose “Use Google Apps”
That’s it! Test it out by clicking my email, info@ozz314.org.
I wish Firefox had it as a default option instead of the craptastic Yahoo! Mail.

