Topic: easy let's encrypt guide for ubuntu 16.04 iredmail server with nginx
Here's what I did, if anybody out there is looking for help. I borrowed from a couple guides across the net and this is how I got it all to work:
sudo apt-get install letsencrypt
# since using --standalone, stop nginx / apache2 first.
# also A-record(s) need to be pointing from your nameservers to your web/mail server(s) IP address(es).
# I will make certificate for example.com, www.example.com, and mail.example.com (change as needed)
letsencrypt certonly --standalone -d example.com -d www.example.com -d bounce.example.com
# enter in your email address
#####################
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at
/etc/letsencrypt/live/example.com/fullchain.pem. Your
cert will expire on 2017-06-19. To obtain a new version of the
certificate in the future, simply run Let's Encrypt again.
- If you like Let's Encrypt, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
######################
# find where postfix and dovecot self-signed certs are,
# mv them .bak
# ln -s symlinks to new letsencrypt file
# reload?/restart the services
# where is postfix certs?
postconf smtpd_tls_cert_file smtpd_tls_key_file
# smtpd_tls_cert_file = /etc/ssl/certs/iRedMail.crt
# smtpd_tls_key_file = /etc/ssl/private/iRedMail.key
# where is dovecot certs?
doveconf ssl_key ssl_cert
# ssl_key = </etc/ssl/private/iRedMail.key
# ssl_cert = </etc/ssl/certs/iRedMail.crt
# save old self-signed iRedMail certs for a rainy day
mv /etc/ssl/certs/iRedMail.crt /etc/ssl/certs/iRedMail.crt.bak
mv /etc/ssl/private/iRedMail.key /etc/ssl/private/iRedMail.key.bak
# make symlink so that server will use letsencrypt certs (change example.com)
ln -s /etc/letsencrypt/live/example.com/privkey.pem /etc/ssl/private/iRedMail.key
ln -s /etc/letsencrypt/live/example.com/fullchain.pem /etc/ssl/certs/iRedMail.crt
service postfix reload
service dovecot reload
#####
# note #
# symlink seems to have done the trick for nginx, too.
#####
#turn nginx back on
service nginx start
# more info
# https://certbot.eff.org/#ubuntuxenial-nginx
# how to renew:
# test
service stop nginx
letsencrypt renew --dry-run --agree-tos
service start nginx
# how to really renew
# it suggests making a script to run renew twice a day https://certbot.eff.org/docs/using.html#renewal
service stop nginx
letsencrypt renew
service start nginx
# that's it.
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.