By
ABSTRACT: The Internet Mail Access Protocol, Version 4rev1 (IMAP4rev1), allows users to access and maintain hierarchical collections of e-mail folders on a remote server over the Internet. The "client-server" nature of the IMAP paradigm allows e-mail programs to enjoy the same benefits of portability and network transparency that graphical programs have gained from the X11 Windowing system. In this article, we describe how to set up client and server software on Linux to use IMAP for managing your mail. In addition, we explain the benefits and drawbacks of IMAP, and discuss when and under what situations it makes sense to use IMAP.
The first step is to install an IMAP server. If your ISP already runs an IMAP server for you, then you might want to just use their server instead. An advantage of this route is that you can access your mail from anywhere without requiring your computer to be on. A disadvantage is that you have to dial in to your ISP to access your mail. In any case, most ISPs don't provide IMAP services, so you'll most likely have to run IMAP on your own computer anyway.
Without further ado, here's a quick and dirty set of instructions for installing the University of Washington IMAP server.
First, get and extract the latest version (4.4 as of this writing):
[root@localhost ~]# lynx ftp://ftp.cac.washington.edu/imap/imap-4.4.tar.Z [root@localhost ~]# tar xzvf imap-4.4.tar.Z [root@localhost ~]# cd imap-4.4Type one of "make lnx", "make sl5", "make slx". The first is for traditional systems, the second is for systems using libc5 and shadow passwords, and the third is for glibc-based systems that use shadow passwords.
[root@localhost imap-4.4]# make lnxInstall the newly compiled file:
[root@localhost imap-4.4]# install -s -m 755 -o root -g mail imapd/imapd /usr/sbinAdd the following line to your /etc/inetd.conf (it may already be there; if so, uncomment it out):
imap stream tcp nowait root /usr/sbin/tcpd /usr/sbin/imapdSet up your hosts.allow and hosts.deny files to restrict IMAP access to authorized domains only. This step is highly recommended, as the University of Washington IMAP server has had some fairly serious security vulnerabilities in the past.
In /etc/hosts.deny
add the line
imapd: ALLIn
/etc/hosts.allow
add the machines and domains that you want to allow to access your IMAP server:
imapd: your.local.host.com imapd: .yourisp.com imapd: .yourschool.eduFinally, restart
inetd
and your server is ready to go:
[root@localhost ~]# killall -HUP inetd
RedHat 5.2 instructions:
lynx ftp://ftp.redhat.com/pub/redhat/redhat-5.2/i386/RedHat/RPMS/imap-4.4-2.i386.rpm rpm -Uvh imap-4.4-2.i386.rpmDebian 2.0 instructions:
lynx ftp://ftp.debian.org/debian/dists/stable/main/binary-i386/mail/imap_4.2-1.deb dpkg -i imap_4.2-1.debAfter installing these packages, you'll still have to go back and edit
/etc/inetd.conf
, /etc/hosts.deny
, and /etc/hosts.allow
yourself as described above.
Pine is available from http://www.washington.edu/pine/. It is very popular in the Unix world. The 4.0x versions added support for online IMAP folder access. To configure pine, press S to enter Setup, L to configure your collection list, and then A to add a collection. Enter your server, username, and mail folder directory as described above.
Simple, isn't it? Pine supports multiple IMAP collections, so you can add as many as you want and manage them all from one place.
Screenshot of pine configuration
Netscape Communicator is an integrated web browser and Mail/News reader that is in fairly widespread use today. The 4.07 version is suitable for light mail processing, but it will crash if you give it a folder with well over 1000 messages (try it). Netscape Communicator is available from http://home.netscape.com/.
To set Netscape up for IMAP, select Preferences under the "Edit" menu, expand the "Mail & News" tab, click on the "Mail Server" entry, and enter in your username and your IMAP server. Obviously, make sure the server type "IMAP4" is selected. Click on the "More Options" box and enter in the mail folder directory you selected above. Finally, make sure the "Move Deleted Messages to Trash" box is not checked; this feature is rather broken and IMAP already provides flags to deal with deleted messages.
Netscape 4.0x does not support multiple IMAP collections, and it cannot automatically copy sent mail to a remote IMAP folder. Netscape 4.5 does support these things, but I have found the IMAP client in Netscape 4.5 to be far too unstable for real work.
Screenshot of Netscape configuration
In TkRat, select "New/Edit Folder" from the Admin menu. Then select "IMAP Folders" from the Import menu, and type in your username, IMAP server, and a wildcard matching the folders in your mail folder directory. Note that TkRat expects a wildcard rather than a directory.
Screenshot of TkRat configuration
Here's some examples:
Courses/
is a folder that can only contain subfolders.Courses/Calculus
is a subfolder of Courses/
. It can only contain messages.Courses/Languages/
is a subfolder of Courses/
that can only contain further subfolders.INBOX
, Inbox
, or any capitalization thereof, is reserved for your inbox. You can't create a folder of your own with this name.
A separate issue is the use of plaintext passwords for logins and authentication. Like most services, IMAP sessions are sent as plaintext over the Internet. Many people feel that sending passwords over the Internet as plaintext is no big deal. These people tend to use telnet, ftp, POP3, etc. without reservations. However, if you don't like sending your password over the Internet unprotected, you have precious few options:
In short, if you're really happy with the way you read your mail now, then you don't need to bother with IMAP, but if you're itching for some additional flexibility in managing your mail, you should definitely consider adopting IMAP.
A paper comparing IMAP and POP
A long list of products supporting IMAP