Ssl – Fix logjam vulnerability in courier

courierlogjamsslvulnerabilities

The site weakdh.org explains how to fix postfix against the weak Diffie-Hellman attack called "logjam".

But don't I have to fix courier too? Or do I have to migrate to dovecot to be logjam-safe?

Best Answer

I found this blog post that explains it quite well.

To speed this up, first check, if you already have good parameters in /etc/ssl/certs/dhparams.pem check with

openssl dhparam -text -noout -in /etc/ssl/certs/dhparams.pem

if so copy them into /etc/courier/dhparams.pem with

cp -a /etc/ssl/certs/dhparams.pem /etc/courier/dhparams.pem

otherwise generate with

openssl dhparam -out /etc/courier/dhparams.pem 4096

Courrier version 4.15 removes the TLS_DHCERTFILE parameter from imap, and pop3d configuration files. DH parameters, and DH parameters only, get read from the new TLS_DHPARAMS file (and the other functionaly of TLS_DHCERTFILE, for DSA certificates, is merged into TLS_CERTFILE). After upgrading, run the mkdhparams script to create a new TLS_DHPARAMS file.

So check your installed version with

 apt-cache show courier-imap-ssl|grep Version

If you have at least Version 4.15, now edit /etc/courier/imapd-ssl and set

TLS_DHPARAMS=/etc/courier/dhparams.pem

restart courier-imap-ssl:

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

check the connection with openssl version 1.0.2a.

openssl s_client -host <yourhost.org> -port 993