Letsencrypt を postfix, dovecotで使う


自分用メモ

letsencrypt

postfix & dovecot

postfix

ln -s /etc/letsencrypt/live/domain.tld/privkey.pem /etc/postfix/ssl.key
ln -s /etc/letsencrypt/live/domain.tld/fullchain.pem /etc/postfix/ssl.cert

edit both configs so they point to key and cert
doveadm reload && /etc/init.d/postfix restart

dovecot

/etc/dovecot/conf.d/10-ssl.conf
ssl_cert = </etc/letsencrypt/live/YOURSITE/fullchain.pem
ssl_key = </etc/letsencrypt/live/YOURSITE/privkey.pem

letsencrypt-auto script

encrypt.sh
/tmp/git/letsencrypt/letsencrypt-auto certonly --webroot /var/www/example.jp/www -d example.jp -d www.example.jp -d mail.example.jp

renew SSL

renew-letsencrypt.sh
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/opt/rh/python27/root/usr
/lib64
#/etc/init.d/httpd stop
cd /tmp/git/letsencrypt && ./letsencrypt-auto certonly --renew-by-default -d example.jp -d www.example.jp -d mail.example.jp
/etc/init.d/httpd restart