無法使用 smtp_header_checks 變更寄件者位址

無法使用 smtp_header_checks 變更寄件者位址

有後綴 2.10。 main.cf 中的非預設選項:

smtp_header_checks = pcre:/etc/postfix/smtp_header_checks
relayhost = smtp.company.org

/etc/postfix/smtp_header_checks :

/from:.*/i REPLACE From: [email protected]

但是,tcpdump 顯示以下行傳送到中繼:

MAIL FROM:<[email protected]>

我用本地sendmail發送

答案1

我喜歡使用通用地圖來完成此任務,但除此之外,您不能透過這種方式從雅虎發送。

postconf -e smtp_generic_maps=hash:/etc/postfix/generic
echo 'root [email protected]' >> /etc/postfix/generic
postmap /etc/postfix/generic
service postfix restart

從雅虎發送。

postconf -e relayhost=smtp.yahoo.co.uk:465 
echo 'smtp.yahoo.co.uk username:password' >>/etc/postfix/sasl_passwd
chown root:root /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd 
postmap hash:/etc/postfix/sasl_passwd

如果安裝了postfix,那麼即使您執行sendmail命令其中一個或另一個都可以安裝,您正在使用它,postfix也會安裝一個sendmail包裝器。

相關內容