0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ubuntu 24.04 LTSで自宅サーバー構築(PostfixとDovecotのSSL/TLS の設定)

Last updated at Posted at 2024-08-14

月額99円から。WordPressも簡単にインストールできるレンタルサーバー

事前に
https://qiita.com/sqoot610/items/e2a7b3ba8fa30df42d6f
を設定してください。
taisuke@ubuntuserver:~$ sudo vi /etc/postfix/main.cf
#最終行に追記
smtpd_tls_security_level = may
smtpd_tls_cert_file = /etc/letsencrypt/live/ご自身のサーバーのドメイン名/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/ご自身のサーバーのドメイン名/privkey.pem
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
taisuke@ubuntuserver:~$ sudo vi /etc/postfix/master.cf
#19, 20, 22行目 : コメント解除
submission inet n - y - - smtpd
-o syslog_name=postfix/submission
#-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
#SMTPS (465) を使用する場合は 最終行に追記
smtps inet n - n - - smtpd
-o syslog_name=postfix/smtps
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes

taisuke@ubuntuserver:~$ sudo vi /etc/dovecot/conf.d/10-ssl.conf
#6行目 : 変更
ssl = yes
#12,13行目 : コメント解除して証明書/鍵ファイル指定
ssl_cert = </etc/letsencrypt/live/ご自身のサーバーのドメイン名/fullchain.pem
ssl_key = </etc/letsencrypt/live/ご自身のサーバーのドメイン名/privkey.pem
taisuke@ubuntuserver:~$ sudo systemctl restart postfix dovecot
クライアント側の設定です。
Mozilla Thunderbird の場合、以下のようにメールアカウントのプロパティを開き設定をします。
左メニューで [サーバー設定] を選択し、右ペインで [接続の保護] の項目を [STARTTLS] または [SSL/TLS] に変更します。
ポートは [STARTTLS] は [143], [SSL/TLS] ならば [993] です。
thunderbird.jpg
送信サーバーの設定も変更します。
左メニューで [送信 (SMTP) サーバー] を選択し、右ペインで [接続の保護] の項目を [STARTTLS] または [SSL/TLS] に変更します。
ポートは [STARTTLS] は [587], [SSL/TLS] ならば [465] です。
以上で設定 は OK です。
thunderbird2.jpg
メールの送受信を実行して正常に動作するか確認してください。
thunderbird3.jpg
月額99円から。WordPressも簡単にインストールできるレンタルサーバー

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?