Migrating from Courier-IMAP to Dovecot IMAP/POP3
This section provides instruction on how to migrate single-host or clustered qmail from the Courier-IMAP service to the Dovecot IMAP/POP3 service.
Note:
Users who download incoming messages through POP3 and leave a copy of each message on a server, will receive duplicates of every message in their mail client after migration from Courier to Dovecot.
Important:
1. There is no migration procedure from the Dovecot IMAP/POP3 service to the Courier-IMAP service.
2. If the dovecot service cannot be started, apply the instruction of the https://kb.cloudblue.com/122186 KB article.
To perform the migration from the Courier-IMAP service to the Dovecot IMAP/POP3 service follow these steps:
- Log in to PCP.
- Uninstall the CourierIMAP (type: other) package from the required qmail host.
-
Install the dovecot (type: other) package on the qmail host. This package requires
dovecot-*.i386.rpmanddovecot-sieve-*.i386.rpmof the appropriate versions.The self-signed certificate is created automatically during the package installation for IMAP and POP protocols. This certificate and private key are placed in the
/etc/pki/dovecot/certs/dovecot.pemand/etc/pki/dovecot/private/dovecot.pemfiles. Later, you may change the self-signed certificate to the CA-signed certificate (a certificate signed by a Certification Authority) by replacing the default certificate and key manually. If the certificate and key are replaced, restart the dovecot service by using theservice dovecot restartcommand.If it is required, you may use the existing certificates of the CourierIMAP service. To do so, perform the following actions:
- Log in to the qmail host as
root. - For POP protocol, copy the certificate and private key from the
/etc/courier-imap/pop3d.pemfile to the/etc/pki/dovecot/certs/pop3.pemand/etc/pki/dovecot/private/pop3.pemfiles. - For IMAP protocol, copy the certificate and private key from the
/etc/courier-imap/imapd.pemfile to the/etc/pki/dovecot/certs/imap.pemand/etc/pki/dovecot/private/imap.pemfiles. -
Add the following lines to the
/etc/dovecot.conffile:protocol imap {ssl_cert_file = /etc/pki/dovecot/certs/imap.pemssl_key_file = /etc/pki/dovecot/private/imap.pem}protocol pop3 {ssl_cert_file = /etc/pki/dovecot/certs/pop3.pemssl_key_file = /etc/pki/dovecot/private/pop3.pem} - Restart the dovecot service.
- Log in to the qmail host as
-
On the qmail host, execute the following commands:
chgrp qmail /usr/libexec/dovecot/deliverchmod g+s /usr/libexec/dovecot/deliverusermod -G qmail dovecotThen, make sure the
/usr/libexec/dovecot/deliverfile has the following permissions:ll /usr/libexec/dovecot/deliver-rwxr-sr-x 1 root qmail 1087105 Nov 21 2011 /usr/libexec/dovecot/deliver -
In the
/etc/dovecot.conffile, adjust values of thelogin_max_processes_count(maximum number of login processes to create) andmax_mail_processes(maximum number of running mail processes) configuration parameters. The values of the parameters must suit the planned amount of simultaneous POP/IMAP connections and the hardware resources of the used qmail host. Refer to the Dovecot documentation to obtain the detailed information about these configuration parameters.Restart the dovecot service after the modification of the
/etc/dovecot.conffile.If you receive the 'Warning: fd limit 1024 is lower than what Dovecot can use under full load (more than 1408). Either grow the limit or change login_max_processes_count and max_mail_processes settings.' message, you should adjust the 'open file' limit using the
ulimit -n OPEN_FILE_LIMITcommand. For example, you may place the command to the/etc/init.d/dovecotfile.Important: In case of the mail cluster, perform steps 1-5 for each service node.
-
Log in to the qmail host as
rootand execute the following command:sh /usr/bin/imap_shf_lookup.sh -b -cImportant: In case of the mail cluster, this step should be performed only once on any service node.
- In case of the mail cluster, if you plan to provide to customers the ability to manage SIEVE mail filtering rules from their SIEVE-enabled mail clients, add the load balancing rule for the TCP port 2000 following instructions of the Creating Load Balancer section. Note that this functionality is not tested against all existing mail clients.