- Download and install the newest OpenSSL. At time of writing, this is
openssl-0.9.8g.tar.gz. To install:
./config; ./make; make test; make install
(check the "make test" output for
errors before "make install).
- Create certificate for imapd to use. Change directory to /usr/local/ssl/certs/ and type
openssl req -new -x509 -nodes -out imapd.pem -keyout imapd.pem -days 3650
To avoid warnings, the "Common Name" you enter should be either your FQDN or IP address.
- Download and install the newest UW-imapd. At time of writing, this is
imap-2006k.tar.Z. You can also just download imap.tar.Z to get the latest build. To unack, use gunzip. To install, I used:
make lnp PASSWDTYPE=pam SSLTYPE=unix
The build type (lnp) will vary between operating systems. This one worked on
Fedora Core 1 (Yarrow). This make command will create the imapd binary as "[source_dir]/imapd/imapd". You can leave it in
place or copy it to directory such as /usr/sbin/. I left it in /usr/local/imap-2006k/imapd.
- Configure xinetd to start the imap and imaps daemons. Note that both are run by the same binary "imapd." Create a file
named "imap" in /etc/xinetd.d/
service imap
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/local/imap-2006k/imapd/imapd
log_on_success += HOST DURATION
log_on_failure += HOST
# bind = 127.0.0.1
}
Create a file named "imaps" also in /etc/xinetd.d/
service imaps
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/local/imap-2006k/imapd/imapd
log_on_success += HOST DURATION
log_on_failure += HOST
}
- Configure PAM to accept authentications from the imapd. Create two identical files containing the text below, and name
them "imap" and imaps":
#%PAM-1.0
auth required pam_unix_auth.so
account required pam_unix_acct.so
password required pam_unix_passwd.so
session required pam_unix_session.so
- Start/Stop your imap and imaps services with /etc/rc.d/init.d/xinetd restart.