Random Bits and Bytes

helpful tech and software tips

Set Gmail as Default Mail Client in Ubuntu

Posted by Jason on September 16, 2008

Every Geek uses Gmail… it’s pretty much required. And now you can set Gmail as the default client in Ubuntu without any extra software. (Windows requires the Gmail notifier be installed)

Just go to System \ Preferences \ Preferred Applications

Ubunut 8.04

Ubunut 8.04

Under Mail Reader, select Custom, and then put this into the Command window, changing “geek” to your username.

/home/geek/open_mailto.sh %s

Next, you’ll need to save this shell script into your user directory ( /home/username ).

Download

For the curious, here’s the contents of the script:

#!/bin/sh

firefox https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed ‘s/mailto://’`

If you’d like to make the script open a new tab in an existing Firefox window, you can replace the firefox line in the script with the following:

firefox -remote “openurl(https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed ‘s/mailto://’`,new-tab)”

If you want to make the script file hidden by default, you can rename it with a . at the beginning of the file like this: .open_mailto.sh. You’ll have to change the path in the preferences, of course.

Open a terminal and type in the following command, to make the script executable:

chmod u+x ~/open_mailto.sh

Note that if you aren’t logged into Gmail you’ll be prompted to login to gmail… and you’ll have to click the email link again. Seems like Gmail’s login redirector won’t open the send mail page. But then again… why aren’t you logged into Gmail?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: