问题原文
原帖链接 · guettli · CC BY-SA 4.0
I run a Postfix server which forwards one address to a gmail address.
# /etc/aliases
localuser: [email omitted]
This works since several months. But if a sender has a SPF record with a hard fail, then the forwarding does not work:
gmail-smtp-in.l.google.com[ said: 550-5.7.26 The
MAIL FROM domain [example.com] has an SPF record with a hard fail 550-5.7.26
policy (-all) but it fails to pass SPF checks with the ip: 550-5.7.26
[...]. To best protect our users from spam and 550-5.7.26
phishing, the message has been blocked. Please visit 550-5.7.26
https://support.google.com/mail/answer/81126#authentication for more 550
5.7.26 information. -
gsmtp (in reply to end of DATA command)
How can I fix this?
社区高分解答
原帖链接 · mivk · CC BY-SA 4.0
As suggested in the OP's own answer, the solution is to install postsrsd to rewrite the sender's "Return‑Path: " header.
This full example on Debian 11 worked for me:
apt install postsrsd- Edit
/etc/default/postsrsd:- Uncomment the line with
SRS_EXCLUDE_DOMAINS=and add your domains, separated by space or comma:SRS_EXCLUDE_DOMAINS=example.com,.example.com,example.org
- Uncomment the line with
systemctl restart postsrsd- Edit
/etc/postfix/main.cfto add
# Use postsrsd to rewrite the Return-Path: header sender_canonical_maps = tcp:localhost:10001 sender_canonical_classes = envelope_sender recipient_canonical_maps = tcp:localhost:10002 recipient_canonical_classes= envelope_recipient,header_recipient
postfix reload
The suggested additional install of the "Postfix SRS forwarding agent" Postforward may not be necessary. It wasn't for me. Check it's description to see if you need or want it.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
