[Dev] メールサーバのSSL証明書を更新する (再)

in #japanese6 days ago

こんにちは、@yasuです。

メーラーでエラーが発生していたので、新しくSSL証明書を作成しました。

■メーラーでエラーが発生

--------2026/08/14 11:09:13 受信
SSLの処理(2)でエラーが発生しました。エラーコード=0x80090328
「アカウント毎の設定・メールサーバー・詳細」の「証明書を検証しない」をONにすれば回避できるかもしれません。

■ルーターのポートマッピング設定確認
ポート80を通す

■ポート80を使用しているプロセス
sudo ss -ltnp 'sport = :80'
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 4096 0.0.0.0:80 0.0.0.0:* users:(("docker-proxy",pid=1727060,fd=7))
LISTEN 0 4096 [::]:80 [::]:* users:(("docker-proxy",pid=1727067,fd=7))

■docker-proxyを止める

■ポート80を使用しているプロセス
sudo ss -ltnp 'sport = :80'
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process

■SSL証明書作成
sudo certbot certonly --standalone -d mail.steememory.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Cert is due for renewal, auto-renewing...
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for mail.steememory.com
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:

  • Congratulations! Your certificate and chain have been saved at:
    /etc/letsencrypt/live/mail.steememory.com/fullchain.pem
    Your key file has been saved at:
    /etc/letsencrypt/live/mail.steememory.com/privkey.pem
    Your cert will expire on 2026-11-12. To obtain a new or tweaked
    version of this certificate in the future, simply run certbot
    again. To non-interactively renew all of your certificates, run
    "certbot renew"

  • If you like Certbot, please consider supporting our work by:

    Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
    Donating to EFF: https://eff.org/donate-le

■メールサーバを再起動する
sudo systemctl restart postfix.service
sudo systemctl restart dovecot.service

■SSL証明書の期限を確認する
sudo certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Cannot extract OCSP URI from /etc/letsencrypt/live/mail.steememory.com/cert.pem


Found the following certs:
Certificate Name: mail.steememory.com
Domains: mail.steememory.com
Expiry Date: 2026-11-12 01:22:24+00:00 (VALID: 89 days)
Certificate Path: /etc/letsencrypt/live/mail.steememory.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/mail.steememory.com/privkey.pem


参考記事

[Dev] メールサーバのSSL証明書を更新する