ดัดแปลงจาก :  http://www.linuxmail.info/how-to-install-centos-5-linux/

 

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.

 

Install Dovecot

1. If you did not add dovecot during the CentOS installation, you can add it now using Package Manager.

 

Configure Dovecot

1. Click Applications, select System Tools then click File Browser. This will launch the File Browser window.

2. In the Location field, type in /etc and press Enter. If you don’t see the Location field, click the notepad button to toggle to text-based location bar.

3. Double click on the file dovecot.conf to open it for editing. 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

NoteFor 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.

 

4. Start the dovecot service. Learn how to start and stop services here.

 

Test Dovecot

1. Click Applications, select Accessories, and click Terminal. This will launch the Terminal window.

 

2. In the Terminal window, type in the highlighted commands below.

 

Sample dovecot session. Replace johndoe and password with any valid user name and password.

[root@mail ~]# telnet localhost pop3
+OK dovecot ready.
user johndoe
+OK
pass password
+OK Logged in.
list
+OK 1 messages:
1 622
.
retr 1
+OK 622 octets
Return-Path: <johndoe@mail.acme.local>
X-Original-To: johndoe
Delivered-To: johndoe@mail.acme.local
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
        by mail.acme.local (Postfix) with SMTP id 9729067C17
        for <johndoe>; Thu, 22 Feb 2007 09:06:37 -0500 (EST)
Message-Id: <20070222140640.9729067C17@mail.acme.local>
Date: Thu, 22 Feb 2007 09:06:37 -0500 (EST)
From: johndoe@mail.acme.local
To: undisclosed-recipients:;
X-IMAPbase: 1172153557 1
Status: O
X-UID: 1
Content-Length: 5
X-Keywords:


test
.
quit
+OK Logging out.
Connection closed by foreign host.
[root@mail ~]#

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