Postfix 自從 Debian Linux 升級到 Buster 後,內部信就寄不出去也收不到了,來研究看看怎麼解決~
Postfix 修正 fatal: in parameter smtpd_relay_restrictions 等問題
- $ tail -f /var/log/mail.info # 出現下述錯誤:
- postfix[22076]: Postfix is running with backwards-compatible default settings
- postfix[22076]: See http://www.postfix.org/COMPATIBILITY_README.html for details
- postfix[22076]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
- 主要是下面這行:
- postfix/smtpd[5251]: fatal: in parameter smtpd_relay_restrictions or smtpd_recipient_restrictions, specify at least one working instance of: reject_unauth_destination, defer_unauth_destination, reject, defer, defer_if_permit or check_relay_domains
看起來解法有兩種:
- 設定降低相容性,/etc/postfix/main.cf 加入下述:(我沒用這招,不確定是否可行)
- compatibility_level=2 # 可查看這個 postconf -e compatibility_level=2 # 可測試
- 設定檔 /etc/postfix/main.cf 加入下述:(我用這個,直接加在最後一行即可)
- smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
- $ sudo systemctl restart postfix # 即可收到信囉~
相關網頁
- Postfix stopped accepting mail after update to 3.3.1-1.fc28.x86_64
- Email gateway postfix fatal error - "fatal: in parameter smtpd_relay_restrictions or smtpd_recipient_restrictions"
- postfix not relying mail from remote hosts
- postfix 不依賴於來自遠端主機的郵件
- Postfix 會在收到不是您欲明得電子郵件時詢問該怎麼做
- smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination