今回の獲物は・・・・
これチョロいので、まぁいいか。と思って調べ始めたPostfix。
postfix メール設定メモ をだいたい参考にさせていただいているのですが
改めて書き出すと色々ありましたねぇ〜
実際の設定は?
実際に我が家で稼働中のファイルから触った項目だけ抜き出してきたのですが、こうやってみると、意外とありますね〜
注目点は、SMTPリレー先をnifty.comに設定してある事ですが、こちらもそれほど難しい話ではありません。
認証付きSMTPリレーの設定について
また、認証付きSMTPリレーについては別途設定が必要です。
-
/etc/postfix/smtp-auth
を編集
※このファイルはパーミッションに気をつけましょう。600がオススメです。[SMTPサーバー名] [ユーザー名]:[パスワード]
-
/etc/postfix/main.cf
を編集して設定項目を追加
※注意:relayhost
の設定についてカッコは付けたまま記述しますrelayhost = [SMTPサーバー名]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/smtp-auth
smtp_sasl_security_options = noanonymous postmap hash:/etc/postfix/smtp-auth
を実行してハッシュマップDBを更新するservice postfix reload
でPostfixの設定をリロードする
我が家の設定ファイルについて
基本は/etc/postfix/main.cfからの抜粋ですが、触ったところだけ抜き出してみました。以外に設定項目多いですね〜
postfix メール設定メモ
postfix メール設定メモ - Qiita*Update版をCentOS7 Postfix + SMTP-Auth/Submission PortとしてPost 概要 postfixを利用するときのよくやる設定メモ 環境 OS:CentOS /Redhat ...
mydomain = admkazuya.org
myorigin = $mydomain
inet_interfaces = all
inet_protocols = ipv4
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 127.0.0.0/8, 219.117.231.168/29, 192.168.3.0/24
relay_domains = $mydestination
relayhost = [smtp.nifty.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/relay_password
smtp_sasl_security_options = noplaintext, noanonymous
# 最下行に以下追記
message_size_limit = 5242880
disable_vrfy_command = yes
smtpd_helo_required = yes
strict_rfc821_envelopes = yes
allow_percent_hack = yes
swap_bangpath = yes
allow_untrusted_routing = no
smtpd_client_restrictions =
permit_mynetworks,
reject_unknown_client,
permit
smtpd_data_restrictions =
reject_unauth_pipelining,
reject_multi_recipient_bounce
smtpd_helo_restrictions =
permit_mynetworks,
reject_invalid_hostname,
reject_non_fqdn_hostname,
reject_unknown_hostname,
permit
smtpd_sender_restrictions =
permit_mynetworks,
reject_unknown_sender_domain,
reject_non_fqdn_sender,
permit
smtpd_recipient_restrictions =
permit_mynetworks,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
reject_unauth_destination,
permit
smtpd_etrn_restrictions =
permit_mynetworks,
reject_invalid_hostname,
permit
resolve_numeric_domain = yes
コメント