SMTP:服务器间通信

发布于 2024-08-08 12:57:37 字数 479 浏览 3 评论 0原文

据我所知,电子邮件发送过程如下所示:

  1. 消息从发件人的客户端发送到他的服务器(例如ma​​il.com)。
  2. ma​​il.com 服务器将邮件重定向到收件人服务器(例如 gmail.com)。
  3. 收件人的客户端连接到 gmail.com 并接收新邮件。

我对第二阶段感兴趣。 我认为服务器使用 SMTP 协议进行此协商。 gmail.com 服务器应该监听 25 端口以接收来自 ma​​il.com 和其他服务器的连接。

但当我尝试在端口 25 上连接 gmail.com(确切地说,Google 服务)时,服务器没有响应...

为什么?怎么了?

As I know the email message sending process looks like this:

  1. The message is sent from sender's client to his server (say mail.com).
  2. The mail.com server redirects the message to recipients server (say gmail.com).
  3. Recipient's client connects to gmail.com and recieves new messages.

I'm interested in stage 2.
I thought that the servers use SMTP protocol to make this negotiation. And gmail.com server should listen to 25 port to recieve a connection from mail.com and other servers.

But then I try to connect gmail.com (exactly, Google service) on port 25, the server is not responding...

Why? What's wrong?

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

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

发布评论

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

评论(2

鲜肉鲜肉永远不皱 2024-08-15 12:57:38

邮件服务器不重定向。

您必须使用 MX 记录来查找邮件服务器。您不能仅仅假设裸域名上会有一个。

但随后邮件服务器将接受或拒绝您的消息。在某些情况下,通常仅在非常亲密和信任的朋友之间,邮件服务器可能会将您的消息转发到另一个邮件服务器。

曾几何时,在 90 年代中期,几乎所有邮件服务器都会接受消息并转发它。许多人依赖这种行为,因为 IP 数据包只会传输 30 跳,而互联网的边缘相距超过 30 跳。例如,秘鲁和乌克兰无法通过 IP 数据包相互联系,但它们都可以将邮件发送到 aol.com 的服务器,并且该邮件服务器会将其转发到目的地。

最好不要使用电子邮件,除非您阅读了有关其工作原理的一些最新描述,或许还可以查看 maawg.org 上的白皮书。此外,许多域现在希望陌生人通过端口 587 提交电子邮件,并且需要进行身份验证。

Mail servers do not redirect.

You have to use MX records to find a mail server. You can't just assume that there will be one on the bare domain name.

But then the mail server will either accept or reject your message. In some cases, usually only between very close and trusted friends, the mail server might RELAY your message onward to another mail server.

At one time, in the mid 90's, just about any mail server would accept a message and relay it. Many people relied on this behavior because IP packets would only travel 30 hops, and the edges of the Internet were more than 30 hops apart. For instance, Peru and Ukraine could not contact each other with IP packets, but they could both send mail to a server at aol.com and that mail server would relay it on to its destination.

It is best not to play around with email unless you read some modern up-to-date descriptions of how it works, and perhaps check the white papers at maawg.org. Also, many domains now expect strangers to submit their email via port 587 and authentication is required.

許願樹丅啲祈禱 2024-08-15 12:57:37

您需要深入研究一下 MX 记录:过度简化的 DNSMX 记录。 SMTP 网关使用 MX 记录在彼此之间路由电子邮件。因此,对于域 X,SMTP 网关可能是 mail.X :换句话说,对于 gmail.com,邮件网关可能是 mail.gmail.com (示例)。

You need to delve into MX records a bit: Oversimplified DNS and MX record. The SMTP gateways use the MX records to route emails between each other. So, for a domain X the SMTP gateway might be mail.X : in other words, for gmail.com the mail gateway might be mail.gmail.com (example).

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