电子邮件服务器设计:避免循环 [英] Email Server Design: Avoiding Loops

查看:194
本文介绍了电子邮件服务器设计:避免循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设您正在设计具有规则支持(如条件转发等)的花哨电子邮件服务器。电子邮件循环的古老问题让您面对面:



1)假设您设置了将所有邮件转发到另一个地址的规则。如果该地址不存在,该域名的邮政主管会向您发送回邮件给您。当然,您的规则并没有区分这些消息并转发它们,而是创建一个循环。



2)另外一种情况是两个用户,使用这个客户端客户端,设置转发规则到对方的地址。所有我们需要的是一个单一的起始信息,他们将要旋转到一个循环。



3)或者,自动回复的情况,客户端转发到一个自动回复的地址,导致另一个循环。



我不是这个东西的专家,但它看起来不像检测循环工作。我们当然可以提出一些启发式方法,但是一个全面的算法似乎不存在。



我一直在想的一个解决方案不涉及检测在所有相反,我们只是注意高级邮件发送活动(或由规则引起的高发送活动)的帐户,并暂时禁用这些帐户的电子邮件/规则,直到它们解决问题。但是,该解决方案必须在导致循环的帐户之间走行,而帐户只需要接收大量邮件并将其转发到其他位置。



我们还可以应用限制到所有帐户,并确保如果循环启动,它们不会吸收一吨的带宽。这不会阻止循环运行,直到邮箱填满。



有没有什么好的解决方案我缺少?

解决方案

首先,阅读 RFC 3834 。它给你关心的一些很好的见解。 (它涵盖自动回复,不转发,但仍然有用。)



一般来说,您需要在转发过程中向消息添加一个X标头,以指示消息已经传送到用户的邮箱一次。 (这是Sieve RFC在重定向中提到的 section。)如果 bob@example.com 发送了一条消息,并且有一个X标头提到 bob @ example .com ,你有一个循环。所以这样的东西:

  X-YourServer交付:bob@example.com 

您还要避免转发邮件传递通知,该通知应该有<> 作为SMTP邮件从。并且不要转发自动回复消息,该消息应该有一个自动提交的头,其值不是否。



查看RFC 3834,了解有关转发的更多想法,但上述内容应涵盖大多数情况。


Lets say you are designing a fancy email server with rules support (like conditional forwarding, etc.). The age-old problem of email loops stares you in the face:

1) Say you set up a rule that forwards all of your mail to another address. What if that address doesn't exist, and the postmaster at that domain sends messages back to you telling you this. Of course, your rule doesn't make a distinction for these messages and forwards them as well, creating a loop.

2) Another situation is two users, using this client client, set up forwarding rules to each other's address. All we need is a single starter message and they are going to spin off into a loop.

3) Or, how about an auto reply case, where the client forwards to an address that auto replies back, causing yet another loop.

I'm not an expert on this stuff, but it doesn't look like detecting the loops would work. We could certainly come up with some heuristics, but a catch-all algorithm doesn't seem to exist.

One solution I've been thinking about doesn't involve detection at all. Instead, we just watch accounts for high mail send activity (or high send activity caused by rules), and temporarily disable email / rules for these accounts until they correct the problem. However, this solution has to walk the line between accounts causing loops, and accounts that simply receive a lot of mail and are forwarding it somewhere else.

We could also apply throttling to all accounts, and make sure that if loops start, they don't suck up a ton of bandwidth. This won't stop loops from running until mailboxes fill up though.

Are there any good solutions I'm missing?

解决方案

First, start by reading RFC 3834. It gives some good insights into what you care about. (It covers autoresponders, not forwarding, but it's still useful.)

In general, you'll want to add an X-header to the message during forwarding to indicate that the message has been delivered to the user's mailbox once. (This is what the Sieve RFC mentions in its redirect section.) If a message comes in for bob@example.com and there's an X-header mentioning bob@example.com, you have a loop. So something like this:

X-YourServer-Delivered: bob@example.com

You'll also want to avoid forwarding message delivery notifications, which should have <> as the SMTP MAIL FROM. And don't forward autoresponder messages, which should have an Auto-Submitted header with a value other than "no".

Look over RFC 3834 for more ideas on what not to forward, but the above should cover most cases.

这篇关于电子邮件服务器设计:避免循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆