Courier-IMAP is a server that provides IMAP access to Maildirs. This IMAP server does NOT handle traditional mailbox files (/var/spool/mail, and derivatives), it was written for the specific purpose of providing IMAP access to Maildirs.

Installing Courier-IMAP with SSL on RedHat 9 is quick once you know the steps involved. This is the way I do it:

First, get Courier-IMAP. Version 1.7.3 runs great everywhere and I have been unable to compile 2.0 up to this point (I have tried in different machines and I always get a different compilation error)

tar -vjxf courier-imap-1.7.3.tar.bz2
cd courier-imap-1.7.3
./configure --disable-root-check --with-ssl --without-authdaemon
make
make install-strip
make install-configure
cp maildirmake /usr/bin
(maildirmake creates the Maildir directory structure where your email will be stored)


By default, it will try to use LDAP for authentication. In my case, I just want to use plain authentication.

vi /usr/lib/courier-imap/etc/authdaemonrc

And set the authdaemon to plain:
version="authdaemond.plain"

And also disable mysql and ldap authentication modules (if you are not going to use them) by removing authmysql and authldap from the imapd configuration file:
vi /usr/lib/courier-imap/etc/imapd

AUTHMODULES="authcustom authcram authuserdb authpam"
AUTHMODULES_ORIG="authcustom authcram authuserdb authpam"


You can now start the daemon with:
/usr/lib/courier-imap/libexec/imapd.rc start
and/or
/usr/lib/courier-imap/libexec/imapd-ssl.rc start (for the SSL daemon)

(You might want to add these lines to your /etc/rc.local so that it starts automatically next time you reboot)

Make sure that it is running with telnet localhost 143. If you get the IMAP server prompt you are good to go.

You will not be able to log in until you get your Maildir structure created on your home folder. Open a console as your regular user, go to your home directory and type maildirmake Maildir

You can now log in with your favorite IMAP client.

Last but not least, if you want your email delivered on your Maildir directory, you have to tell procmail that you will use Maildir instead of mbox and the location of the users destination mailboxes (assuming you are using procmail on a default RedHat installation)

Just vi /etc/procmailrc and replace the "default" setting with DEFAULT=$HOME/Maildir/

Enjoy,
Julian

All knowledge and software published in this website is released under the GNU General Public License (GPL)