Wednesday, February 4, 2009

Mail-Notification with SSL/TSL support

The idea with Mail Notification is to run a small application that alerts you about new emails. This is a very desirable thing because almost all email applications (such as thunderbird) are heavy in the use of computer resources. Moreover, the ones that have an email notification built in (evolution for instance) may just not be counted among your preferred ones. Mail Notification avoids having to keep your email application always open in order to get alerted of the arrival of new emails.

One problem with Mail Notification is its lack of support for secure protocols, such as SSL/TSL (it appears to be a problem with the license, see this forum for more on this). However, it is not difficult to enable SSL/TSL support, though you'll have to compile Mail Notification from source. The following procedure illustrates how to get MAil Notification with SSL/TSL support enabled in Ubuntu Intrepid (I modified/adapted the steps that follow from this nice post).

0. If you want to save some time, get sudo access by typing sudo su followed by your passwd. If you do this, you won't have to write sudo everytime you want to run apt-get. In what follows, I assume you've done this so I'll save the sudo in front of every command line I type below.

1. Move to the /tmp directory.

2. Get the source packages for mail-notification package. In a terminal, run:

apt-get source mail-notification

This will give you a subdirectory (and other packages) with the sources to build mail-notification (in my case I got the directory /tmp/mail-notification-5.4.dfsg.1).

3. Now you need to get all the development packages needed to compile the mail-notification package by running:

apt-get build-dep mail-notification

This command line can be used whenever you want to build something from source and are unsure about the 'development packages' that particular application needs. It will download a lot of stuff but later you can delete the unnecessary things by running sudo atp-get autoremove.

4. Get the development package necessary to compile mail-notification with SSL support:

apt-get install libssl-dev

5. Move to the mail-notification-5.4.dfsg.1 directory (cd mail-notification-5.4.dfsg.1 will do the trick since you already are at /tmp). Within the mail-notification-5.4.dfsg.1 directory, go to debian (so you end up at /tmp/mail-notification-5.4.dfsg.1/debian) and type

gedit rules

You should get a file with lots of stuff. Look for the following section:

configure: configure-stamp
configure-stamp:
dh_testdir
./jb configure ssl=no sysconfdir=/etc destdir=$(DEBIAN_DIR)/tmp/
touch $@

Change the line that ./jb configure ssl=no to ./jb configure ssl=yes. Save and close this file.

6. Modify the changelog file to let eveyone who uses your compiled package know what this change is about. Do this by editing the changelog file (gedit changelog). I wrote something like this at the beginning of the file:

mail-notification (5.4.dfsg.1-1build1a) intrepid; urgency=low

* Enable SSl/TSL support.

-- Cristian Troncoso-Valverde Wed, 04 Feb 2009 11:43:18 +1100


7. Finally, come back to the /tmp/mail-notification-5.4.dfsg.1 directory and issue the following command::

dpkg-buildpackage -uc -b

(type dpkg-buildpackage --help to see what the role of -uc and -b is).

8. Type cd .. to get back to the /tmp directory. Now type ls. You should see a file with .deb extension (something like mail-notification-evolution_5.4.dfsg.1-1build1a_amd64.deb). This is your mail-notification package ready to be installed in your system. To install it you can open nautilus and click directly on this file or you can issue the following command:

dpkg -i mail-notification_3.0.dfsg.1-3ubuntu8a_i386.deb


9. Once installed, go to System -> Preferences and click on Mail Notification. When you add a new account, you should see that SSL/TSL support is now enable so you can set it up for your email account.

10. Enjoy!

1 comment:

  1. Thanks soooooooo much for this!!! I've been looking for a proper way to do this for a few months now. I appreciate the hard work to teach the rest of the community.

    Cristian, I do have one question though. Upon setting up my GMail inbox, I have the choice of "GMail" or "IMAP".

    If I choose IMAP, I can set the SSL parameter. If I choose GMail, I don't have an option for connection type. How is my password sent if I choose GMail ? Is there a difference from IMAP in functionality?

    Thanks!

    ReplyDelete