
來信SPF檢查 (預設沒有啟用)
SPF主要的功能是郵件伺服器根據來信中寄件者網域資料主動去向寄信端所屬的DNS伺服器核對其SPF紀錄。
依照比對結果做接收與否的決定。
SPF 主要的目的就是避免別人冒用你的網域名稱寄信
此功能會檢查 來信的spf ,如果不符合系統會依照spf的設定予以拒絕
是目前防偽造信件非常有效的工具
Returned mail: see transcript for details
Mail Delivery Subsystem <
(reason:550 5.7.1 <
User unknown
554 5.5.1 Error: no valid recipients
如果收到退信是有關 openSPF
請加上 白名單
例外網域
列出的網域不會受到SPF檢查 , 例如 domain.com , 每個設定可用 逗點,空白,分號或跳行隔開
例外IP
列出的IP不會受到SPF檢查 , 例如 1.2.3.4 , 或 1.2.3.0/24 , 每個設定可用 逗點,空白,分號或跳行隔開
SMTP 錯誤碼 550 5.7.1 搭配 SPF 驗證失敗,代表收件方伺服器因為安全性或政策原因永久拒絕接收該封郵件。
Sep 4 15:26:22 test1 postfix/policy-spf[19523]: Policy action=PREPEND Received-SPF: none (mailer-daemon: No applicable sender policy available) receiver=test1.ublink.org; identity=mailfrom; envelope-from=MAILER-DAEMON; helo=PC-Work; client-ip=192.168.254.27
SPF 檢查信件通過的 syslog
UMail v5 檢查對方來信,未通過 SPF 檢查的 SMTP log
Sep 4 16:35:00 c69 postfix/smtpd[24527]: NOQUEUE: reject: RCPT from unknown[192.168.8.150]: 550 5.7.1 <
退回的信件內容如下,一定會包含說明網址 http://www.openspf.org/Why?
-------------------------------------------------------------
This is the mail system at host ubddns.org.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
The mail system
<
Recipient address rejected: Please see
http://www.openspf.org/Why?s=helo;id=ubddns.org;ip=192.168.8.150;r=test1.ublink.org (in
reply to RCPT TO command)
-------------------------------------------------------------
底下的檢查不是 SPF 也不是 PTR
來信域名錯誤處理

Postfix 的 relay_restrictions 主要用於管制**信件轉發(Relaying)**的權限。
簡單來說,它的核心作用是防止你的郵件伺服器被當作「公開轉發站(Open Relay)」,避免未授權的外部人員利用你的伺服器發送垃圾信。
主要的檢查與管制對象:
⚬ 送信者的身份與來源:檢查發信人是否經過身份驗證(SASL)、發信 IP 是否屬於信任的內部網路(mynetworks)。
⚬ 收信人的地址:判斷該封信的收件地址是否屬於本地網域(mydestination),還是需要幫忙「轉寄」到外部的其他網域。
與 smtpd_recipient_restrictions 的差別:
⚬ smtpd_recipient_restrictions:針對所有進入伺服器的收件者地址進行通用檢查(包含是否接受該封信)。
⚬ relay_restrictions:專門針對要轉發到外部網域的信件實施檢查。在較新版本的 Postfix 中,將 relay 權限獨立出來,可以讓設定邏輯更清晰、維護更安全。