我什么时候应该向 SMTP 服务器发送 QUIT?我应该坚持多久?

发布于 2024-08-25 18:40:29 字数 329 浏览 8 评论 0原文

我正在编写一个 smtp 发送器来发送大量不同的电子邮件(不是垃圾邮件)。由于有许多目标地址来自常见提供商,例如 hotmail.com/gmail.com。我想汇集 TCP 连接以便重用会话。这是一个好的做法吗?或者我应该断开连接并连接以发送不同的邮件?

由于订阅者数量较多,池化连接可能会保留很长时间(例如1小时),是否应该在某个时刻主动释放连接?

最后让我困惑的是目标 IP,因为我发现 hotmail.com 有很多 mx 服务器(至少 12 个)。如果我将大部分电子邮件仅发送到一台服务器或将它们分开并发送到所有服务器,会有什么不同吗?

很抱歉一次提出几个问题,非常感谢您的观点和回答。

I am programming a smtp sender to send large number of distinct emails (not spam). As there are many destination addresses which are from common provider like hotmail.com/gmail.com. I would like to pool the TCP connections in order to reuse the session. Is this a good practise? Or should I disconnect and connect to send distinct mails instead?

As the subscribers are in large amount, the pooled connection might be kept for a long time (e.g. 1 hour), should I actively release the connection at some point?

Last thing confused me is the destination IPs, as I find out that hotmail.com has a lot of mx servers(at least 12). Does it make any different if I send most of emails to only one of the server or separate them and send to all servers?

Sorry to ask several questions at a time, and do appreciate your view and answer.

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

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

发布评论

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

评论(2

撑一把青伞 2024-09-01 18:40:29

连接,向目标发送 X 封电子邮件,断开连接。恕我直言,X 应该在 16 到 64 左右——有些电子邮件服务器不喜欢一个连接中有太多的连接,否则会把你扔掉。

您应该/可以按目的地订购,这样您就不必将会话打开太长时间,并且您必须正确处理强制断开连接。

随意使用 MX 记录。无需将您的电子邮件拆分到多个目标服务器。

Connect, send X emails for target, disconnect. X should IMHO be somewhere around 16 to 64 - someemail servers dont like too many in one connection and will throw you out otherwise.

You should / can order by destination so you dont ahve to keep sessions open too long, and you MUST properly handle forced disconnects.

Use MX records as you please. There is no need to split your emails to multiple target servers.

违心° 2024-09-01 18:40:29

首先,恕我直言,在不使用的时间超过建立所述连接所需的时间时保持连接处于活动状态是不好的。您不仅让它保持活动状态而没有任何用处,因为您可能会阻止其他用户访问该服务。

连接到 SMTP 服务器非常容易,发送必要的项目并关闭连接。

如果我没记错的话,即使 Outlook 也会为其发送的每封邮件打开一个连接。

First IMHO keeping a connection alive when not in use for more than the time it requires to make the said connection is bad. Not only you're keeping it alive for no use, as you might be preventing another user access to the service.

Connecting to an SMTP server is easy enough to make, send the necessary items and close the connection.

If I'm not mistaken, even Outlook opens a connection for each mail it sends.

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