Using Gmail for mailto: links
Thursday October 18, 2007
Blame it on Seb, but I’ve been using Gmail’s web interface lately. This is partly because I’m in the middle of another life-changing job transition (but this one I’m really excited about, aside from the great white sharks and the triangle of death), partly because I like change (and after having used nothing but kmail for a few years now, I’m ready for a change if for nothing other than to see how we in KDE PIM land can do things better), and partly because I’m trying to keep less personal data on my work laptop. I have been using Google’s Apps For Your Domain for the last year or so, and I like it much good. However, one thing that Gmail lacks is any IMAP interface whatsoever, which means that I’ve had a really convoluted setup going on which uses GAFYD for my MX handling, and then involves a subdomain on my regular web host server which I forward all e-mail to and subsequently access via IMAP. Ick.
(Google people: PLEASE, PLEASE, PLEASE add an IMAP interface to Gmail!!! The workarounds suck!)
Anyway, I digress…
The second thing that irks me about Gmail’s web interface is that it has no API for syncing contact information whatsoever. This absolutely sucks, but I expect that with Google trying to position itself as an online “all your information are belong to us” provider, that they’ll either remedy the ridiculously bad contact handling themselves or replace it with an acquisition. Please? And let me sync it with my Palm PDA??
But back to the point, one thing that is lacking in using Gmail’s web interface is the ability to click on a “mailto” link (or right-click in Firefox and do “send link”). Apparently, there are Google-provided solutions to this on OS X and Windows (Google people: please treat the Linux desktop as a first-class citizen too??) but they’ve not done anything for this functionality on Linux. However, I came across this nice little HOWTO from the Gentoo folks, which does the trick quite nicely. I’ve modified the shell script slightly to try to stop Gmail from going into some kind of a loop and not actually working if there’s no recipient passed to it (like what happens when you RMB click in Firefox and do “send link”), but I’m not sure if it’s something goofy with GAFYD…:
#!/bin/sh
BROWSER=”firefox”ME=$(basename $0)
DEBUG=/tmp/$ME.debugecho “$(date)| incoming uri: [$1]” >> ${DEBUG}
# remove the ? and mailto from the uri and convert “subject” to “su”
uri=$(echo “$1” | sed -e ‘s,subject=,su=,’ \
-e ‘s,\?,\&,g’ \
-e ‘s,^mailto:,,’)echo “$(date)| outgoing uri: [$uri]” >> ${DEBUG}
if [ “$uri” ];
then exec $BROWSER “https://mail.google.com/mail?view=cm&tf=0&to=$uri”
fiexec $BROWSER “https://mail.google.com/”
[[ UPDATE ]] A zillion thanks to Giuseppe D’Angelo, who pointed me to the Better Gmail firefox extension. This rocks a LOT! =:) So the above shell script still has relevance for KDE/GNOME url handling, but isn’t as necessary for firefox mailto’s… =:)
Why would you do this when you can use KMail to send mail via SMTP on GAFYD?
Hey Jason,
Actually, if you install the Google toolbar on firefox, it will make the mailto links go to Gmail. I installed the toolbar and then chose the option where it replaces the firefox search bar (cause I didn’t care for all of the buttons), just so I could get my links to go to Gmail.
Good luck,
Gustavo
Heya Samir,
Um. I’m not using KMail with my GAFYD mail currently because of the reasons I listed (no IMAP interface, trying not to keep personal data on work laptop, etc., etc.). And yes, when I was using my IMAP server which was populated via auto-forwarding everything from GAFYD, I did use GAFYD as my SMTP host. =:)
Hi Gustavo,
Does this work for the google firefox toolbar on Linux? Thanks!! =:)
IIRC there’s an extension, “Better GMail”, providing what you’re looking for.
Giuseppe,
You ROCK!! This is perfect!! =:) Thanks very much for pointing me there!! =:)
You’re welcome :))
[…] also, during my little transition period here as I blogged about earlier, I’ve been using the Gmail interface to my little domain’s e-mail, and seriously like […]
I’m sure you’ve seen it by now, but Google just released IMAP support for Gmail.
Link
Tim: Holy CRAP!! This is awesome!!! =:) And no, I’ve been without a laptop for so long that I did not know this. Thanks for the comment!!! =:)