1. 程式人生 > >發送郵件提示Sender address rejected: not owned by user錯誤

發送郵件提示Sender address rejected: not owned by user錯誤

not owned by user Sender address reje


客戶端工具發送郵件提示Sender address rejected: not owned by user錯誤,maillog日誌裏面也提示這個錯誤。這個問題一般是客戶端工具上mail和mail from郵箱地址不一樣造成的。


方法一(但是這種方法不好,有風險):
修改main.cf

smtpd_sender_restrictions =
#       reject_sender_login_mismatch,
#       reject_authenticated_sender_login_mismatch,
#       reject_unauthenticated_sender_login_mismatch



方法二(但是這種方法復雜,不建議):

smtpd_sender_restrictions =
        reject_sender_login_mismatch,
        reject_authenticated_sender_login_mismatch,
        reject_unauthenticated_sender_login_mismatch
smtpd_sender_login_maps = hash:/etc/postfix/sender_login_maps,
        mysql:/etc/postfix/mysql_virtual_sender_maps.cf,
        mysql:/etc/postfix/mysql_virtual_alias_maps.cf
        
然後創建/etc/postfix/sender_login_maps文件,把mail from和from不一致的加進去即可。
格式為:A地址 A用戶

[root@localhost ~]#postmap sender_login_maps
[root@localhost ~]#postfix reload



方法三(建議方法):
把內網網段假如到信任IP地址。

mynetworks = 127.0.0.1, 10.10.8.0/24, 10.10.9.0/24
smtpd_sender_restrictions =
        permit_mynetworks,
        reject_sender_login_mismatch,
        reject_authenticated_sender_login_mismatch,
        reject_unauthenticated_sender_login_mismatch
smtpd_sender_login_maps =
#       hash:/etc/postfix/sender_login_maps,
        mysql:/etc/postfix/mysql_virtual_sender_maps.cf,
        mysql:/etc/postfix/mysql_virtual_alias_maps.cf


發送郵件提示Sender address rejected: not owned by user錯誤