Wednesday, May 11, 2011

Dovecot POP3/IMAP Server Setup Howto for RHEL/CentOS 5

 Dovecot:       Dovecot is an open source IMAP and POP3 email server for Linux/UNIX-like systems, written with security primarily in mind. Dovecot is an excellent choice for both small and large installations. It's fast, simple to set up, requires no special administration and it uses very little memory.


Install Dovecot:  Installing and setting up Dovecot in Red Hat Enterprise Linux 5 or CentOS 5 is easy. All we have to do is to enable the services we would like to provide and we are good to go.

 Make the use of yum or download dovecot and install it.

Here I have  installed it using yum. i.e use 

#yum install dovecot

Configure Postfix:

Go to the main configuration file dovecot.conf in /etc/dovecot.conf .We need to change a few key items. 

Find the following keys and change its values as follows
protocols = pop3 pop3s imap imaps
mail_location = maildir:~/Maildir/
pop3_uidl_format = %08Xu%08Xv
imap_client_workarounds = delay-newmail outlook-idle netscape-eoh
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh 
For 64-bit users: Add the line login_process_size = 64 
in the file /etc/dovecot.conf. 

Lines starting with # are comments. The last two line enables workarounds for various client bugs. Save the file after completing your changes.

Test Dovecot : Sample dovecot session. Replace ks and password with any valid user name and password.

 [root@fedora ~]# telnet localhost pop3
Trying ::1...
Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready.
user ks
pass ********
+OK Logged in.
+OK 1 messages:
1 472
retr 1
+OK 472 octets
X-Original-To: ks
Delivered-To: ks@fedora.localdomain
Received: from list (localhost [IPv6:::1])
        by fedora.localdomain (Postfix) with ESMTP id 76BB020509
        for ; Wed, 11 May 2011 15:39:37 +0530 (IST)
Message-Id: <20110511100949.76BB020509@fedora.localdomain>
Date: Wed, 11 May 2011 15:39:37 +0530 (IST)
From: fedora@fedora.localdomain
To: undisclosed-recipients:;

Hi This is the Mail from User *** fedora ** to ks
+OK 1 messages:
1 472
+OK Logging out.
Connection closed by foreign host.
[root@fedora ~]#

NoteIf you encounter any problems, check the log file at /var/log/maillog.

Feel free to comment

Kuldeep Sharma