大网数据广告活动
服务器运维问答

How to prevent email forwarded by exim from being seen as spam

· 52CE 我爱测

I have recently started to look after a mail system where users can host their email with a web mail front end. One of the features provided is a function to set up forwarding. The problem I am facing, and which people before me …

问题原文

原帖链接 · VagrantPaladin · CC BY-SA 4.0

I have recently started to look after a mail system where users can host their email with a web mail front end. One of the features provided is a function to set up forwarding.

The problem I am facing, and which people before me have faced, is that when users forward mail to another mailbox, such as their own gmail address, Google sees the email as coming from an unauthorized IP address.

I understand that this is due to the sender domain have set up SPF records with a "-all" flag, and my IP address clearly does not belong there.

Gmail, and other providers, as far as I understand it, then cannot tell the difference between an actual forwarded message, and a spoofed spam message, and then subsequently greylists the address of my server.

I cannot help but think someone else must have solved this before.

The forwarding is done using exim, so what I am looking for is a guide, or even just the right keywords to use to search for, for an answer to this issue.

已采纳解答

原帖链接 · user1247280 · CC BY-SA 4.0

Someone else has indeed solved this before, and "there is no way other than updating SPF in the sender domain" is not true.

The answer is SRS, Sender Rewriting Scheme: http://www.open-spf.org/SRS/ and https://en.wikipedia.org/wiki/Sender_Rewriting_Scheme .

If you have control over the mail server that is doing the forwarding, then in principle, you could implement SRS. (See exim4 configuration with SRS daemon )

Unfortunately, looking at things the other way round, Google does not itself implement SRS when it is set to forward, so your email server would reject an email from a strict SPF sender which is forwarded to you via GMail or Google Workspace. In that case, you could make an exception for mails with the X-Gm-Original-To header, but that then undermines the intention of SPF: if this were routinely done, then a forger would just add that header.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-10-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。