Posts Tagged ‘pop3’

How to renew the SSL certificate for dovecot on CentOS

Wednesday, December 23, 2009 posted by Till

Make a backup of the old key and certificate file

mv /etc/ssl/certs/dovecot.pem /etc/ssl/certs/dovecot.pem.old mv /etc/ssl/private/dovecot.key /etc/ssl/private/dovecot.key.old


Create the new SSL certificate

openssl genrsa -out /etc/ssl/private/dovecot.key 1024 openssl req -new -x509 -key /etc/ssl/private/dovecot.key -out /etc/ssl/certs/dovecot.pem -days 730


Restart Dovecot:

/etc/init.d/dovecot restart

This articles describes the renewal of SSL certificates for courier pop3 and imap server. This is nescessary e.g. when the certificates are expired or contain the wrong hostname.

First delete the exsiting certificates:

rm -f /etc/courier/imapd.pem
rm -f /etc/courier/pop3d.pem

Then edit the template that contains the details for the ecrtificates so that the hostname in the certificate matches the hsotanme of your server and that the email address matches your postmaster email address:

vi /etc/courier/imapd.cnf
vi /etc/courier/pop3d.cnf

and create the new certificates:

mkimapdcert
mkpop3dcert

Courier pop3 and imap have to be restarted so they pick up the new ecrtificates:

/etc/init.d/courier-imap-ssl restart
/etc/init.d/courier-pop-ssl restart