向通过 exim4 发送的邮件添加标头

发布于 2024-07-06 03:46:58 字数 572 浏览 16 评论 0原文

我有一个运行 Exim4-daemon-heavy 的 Debian Etch 系统。

该系统对互联网开放,但其目的是它只会接收来自垃圾邮件过滤服务的合法邮件,该服务作为其前面的代理运行。 (不过,我不能只限制对这些 IP 的访问,因为我确实有一些授权用户通过我的服务器在端口 25 上进行中继。我知道我应该使用 587 - 但目前我没有。

)是:

[互联网]-> [SMTP代理]-> [我的服务器]

不幸的是,我发现垃圾邮件发送者直接将邮件发送到邮件服务器,并忽略 MX 记录。 因此,我的明显解决方案似乎是:

  1. 在 SMTP 代理处向每条已处理的消息添加标头。
  2. 在我的服务器上为每条传入邮件添加标头,除非邮件来自授权中继器。 (即已完成 SMTP 身份验证的人。)

这样,我就可以使用 procmail 来仅通过忽略我的 MX 记录的发件人直接发送垃圾邮件。

我很确定 Exim4 可能会被迫添加一个标头,例如“X-Submitter: $ip” - 来记录提交消息的远程 IP,但我不确定应该如何完成。

I've got a Debian Etch system running Exim4-daemon-heavy.

The system is open to the internet, but the intention is that it will only receive legitimate mail coming from a spam-filtering service, which runs as a proxy ahead of it. (I can't just limit access to those IPs though, because I do have some authorized users who relay via my server on port 25. I know I should be using 587 - but currently I'm not.)

The general way this works is:

[Internet] -> [SMTP proxy] -> [My Server]

Unfortunately I've got spammers sending mail directly to the mailserver, and ignoring the MX record(s). So it seems like my obvious solution is to either:

  1. Add a header to each processed message at the SMTP proxy.
  2. Add a header at my server for each incoming message unless the mail is coming from an authorized relayer. (ie. Somebody who has completed SMTP AUTH.)

That way I could use procmail to just junk messages that came direct, via senders who ignored my MX records.

I'm pretty sure that Exim4 could be coerced into adding a header such as "X-Submitter: $ip" - to record the remote IP which submitted the message, but I'm unsure how that should be done.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

丘比特射中我 2024-07-13 03:46:58

请注意,debian 以一种相当独特的方式重新打包 exim,这使得它们的打包和维护更容易,但使用通用规则有时不能顺利插入。

处理此问题的正确方法是拒绝未经授权且非来自代理 IP 的邮件。 在您的 rcpt ACL 中添加如下内容:

deny message = quit trying to bypass DNS
     !hosts = PROXY_IP_ADDRESS
     !authenticated = *

Be aware that debian repackages exim in a fairly unique way that makes their packaging and mainetance easier but makes using generic rules sometimes not plug in as smoothly.

The correct way to handle this would be to reject mail that is not authorized and not from the proxy IP. Put something like this in your rcpt ACL:

deny message = quit trying to bypass DNS
     !hosts = PROXY_IP_ADDRESS
     !authenticated = *
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文