Red Hat Linux 7 Unleashed

Red Hat Linux 7 Unleashed

By William Ball

IMAP

As noted at the beginning of the chapter, POP was a good first step to enable people on non-UNIX operating systems to read their UNIX-based email. But as time went on and distributed computing really took off, the deficiencies stood out. The POP server would not keep the read or unread state of messages. Messages would be downloaded to the user's PC and deleted off the server, so when the user moved to another PC, he had to move his mailbox between the two different machines. In this day and age of remote communication, people found that accessing email from home over a modem connection could be painfully slow if there were many messages to download, and they could not access the email folders they created on their work PC from home.

The IMAP protocol now allows people to store all their folders online. This makes it possible to access your email on your laptop while travelling, at home, or at work without having to transfer the messages back and forth. It works by transferring all the message headers of the folder you are reading. Then, using your IMAP client software, you can select a message and it will appear on your screen. The main advantage, of course, is that the messages are left on the server so you can access them wherever you happen to be.

Similarly to the POP3 protocol, IMAP (also commonly referred to as IMAP4) is also an RFC standard, so it's a transparent protocol that can be added to any messaging system. There are IMAP implementations for not just UNIX systems, but for Microsoft Exchange, Novell Groupwise, and countless others.

Configuring an IMAP Server

Configuring an IMAP server on your Red Hat Linux system is relatively straightforward. You need to make sure that the imapd RPM is installed:

[root@gonzo /] # rpm -q imap
imap-4.7c2-3

If you get similar output, you are in business. Otherwise, you will need to install imapd, which is on your Red Hat Linux CD-ROMs.

You also need to check that imapd is not disabled in your /etc/xinetd.d/imap file. It should have the following contents:

service imap
{
        disable          = no
        socket_type      = stream
        wait             = no
        user             = root
        server           = /usr/sbin/imapd
        log_on_success   += DURATION USERID
        log_on_failure   += USERID
}

If you need to change it then have xinetd reload its configuration files, which you can do like so:

[root@gonzo /] # /etc/init.d/xinet reload

By now, imapd is running and you should be able to connect to it. This is similar to the way you tested the connection to your POP server in the previous section.

Type in the following:


   telnet imapserver imap

imapserver is the name of the machine running the imapd program. You should get a response similar to the following:

* OK imapserver IMAP4rev1 v11.241 server ready

This result means the IMAP server has responded and is awaiting an instruction (again, this is normally done by the client mail reader). If you want to test the authentication service, try to log in as yourself and see whether the service registers your current email box. For example, to log in as sshah with the password mars1031, enter


   A001 user sshah mars1031

   A001 OK LOGIN completed

You are now logged in to your IMAP server. Since you were just testing, you can log out now by entering this:


   A002 logout
* BYE imapserver IMAP4rev1 server terminating connection

Your IMAP server is now set up and ready to use!

Share ThisShare This

Informit Network