Set Gmail as Default Mail Client in Ubuntu

Posted on June 23rd, 2008 by dandavis
Tags: , ,

A year ago at the How-To Geek: Set Gmail as Default Mail Client in Ubuntu.

I just started using Ubuntu in the past few days and found this post useful. But, because I'm me, I had to make a minor change.

My version is based upon a version in the comments of the original post with additions to support Google Apps for Your Domain.

#!/bin/bash

[[ $2 == "" ]] && domain="mail" || domain="a/$2/"
uri=`echo "$1" | sed -e 's/subject=/su=/' -e 's/^mailto:\([^&?]\+\)[?&]\?\(.*\)$/\1\&\2/'`
firefox "https://mail.google.com/${domain}?view=cm&tf=0&to=$uri"
Download open_mailto.sh.

To use it, reference the original post with one small change. If you need to specify a Google Apps domain, add it after the '%s':

/home/username/open_mailto.sh %s dandavis.com

Hope it helps.

Post a comment

You must be logged in to post a comment.