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. 2009-02-26 - Updated for release 1.1 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. And, as of release 1.1, you can run it on more than one port since we have been using this as our primary IMAP server for some time now. # UPGRADING to 2.1: For 2.1 Dovecot, with-pop3d is no longer a configuration option CC=/usr/local/gcc3.2.3/bin/gcc CPPFLAGS=-I/usr/local/ssl/include LDFLAGS=-L/usr/local/ssl/lib ./configure --with-ssl=openssl --with-ssldir=/usr/local/ssl/certs --with-pam --sysconfdir=/etc --localstatedir=/var --prefix=/usr/local/dovecot-2.1/ Errors from older compiler? main.c:632:1: directives may not be used inside a macro argument main.c:631:16: unterminated argument list invoking macro "printf" main.c: In function `print_build_options': main.c:639: syntax error before string constant Patch with dovecot-2.1.3-build_options_macro.patch patch --ignore-whitespace -p0 < dovecot-2.1.3-build_options_macro.patch cp -r /usr/local/dovecot-2.1/share/doc/dovecot/example-config/* /etc/dovecot/ /usr/sbin/adduser -u 109 dovenull -c Dovecot -s /bin/false /usr/local/dovecot-2.1/bin/doveconf -n -c /etc/dovecot.conf #RUN ON ALT PORT /sbin/iptables -t nat -A PREROUTING -p tcp -m tcp --dport 994 -j REDIRECT --to-port 993 /sbin/iptables -t nat -A PREROUTING -p tcp -m tcp --dport 144 -j REDIRECT --to-port 143 #INCREASE FILE HANDLES ulimit -n 8192 # OLDER VERSIONS #GET ALL THE FILES cd /tmp mkdir DOVECOT-20090226 cd DOVECOT-20090226 #wget http://www.peregrinehw.com/downloads/dovecot/dovecot-1.0.0.tar.gz wget http://www.peregrinehw.com/downloads/dovecot/dovecot-1.1.11.tar.gz wget http://www.peregrinehw.com/downloads/dovecot/dovecot-PAM #wget http://www.peregrinehw.com/downloads/dovecot/dovecot.conf.1.0 wget http://www.peregrinehw.com/downloads/dovecot/dovecot.conf.1.1 wget http://www.peregrinehw.com/downloads/dovecot/dovecot-1.1.11-build_options_macro-v2.patch #INSTALL THE MAIN PACKAGE cd /usr/src tar zxvf /tmp/DOVECOT-20090226/dovecot-1.1.11.tar.gz cd dovecot-1.1.11 patch -p1 < /tmp/DOVECOT-20090226/dovecot-1.1.11-build_options_macro-v2.patch 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 #Alternately, you could install a newer gcc in an alternate directory and configure the compilation to use it instead. For example: #CC=/usr/local/gcc3.2.3/bin/gcc 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 and provides faster compiling for machines with multiple processors 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-20090226/dovecot.conf.1.1 /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-20090226/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;