Tuesday, December 4th, 2007

Gmail as Default Email Client in Ubuntu

January 7th '08 - Problems/Issues
There are some issues with this script that could potentially lead to a temporary loss of access to your Gmail account. Please see the user comments for more details.


The How-To Geek has posted some really useful instructions for setting Gmail as the default email client in Ubuntu. How-To Geek starts his post by saying:

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.

I think his opening statement is a slight generalisation :) Having said that, I am indeed a geek and I do use Gmail so he may have a point! Anyhow, I followed the instructions and the hack works well. I did deviated slightly and placed the shell script in my bin directory; this way the script can be called by name as it sits within my system path. For future reference the script I used has the following content:

#!/bin/sh

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

Note: The Firefox command actually sits on one line.

Once I'd placed the script in my bin directory, I then simply needed to change my preferred mail application:
System -> Preferences -> Preferred Applications

Setting default mail client in Ubuntu.

When email is slower than snail mail

Talking of Gmail and email, I've been experiencing some technical issues with email across several domains. Apparently these issues stem from Gmail greylisting one of my hosting providers mail clusters. You can't imagine, unless you've experienced it, how frustrating it is to receive email more than 48 hours after it was originally sent.

I apologise if anyone is waiting on a reply from any messages sent between 30/11/07 and 03/12/07. Your message will probably never arrive at its intended destination; I can only imagine that your message is floating aimlessly around cyberspace, either that or it's been sucked into a black hole :(

Looking on the bright side, I also use another more reliable [read more expensive] hosting provider and I've moved my email operations to their servers. I've also been looking into using Google Apps for all my email needs; however, I'm slightly apprehensive about paying out on a service that has been in Beta status for more than 3 years. Does anyone have any experience of using this service? If so I'd really appreciate some sensible feedback about it.

Tagged with: google, hosting, ubuntu


12 Responses to “Gmail as Default Email Client in Ubuntu”

  1. Carl van Tonder wrote,

    Why do people these days think that Ubuntu and the 'desktop linux' push mean that you can ride rough-shod over the UNIX app principles? A web browser is a web browser. If you want to fetch your mail, try "fetchmail". To process your mail, try "procmail". It's right there in the name..

    And then, you can access it with mutt, evolution, kmail, thunderbird, your web browser (with squirrelmail) or really anything else. Why not incorporate Gmail into the linux task-flow instead of forcing the OS to redesign itself around crass new metaphors (such as browser-based apps)?

  2. Philip wrote,

    @Carl: In answer to your question:

    Why do people these days think that Ubuntu and the 'desktop linux' push mean that you can ride rough-shod over the UNIX app principles?

    Three words, "ease of use".

  3. Derek Buranen wrote,

    I have used the free Google Apps and with their new IMAP, I'm diggin it. A 5 gig IMAP box with a kick ass web client. You can't go wrong. I won't attest for any other apps as the Mail is all I use. Point your MX records today!

  4. Menachem wrote,

    Just to add, You might have to make your script executable. to do that run:

    chmod +x /bin/gmail

  5. Philip wrote,

    @Derek: I may just do that :) I'm actually considering paying for the premium service, but I'll probably try the free service first.

    @Menachem: Thanks, I forgot to mention that part.

  6. StrangeQuark wrote,

    Is it also possible to correctly process links in the form of "mailto:name@domain.com?subject=Hello"?

  7. Philip wrote,

    @StrangeQuark: I've just tested a mailto link with subject and it doesn't work. Thanks for raising this, I'll look into it.

  8. sheepeatingtaz wrote,

    Also might be worth noting:

    I just set this up and tried to to 'Send Link…' from Firefox. My account is now locked for up to 24 hours due to 'Unusual Activity'!

  9. Philip wrote,

    @sheepeatingtaz: Hmm, that's not good :O Hope you get it sorted soon. I'd try to reproduce the error to confirm but I can't afford to lose my email access. I'll add a note to the top of the post to warn any readers against this hack. Thanks for letting us know :)

  10. sheepeatingtaz wrote,

    Philip, to be fair, it is back now (about an hour down?). But like you say, not good :) I think I'll just send the link manually… ;)

  11. anhelido wrote,

    I found a trick for the subject parameter. Look at this web: http://matthew.ruschmann.net/blog/Linux/gnome-gmail-1.1.html

  12. DaveC wrote,

    Like StrangeQuark, I found the itch for a one-liner that would support extended syntax and in particular "Send Link" ….

    http://dcc.vu/ubuntu-linux-file-send-link-with-gmail.html

Add Your Comment

Use the form below to add your comment. Markdown syntax is available. Note, comments are moderated by me for spam filtering. Alternatively, feel free to contact me privately.