Friday, November 13, 2009

Email notification in Ubuntu

Previous versions of Ubuntu came with Pidgin as the Instant Messenger program. It also notified of emails arriving to account mailboxes- Hotmail, Yahoo, Google etc. The new IM program in Ubuntu Karmic is Empathy. It has video chat (the developers of Pidgin didn't consider it important) but not email notification (the developers of empathy don't consider it important).
So I thought I'd try Empathy but look for an email notification program. There seem to be a number that work with GMail, but I wanted something that would work with my old Hotmail and Yahoo! accounts as well.
I settled on Mail-Notification, but not without a number of days spent getting the program to work correctly. These were the problems and issues I encountered:
  1. Mail-Notification has options for Hotmail and Yahoo! accounts but they don't work "out of the box".
  2. Hotmail and Yahoo! can be accessed using SSL, but SSL doesn't work "out of the box" with Mail-Notification.
  3. Mail-Notification's GMail alerts don't integrate with Ubuntu's notification system "out of the box".
  4. Mail-Notification doesn't provide an option to go to webmail pages for accounts other than GMail "out of the box".
Here are the solutions I found. I'll start with 2. because that's what I tried first.

Mail-Notification comes without SSL support.

SSL support is disabled in Mail-Notification due to licensing issues. SSL is required to access Hotmail or Yahoo! accounts via POP3. A version of Mail-Notification with SSL can be downloaded here or compiled as described here. (Beware: Ubuntu will offer the version with SSL disabled as an update. Decline the update to keep using SSL.)

The disadvantage of using POP3 to access Hotmail and Yahoo! is that POP3 does not provide a method of reporting which emails are new, so all mail on the server will be reported as new, even if that's a couple of hundred of ancient emails on Hotmail.

I wanted to be informed of new emails, not all emails in my Hotmail or Yahoo! accounts, no matter how old, so I looked for a solution to 1.

Mail-Notification Hotmail and Yahoo! account options don't work

Mail-Notification actually requires the installation of a couple of scripts which it uses to access Hotmail and Yahoo! accounts: GetLive and FetchYahoo! These can be installed via Synaptic, but the installed versions are out of date and don't work. Here's how to sort out the problems:

GetLive:

Install GetLive from Synaptic or command line.
Download the latest version of the script here.
Open Nautilus with root privileges (gksu nautilus in a terminal) and navigate to usr/bin.
Drop the latest version of the script in usr/bin, but make sure it is named "GetLive" not "getlive".
Right click on the script and select Open with Other Application>gedit.
Replace $Mode = "200810" with $Mode = "200909"
Credit for solution here and here.
(The problem with Mail-Notification looking for "GetLive" and not "getlive" is due to be fixed in a later release- after which it may be necessary to name the script "getlive"; Microsoft may alter the Live Mail access protocol again in the future, so check the link for updates if this fix fails.)

FetchYahoo!

Install via Synaptic or command line.
Download the latest version, unpack and replace the fetchyahoo! script in usr/bin again using Nautilus with root privileges.

(A minor irritation with FetchYahoo! is that it marks emails on the server as read, before you have actually opened the webmail page and read them- so after a while Yahoo! emails disappear from Mail-Notification. GetLive displays mail headers but leaves emails marked as unread.)

Mail-Notification's GMail notifications don't integrate with Ubuntu's notifications

Open gconf-editor in a terminal and navigate to /apps/mail-notification/popups/actions.
Edit the key and delete all the actions.
GMail notifications will then appear as the now-standard Ubuntu notification, although without an "Open" option. (This option is still available in the Mail-Notification menu, or by clicking the icon if you have the "Open last email" option selected.)
Credit here.

Mail-Notification doesn't provide "Open Message" options for Hotmail and Yahoo!

Go to Properties>Status Icon and select "Open the latest message".
Open a new file and paste in the following (Substitute the name of your default browser for Firefox if applicable):
#!/bin/sh
firefox http://[Your Hotmail webmail address]
Name your script "open_hotmail.sh", save it in "~/bin" ((home/bin) and make it executable (right-click>Properties>Permissions).
Add this to the Hotmail mailbox attributes in mailboxes.xml:
open-command="~/bin/open_hotmail.sh %filename"
Repeat for other accounts substituting the account name for Hotmail.
Clicking on the Mail-Notification icon will now open the last mail, whichever account it's from.
(See section 5.1.2 of the Mail-Notification help file.)
Credit here for help to get this working.)

A final minor problem with Mail-Notification is that the icon only appears in the panel when there is new mail. To alter properties or add accounts, open gconf-editor in a terminal, navigate to /apps/mail-notification and check "always-display-icon".

[UPDATE] Mail Notification appears in the System>Preferences menu and can be configured from there. Apologies for the misleading information.

[UPDATE 2] There's a new email notification program available. OMGUbuntu has the details.

[UPDATE 3]Ubuntu users can install Mail-Notification with SSL enabled from a repository here.

2 comments:

  1. Did you ever find a way to open the accounts options for mail-notification? I have Karmic and even with it in the panel, I cant access the options after I did during the first time I ever opened it.

    ReplyDelete
  2. Yes- Mail Notification appears in the System>Preferences menu.

    Thanks for the comment- I've updated the post.

    ReplyDelete