本文介绍了什么是MTA呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此让我有想法,现在我意识到我不了解MTA内部的任何内容。

This question got me thinking, and I now realize that I don't know anything about the internals of MTAs.

MTA究竟是做什么的? SMTP协议之后的一切似乎对我来说都是黑魔法。假设我想编写一个简单的MTA(或),只是用于发送电子邮件,什么我需要学习/做吗?

What exactly does an MTA do? Everything after the SMTP protocol seems like dark magic to me. Let's say that I wanted to code a minimalistic MTA (or MDA) just for sending emails, what would I need to learn/do?

修改:我实际上并没有计划编写MTA,我只是想了解它

Edit: I don't actually plan on writing an MTA, I just want to understand how it works internally.

推荐答案

---以某种方式注意到您谈论过可能撰写MTA的编辑---

--- edit after somehow noticing you talked about possibly writing a MTA ---

要编写MTA,您需要打开一个服务器套接字。当有人连接时,您需要根据SMTP协议发送和接收该套接字上的文本(ascii)数据。 SMTP非常聊天,所以您可以期待几轮通信。

To write a MTA, you need to open a server socket. When someone connects, you need to send and receive text (ascii) data on that socket in compliance with the SMTP protocol. SMTP is very chatty, so you can expect a few rounds of communication.

初始通信通常会告诉您SMTP是否受支持或支持ESMTP。第二(可选)通信是确定安全/加密/功能支持。最终,客户端将要求向特定地址/地址集发送消息。完成后,服务器将指示已准备好获取电子邮件的正文。当消息的正文(以及它的选择性附件)全部被传输时,MTA会告诉你收到的消息是否正确。在这个时间点,MTA将作为通过DNS MX记录发现的其他MTA的客户端,使您的电子邮件更接近目的地MTA,将其复制到某人的收件箱。

The initial round of communication typically tells you whether SMTP is supported or ESMTP is supported. The second (optional) round of communication is to determine security / encryption / feature support. Eventually the "client" side will ask to send a message to a particular address / set of addresses. When done, the server will indicate that it's ready to get the body of the email message. When the body of the message (and it's optinal attachments) have all been transmitted, the MTA will tell you it received the message fine. At that point in time, the MTA will act as a client to other MTAs discovered via DNS MX records to get your email closer to it's destination MTA which will copy it into someone's inbox.

所以需要一个MTA,因为客户端的邮件传递等同于将一个实际的信件交给邮局。邮局负责邮局间路由(与MTA到MTA传输相同)。目的地邮局然后负责将信件传送到邮局邮箱或家庭住址(与计算机收件箱相同)。

So an MTA is needed because mail delivery on the client side is the equivalent to handing a physical letter to a post office. Post offices are responsible for inter-postoffice routing (which parallels to MTA-to-MTA transmission). The destination Post office is then responsible for delivery of the letter to the post office box or home address (which parallels one's computer inbox).

他们不叫它e - 邮件无关。

They don't call it e-mail for nothing.

---原始帖子跟随---
MTA将接受邮件,看是否它可以转发或交付它,如果可以转发或交付回应,然后转发或交付它,如果它表示可以。

--- original post follows ---A MTA will accept a mail message, see if it can forward or deliver it, respond if it can be forwarded or delivered, and then forward or deliver it if it indicated it could.

消息如何更接近它的最终目的地通常与DNS有关。 DNS中的MX(邮件交换)记录表示对特定电子邮件域名负责(或至少更接近负责的服务器)的服务器。无法完全了解邮件如何更接近目的地,而无需了解DNS的工作原理。

How the message gets closer to it's final destination usually has a bit to do with DNS. MX (mail exchange) records in DNS indicate servers which are responsible (or at least closer to the responsible server) for particular email domain names. It is not possible to fully understand how a mail message gets closer to it's destination without understanding how DNS works.

MTA通常会查看传送地址,也可以配置成为电子邮件地址的邮件域的终点,或者知道服务器XYZ离电子邮件地址的邮件域更近一点。如果它是一个端点,它将把消息从电线复制到某人的收件箱。如果是中继,它会将消息转发到下一个MTA。

A MTA typically looks at the delivery address, and either is configured to be the "end point" of the email address's mail domain, or knows that server XYZ is one hop closer to the email address's mail domain. If it's an endpoint, it will copy the message from the wire into someone's inbox. If it's relaying it will "forward" the message to the next MTA.

这篇关于什么是MTA呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 18:18