Postfix
Postfix忽略發件人的pcre登錄映射
我試圖弄清楚為什麼我的後綴完全忽略了我的登錄映射,而日誌文件中沒有任何錯誤。
返回命令 postconf -m 顯示支持 pcre。
btree cidr environ fail hash internal memcache nis pcre proxy regexp sdbm sqlite static tcp texthash unix
這是我的 main.cf 的內容
smtpd_recipient_restrictions = reject_non_fqdn_recipient, reject_non_fqdn_sender, reject_unlisted_recipient permit_mynetworks, permit_sasl_authenticated, reject_unverified_sender, reject_unauth_destination, reject_sender_login_mismatch, reject_invalid_hostname, reject_unknown_sender_domain, reject_unknown_recipient_domain reject_rbl_client sbl-xbl.spamhaus.org, reject_rbl_client bl.spamcop.net, reject_rbl_client list.dsbl.org, reject_rbl_client rbl.mail-abuse.org, reject_rbl_client spamsources.fabel.dk smtpd_sender_login_maps = pcre:/etc/postfix/login_maps.pcre
login_maps.pcre 內容:
/^(.*)@mydomain.com.br$/ ${1}
所以我以 luciano@mydomain.com.br 身份進行身份驗證,但我可以將我的發件人電子郵件更改為 Everything@mydomain.com.br 並且電子郵件被接受。
我做錯了什麼或者防止這種情況的語法是什麼?
似乎
smtpd_recipient_restrictions
參數與參數混合在一起smtpd_sender_restrictions
。放置任何包含以下單詞的參數,sender
您smtpd_sender_restrictions
應該是金色的:smtpd_recipient_restrictions = reject_non_fqdn_recipient, reject_unlisted_recipient permit_mynetworks, permit_sasl_authenticated, reject_unverified_sender, reject_unauth_destination, reject_invalid_hostname, reject_unknown_recipient_domain reject_rbl_client sbl-xbl.spamhaus.org, reject_rbl_client bl.spamcop.net, reject_rbl_client list.dsbl.org, reject_rbl_client rbl.mail-abuse.org, reject_rbl_client spamsources.fabel.dk smtpd_sender_restrictions = reject_non_fqdn_sender, reject_unknown_sender_domain, reject_sender_login_mismatch
您還應該對發送者映射正則表達式中的任何文字點進行反沖轉義,如果未轉義
.
,這些是匹配任何字元的特殊字元。/^(.*)@mydomain\.com\.br$/ ${1}