SMTP(接收电子邮件)如何工作?

我很难理解SMTP是如何工作的。

我已经读过

  • 邮件提交邮件
  • 互联网邮件架构
  • 互联网信息格式
  • 简单的邮件传输协议

我知道SMTP服务器在端口25上侦听,并与客户端交换命令。

让我们假设我拥有域mydomain.com ,并有我自己实施的SMTP服务器运行。

有人想给我发电子邮件(例如[email protected] )。

在我的服务器上,我会看到像这样的stream量:

Server Response: 220 mydomain.com SMTP Client Sending : HELO domain.com Server Response: 250 Hello domain.com Client Sending : MAIL FROM: <[email protected]> Server Response: 250 Ok Client Sending : RCPT TO: <[email protected]> Server Response: 250 Ok Client Sending : DATA Server Response: 354 End data with <CR><LF>.<CR><LF> Client Sending : Subject: Example Message Client Sending : From: [email protected] Client Sending : To: [email protected] Client Sending : Client Sending : Yo, Client Sending : Client Sending : Sending a test message. Client Sending : Client Sending : Later, Client Sending : Carl Client Sending : . Server Response: 250 Ok: queued as 45334 Client Sending : QUIT Server Response: 221 Bye 

所以我的服务器现在的字节数组包含内存中的消息。

题:

我现在应该怎么做呢? (假设收件人在我的机器上 – 不需要中继)

要将邮件传递到用户邮箱,您需要邮件传递代理或MDA。

邮件传送代理或邮件传送代理(MDA)是负责将电子邮件传送到本地收件人的邮箱的计算机软件组件。 也称为LDA,或本地交付代理。 在Internet邮件体系结构中,通过处理来自邮件传输代理的邮件并将邮件存储到收件人的环境(通常是邮箱)的过程来实现本地邮件传递。

在这里阅读更多信息: https : //en.wikipedia.org/wiki/Mail_delivery_agent