网络应用之——电子邮件

因特网中的电子邮件是如何发送的?


自从因特网诞生,电子邮件就开始流行。

在这一节,我们将讨论因特网中电子邮件应用的核心应用层协议。
在我们深入研究这些协议之前,让我们站在一个很高的角度看一下因特网邮件系统和它的关键组成部分。

因特网邮件系统

在这里插入图片描述
我们可以从这个图中看到,因特网中的电子邮件应用有3个主要的部分

  • user agents
    举个例子,微软的outlook客户端
  • mail servers
  • Simple Mail Transfer Protocol(SMTP)

这三个组件到底是什么东西,完全没有概念。

我们下面举个例子,你就明白了。
假设Alice坐在电脑前正在通过outlook给bob发电子邮件。

user agent

user agents 允许用户读取, 回复,转发,保存,创建messages.
例如: 微软的outlook和苹果的Mail

苹果的Mail就是下面这个东东

在这里插入图片描述

当Alice写好消息之后:
在这里插入图片描述
然后Alice点击发送,Alice的apple mail就把消息发送给了Alice的mail server, where the message is placed in the mail server’s outgoing message queue. When Bob wants to read a message, his user agent retrieves the message from Bob’s mail box in Bob’s mail server.

Mail Server

Mail servers form the core of the e-mail infrastructure. 每一个收信者has a mailbox located in one of the mail servers.

我想问,所以有bob’s mail server这一说吗?bob’s mail server可以存放其他人的mailbox吗?

Bob’s mailbox manages and maintains the messages that have been sent to him.

A typical message starts its journey in the sender’s user agent, travels to the sender’s mail server, and travels to the receipt’s mail server, where it is deposited in the recipient’s mailbox.

所以我想问Bob’s mail server可以放其他人的mail box吗?

当Bob想要access the messages in Bob’s mailbox, the mail server containing his mailbox authenticates Bob ( with usernames and passwords).

Bob: 不是随便一个人都可以access我的邮箱的。 首先你要报我的名号,然后你还要报上我的密码。呵呵,你不是我,你怎么可能知道我的密码是多少。

但是Alice的服务器必须要处理failures in Bob’s mail server. 如果Alice’s server cannot deliver mail to Bob’s server, Alice’s server holds the message in a message queue and attempts to transfer the message later.

Alice’s server: 这个时候Bob’s server的女朋友和他分手了,他油盐不进,我还是过一会儿再给他喂油吧。

Reattempts are often done every 30 minutes or so.

至少过个半个小时吧,没有半个小时,这家伙消不了气的。

如果几天之后还是没有成功,Alice的服务器就会removes the message and notifies the sender(Alice) with an e-mail message.

我想知道这个notify消息是如何发送给Alice的?

SMTP

SMTP是因特网电子邮件中主要的应用层协议。SMTP uses the reliable data transfer service of TCP to transfer mail from the sender’s mail server to the receipt’s mail server.

像大多数应用一样,SMTP有两端, a client side and a server side.

我突然有个疑问,电子邮件使用的是什么网络应用体系结构?

  • client side, which executes on the sender’s mail server
  • server side, which executes on the recipient’s mail server

Both the client and server sides run on every mail server.

这句话说的很抽象

When a mail server sends mail to other mail servers, it acts as an SMTP client.
When a mail server receives mail from other mail servers, it acts as an SMTP server.

猜你喜欢

转载自blog.csdn.net/ChenglinBen/article/details/91401164