「Xserver VPSでDebianサーバ構築/SMTPサーバ設定」の版間の差分

ナビゲーションに移動 検索に移動
 
(同じ利用者による、間の13版が非表示)
 
= 設定 =
 
以下の順に行う。
 
== 証明書 ==
<nowiki>
myhostname = mail.example.com
</nowiki>
 
=== その他の設定 ===
 
* /etc/postfix/main.cf
 
<nowiki>
smtpd_tls_cert_file=/etc/letsencrypt/live/mail.example.com/fullchain.pem
smtpd_tls_key_file=/etc/letsencrypt/live/mail.example.com/privkey.pem
 
home_mailbox = Maildir/
 
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
</nowiki>
 
* /etc/postfix/master.cf
 
<nowiki>
smtps inet n - y - - smtpd
 
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
 
-o smtpd_relay_restrictions=permit_sasl_authenticated,reject
</nowiki>
 
=== e-mail message submission ===
 
<nowiki>
submission inet n - y - - smtpd
 
-o smtpd_sasl_auth_enable=yes
 
-o smtpd_relay_restrictions=permit_sasl_authenticated,reject
</nowiki>
 
=== 設定反映 ===
 
次のコマンドを実行し、設定を反映する。
 
<nowiki>
$ sudo systemctl reload postfix@-
</nowiki>
 
/usr/share/doc/postfix/README.Debian.gz
 
== メール転送設定 ==
 
次のファイルに、以下の設定を行う。
 
* /etc/aliases
 
<nowiki>
root: LOCAL
</nowiki>
 
{| class="wikitable"
|LOCAL
|ローカルユーザ名
|}
 
<nowiki>
$ sudo newaliases
</nowiki>
 
== バックアップ ==
 
* /etc/postfix
* ~/Maildir
 
= 参考 =
 
== ローカルメールサーバの場合 ==
 
{| class="wikitable"
|
|サテライトシステム
|-
|システムメール名
|example.com
|-
|SMTP リレーホスト
|mail.example.com:587
|-
|root と postmaster のメール受け取りユーザ
|mede
|-
|メールを受け取るほかの宛先 (なければ空)
|HOST, HOST, localhost.localdomain, localhost
|-
|メールキューの同期更新を強制しますか?
|いいえ
|-
|ローカルネットワーク
|127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
|-
|メールボックスのサイズの制限 (バイト)
|0
|-
|ローカルアドレス拡張文字
| +
|-
|利用するインターネットプロトコル
|すべて
|}
 
=== myhostname ===
 
* /etc/postfix/main.cf
 
<nowiki>
myhostname = HOST
</nowiki>
 
HOSTにドメイン名が付いていると、うまく動かない?
 
=== スマートホスト ===
 
* /etc/postfix/main.cf
 
<nowiki>
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/example_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_mechanism_filter = plain
smtp_use_tls = yes
</nowiki>
 
==== スマートホストパスワード設定 ====
 
次のファイルに、以下の設定を行う。
 
* /etc/postfix/example_passwd
 
<nowiki>
mail.example.com:587 mede:PASS
</nowiki>
 
{| class="wikitable"
|PASS
|パスワード
|}
 
<nowiki>
$ sudo postmap mede_passwd
$ sudo rm mede_passwd
$ sudo chmod 600 mede_passwd.db
</nowiki>
 
* /etc/aliases
 
<nowiki>
root: mede
mede: mede@example.com
</nowiki>

ナビゲーション メニュー