Difference between revisions of "Mail certificates"
| Line 25: | Line 25: | ||
certbot certonly --webroot -w /home/www/path -d yourdomain.com | certbot certonly --webroot -w /home/www/path -d yourdomain.com | ||
| + | |||
| + | |||
| + | |||
| + | For mail use: | ||
| + | sudo certbot -d mail.example.com --manual --preferred-challenges dns certonly | ||
[[category:Linux]] | [[category:Linux]] | ||
Latest revision as of 07:02, 8 June 2021
Configure postfix SSL certificates with letscencrypt
sudo postconf -e 'smtpd_tls_cert_file = /etc/letsencrypt/live/<domainname>/fullchain.pem'
sudo postconf -e 'smtpd_tls_key_file = /etc/letsencrypt/live/<domainname>/privkey.pem'
Fixing letsencrypt’s “expected xxx.pem to be a symlink”
Apparently, last time I migrated my server, I messed up my Let’s Encrypt configuration. Or maybe Let’s Encrypt changed its way of storing it. Anyway, renewing my certificates failed with this error:
expected /etc/letsencrypt/live/notepad.patheticcockroach.com/cert.pem to be a symlink Renewal configuration file /etc/letsencrypt/renewal/notepad.patheticcockroach.com.conf is broken. Skipping. Obviously, a file was supposed to be a symlink and it wasn’t. Which is strange, because I migrated just like the previous times, and a migration never caused that issue before. Anyway, I found a suggested solution that said to turn said .pem file into a symlink manually. Sounds a bit hackish to me.
I chose to just reissue new certificates for the same domain name. But if you do so, you must clean up properly, otherwise you’ll end up with new paths to your certificates, something like /etc/letsencrypt/live/yourdomain.com-0001/cert.pem, which would require you to also update your HTTP server configuration.
To clean up:
rm -rf /etc/letsencrypt/{live,renewal,archive}/{yourdomain.com,yourdomain.com.conf} (source) (NB: watch out, you should probably make a backup before running this)
Then you should be able to get a new certificate, under the same file and folder names, with the usual command:
certbot certonly --webroot -w /home/www/path -d yourdomain.com
For mail use: sudo certbot -d mail.example.com --manual --preferred-challenges dns certonly