Yesterday I finished setting up my mail server and got a certificate from letsencrypt and replaced my self signed cert with it in dovecot’s and postfix configuration files and restarted them, and connected to it using openssl’s s_client and received the following verify error:
Verify return code: 21 (unable to verify the first certificate)
Then I set up it on my web server(https://mail.matalamaki.fi) and ta’dah, it works well, at least on chrome, but for some reason the same setup doesn’t work with my mail server, why is that?
With self signed cert it signs it correctly, but it doesn’t work on gmail, which is the mail reason I need to get CA signed cert for my mail server too.
With the LE cert setup I am experiencing the same error from gmail too, when trying to add the pop3 inbox:
Checking your site I only get this “error”: verify error:num=20:unable to get local issuer certificate
But that is not really an error, it just says that it cannot verify the root issuer (DST Root CA X3) of your certificate because it is not included in the fullchain.pem which is fine as it should be in your trusted store.
If you don’t want to have that “error”, just add the path to your root certs (usually in /etc/ssl/certs/) in your openssl command: openssl s_client -connect mail.matalamaki.fi:993 -CApath /etc/ssl/certs/
Before post this message I checked again your server and I can see that your are adding the root certificate in fullchain.pem.
So, remove what you have added to fullchain.pem (in that file you should only have your certificate and the intermediate certificate) and you’ll be fine ;-).