ernz
January 12th, 2009, 08:11 AM
Hi everyone! Another how-to describing the steps I undertook to resolve a small feature enhancement I have been looking at for a while. The steps below should integrate the Gmail e-mail web application fairly seamlessly into your Ubuntu Desktop. Note that the instructions below were put together for Ubuntu 8.10 - Intrepid Ibex and I was using Firefox 3.0 Version 3.0.5.
Step 1: Handling Mailto's
Mailto links within browsers are handled bu Evolution by default. We can set up Firefox to respond to a mailto click by opening a compose windows directly in Gmail.
1) Open up your Gmail (http://www.gmail.com) in Firefox and log in.
2) Copy and paste the following link into the address bar:
javascript:window.navigator.registerProtocolHandle r("mailto","https://mail.google.com/mail/?extsrc=mailto&url=%s","GMail")
3) You'll see prompt at the top of the page to add the application. Accept.
http://img240.imageshack.us/img240/7216/mailtohandlerow4.png
4) In Firefox > Edit > Preferences > Applications > Search for "Mailto" Content Type > Make the action "Use GMail". Done
I also recommend installing the AdBlock Plus and Better Gmail 2 Firefox Addons for a better Gmail experience. They can be found...
http://adblockplus.org/en/
and
https://addons.mozilla.org/en-US/firefox/addon/6076
...respectively.
Step 2: Preferred Application - GMail!
Because GMail is not a client-side web application, we need to put in place a couple of workarounds to point Ubuntu towards GMail WITHIN Firefox rather instead of just a Gmail application like Mozilla Prism (http://blog.wired.com/monkeybites/2007/10/mozilla-prism-r.html). I prefer this method because it feels less intrusive, and means that your E-mail and web browsing are still in a single Firefox session which, to me, feels more natural. While both are good solutions, this is by far the more "seamless".
1) Open a terminal session. (Applications > Accessories > Terminal)
2) Enter
mkdir ~/.scripts
3) Now enter
gedit ~/.scripts/open_mailto.sh
4) In this new text file paste the following
#!/bin/sh
firefox "https://mail.google.com/mail?view=cm&tf=0&ui=1&to="`echo $1|sed -e 's/?subject=/\&su=/' -e 's/mailto://'`
... and close gedit and return to the terminal.
5) Set the script as executable with the following terminal line
chmod +x ~/.scripts/open_mailto.sh
... and Close the terminal.
6) Open System > Preferences > Preferred Applications > Internet > Mail Reader
7) Use a 'Custom' application, and in the box below enter
sh /home/YOURUSERNAME/.scripts/open_mailto.sh %s
...obviously replacing YOURUSERNAME with your actual user login name.
http://img397.imageshack.us/img397/7271/preferredgq1.png
Your default e-mail application according to Ubuntu, is a Gmail compose window which will create a new e-mail with auto-populated 'To:' field for any client-side E-mail links.
Step 3: Address Book
There are quite a few Gnome tools such as the contacts applet on the panel which depend on the Evolution contacts list to look up people and send contacts. With an application called 'Contacts' you are able to manually amass your Evolution contacts without using Evolution as a Mail client.
1) System > Administration > Synaptic Package Manager > Settings > Repositories > Third-Party Software > Add button (Bottom left) and add this:
deb http://debian.o-hand.com hardy/
2) Reload
3) Search for "contacts" and install - It will have an entry in the Office submenu.
Step 4: Contacts Lookup
Now that we have have system and browser mailto handlers, and somewhere to store the contacts, you can now add the applet to quickly lookup the contacts from your address book.
Right Click a Panel > Add to Panel > Double-Click "Address Book Search".
http://img80.imageshack.us/img80/3259/contactsaf6.png
You can now quickly find contacts, click on them and send mails to them within Gmail compose.
Step 5: Notifier
The last step is to install checkgmail to notify you when a new e-mail lands in the Inbox. The same application can be used to quickly compose a new mail (right click the tray icon).
1) To install, go back to the terminal and type
sudo apt-get install checkgmail
2) Press ALT+F2 and type
checkgmail
...to start the application.
3) Right click the new Gmail icon and configure to use your own login details.
4) Add to Ubuntu start up. Systems > Preferences > Sessions > Add. Use whatever name you like, but the command must be "checkgmail" (without the quotes).
That's everything! You should now have effortless Gmail access and good integration on Ubuntu 8.10.
Thanks to the authors of the original articles where I sourced the methods used above:
http://www.howtogeek.com/howto/ubuntu/set-gmail-as-default-mail-client-in-ubuntu/
http://lifehacker.com/392287/set-firefox-3-to-launch-gmail-for-mailto-links
http://www.pimlico-project.org/contacts.html
Big thanks also to simplenewb for repo help and to Hikeractive for his input on mailto support.
Step 1: Handling Mailto's
Mailto links within browsers are handled bu Evolution by default. We can set up Firefox to respond to a mailto click by opening a compose windows directly in Gmail.
1) Open up your Gmail (http://www.gmail.com) in Firefox and log in.
2) Copy and paste the following link into the address bar:
javascript:window.navigator.registerProtocolHandle r("mailto","https://mail.google.com/mail/?extsrc=mailto&url=%s","GMail")
3) You'll see prompt at the top of the page to add the application. Accept.
http://img240.imageshack.us/img240/7216/mailtohandlerow4.png
4) In Firefox > Edit > Preferences > Applications > Search for "Mailto" Content Type > Make the action "Use GMail". Done
I also recommend installing the AdBlock Plus and Better Gmail 2 Firefox Addons for a better Gmail experience. They can be found...
http://adblockplus.org/en/
and
https://addons.mozilla.org/en-US/firefox/addon/6076
...respectively.
Step 2: Preferred Application - GMail!
Because GMail is not a client-side web application, we need to put in place a couple of workarounds to point Ubuntu towards GMail WITHIN Firefox rather instead of just a Gmail application like Mozilla Prism (http://blog.wired.com/monkeybites/2007/10/mozilla-prism-r.html). I prefer this method because it feels less intrusive, and means that your E-mail and web browsing are still in a single Firefox session which, to me, feels more natural. While both are good solutions, this is by far the more "seamless".
1) Open a terminal session. (Applications > Accessories > Terminal)
2) Enter
mkdir ~/.scripts
3) Now enter
gedit ~/.scripts/open_mailto.sh
4) In this new text file paste the following
#!/bin/sh
firefox "https://mail.google.com/mail?view=cm&tf=0&ui=1&to="`echo $1|sed -e 's/?subject=/\&su=/' -e 's/mailto://'`
... and close gedit and return to the terminal.
5) Set the script as executable with the following terminal line
chmod +x ~/.scripts/open_mailto.sh
... and Close the terminal.
6) Open System > Preferences > Preferred Applications > Internet > Mail Reader
7) Use a 'Custom' application, and in the box below enter
sh /home/YOURUSERNAME/.scripts/open_mailto.sh %s
...obviously replacing YOURUSERNAME with your actual user login name.
http://img397.imageshack.us/img397/7271/preferredgq1.png
Your default e-mail application according to Ubuntu, is a Gmail compose window which will create a new e-mail with auto-populated 'To:' field for any client-side E-mail links.
Step 3: Address Book
There are quite a few Gnome tools such as the contacts applet on the panel which depend on the Evolution contacts list to look up people and send contacts. With an application called 'Contacts' you are able to manually amass your Evolution contacts without using Evolution as a Mail client.
1) System > Administration > Synaptic Package Manager > Settings > Repositories > Third-Party Software > Add button (Bottom left) and add this:
deb http://debian.o-hand.com hardy/
2) Reload
3) Search for "contacts" and install - It will have an entry in the Office submenu.
Step 4: Contacts Lookup
Now that we have have system and browser mailto handlers, and somewhere to store the contacts, you can now add the applet to quickly lookup the contacts from your address book.
Right Click a Panel > Add to Panel > Double-Click "Address Book Search".
http://img80.imageshack.us/img80/3259/contactsaf6.png
You can now quickly find contacts, click on them and send mails to them within Gmail compose.
Step 5: Notifier
The last step is to install checkgmail to notify you when a new e-mail lands in the Inbox. The same application can be used to quickly compose a new mail (right click the tray icon).
1) To install, go back to the terminal and type
sudo apt-get install checkgmail
2) Press ALT+F2 and type
checkgmail
...to start the application.
3) Right click the new Gmail icon and configure to use your own login details.
4) Add to Ubuntu start up. Systems > Preferences > Sessions > Add. Use whatever name you like, but the command must be "checkgmail" (without the quotes).
That's everything! You should now have effortless Gmail access and good integration on Ubuntu 8.10.
Thanks to the authors of the original articles where I sourced the methods used above:
http://www.howtogeek.com/howto/ubuntu/set-gmail-as-default-mail-client-in-ubuntu/
http://lifehacker.com/392287/set-firefox-3-to-launch-gmail-for-mailto-links
http://www.pimlico-project.org/contacts.html
Big thanks also to simplenewb for repo help and to Hikeractive for his input on mailto support.