How-To Install Dovecot IMAP/POP3 server on RedHat
10-24-05 - Updated and tested Dovecot 1.0 Alpha Release Candidate 4
03-24-06 - Updated and tested Dovecot 1.0 Beta3 CVS Snapshot Mar 7
06-06-06 - Updated and tested Dovecot 1.0 Beta8
05-03-07 - Quick note that we updated to Dovecot 1.0 Release using the same basic premise below.
Author: Kevin A. McGrail
Notes:
Dovecot is a fabulous open source IMAP and POP3 server for Linux that I think has a bright future.
More information is available at
http://www.dovecot.org/.
These instructions are how I made dovecot a drop-in replacement/addition on a RedHat 7.3 server running the UW-IMAP.
It works with SSL and non-SSL and binds on ports 144 and 994 (if you use my configuration file) so that it can run seamlessly
along with UW-IMAP for testing purposes.
We aren't through testing it but it looks really really promising and we've been running it since February '05 with 3 heavy users.
#GET ALL THE FILES
cd /tmp
mkdir DOVECOT-20051024
cd DOVECOT-20051024
wget
http://www.peregrinehw.com/downloads/dovecot/dovecot-1.0.0.tar.gz wget
http://www.peregrinehw.com/downloads/dovecot/dovecot-PAM wget
http://www.peregrinehw.com/downloads/dovecot/dovecot.conf.1.0#INSTALL THE MAIN PACKAGE
cd /usr/src
tar zxvf /tmp/DOVECOT-20051024/dovecot-1.0.0.tar.gz
cd dovecot-1.0.0
CPPFLAGS=-I/usr/local/ssl/include LDFLAGS=-L/usr/local/ssl/lib ./configure --with-ssl=openssl --with-ssldir=/usr/local/ssl/certs --with-pam --with-pop3d --sysconfdir=/etc --localstatedir=/var
#-j works fine
make -j3
make install
#This installs Dovecot under /usr/local with the dovecot.cnf in /etc.
#Now you must also create a configuration file to get it to work:
#DEFAULT CONFIGURATION EXAMPLE
#mv /usr/local/etc/dovecot-example.conf /etc/dovecot.conf
#MY CONFIGURATION FILE
#This configuration is a replacement for UW-IMAP and runs on ports 994 and 144 so it can run in conjunction as an alternate server.
#It uses SSL and uses the SAME certificates that I use for stunnel. See
http://www.peregrinehw.com/downloads/stunnel/INSTALL mv /tmp/DOVECOT-20051024/dovecot.conf.1.0 /etc/dovecot.conf
#If you use dotlock
chmod 1777 /var/spool/mail
#And create the var dir for the process
mkdir /var/run/dovecot
#And add the PAM authentication configuration file
mv /tmp/DOVECOT-20051024/dovecot-PAM /etc/pam.d/dovecot
#And create a user for the daemon
/usr/sbin/adduser -u 108 dovecot -c Dovecot -s /bin/false
#Startup is manual. Add these to your rc.local.
echo 'Starting Dovecot...'
/usr/local/sbin/dovecot
#Finally, a note re: POP Before SMTP. This is the regexp I use to trigger on for regexp for my poprelayd-KAM:
$s =~ s/^... .. ..:..:.. .* dovecot: (pop3|imap)-login: Login: .+ rip=(\d+\.\d+\.\d+\.\d+),.*$/$2/i;