Simple Mail Transfer Protocol (English:, Abbreviation: SMTP)

Simple Mail Transfer Protocol

Simple Mail Transfer Protocol (English:, abbreviation: SMTP ) can be used to send and receive e-mail messages, but SMTP is usually used for sending e-mail messages, not receiving them.

internet kit
application layer
transport layer
network layer
link layer

SMTP is a relatively simple text - based protocol . By agreement, we specify that a message is sent to one or more recipients (in most cases confirmed to exist), and then the text of the message will be transmitted. We can test an SMTP server very simply through the telnet program. SMTP primarily uses TCP port 25. To determine an SMTP server for a given domain name, an MX record in DNS is used .

In the early 1980s, SMTP began to be widely used. At the time, it was intended only as a supplement to UUCP , which was better suited for handling mail between computers that were intermittently connected. On the contrary, SMTP does the best work of sending and receiving under the network of continuous connection.

Sendmail是最早使用SMTP的邮件传输代理之一。在2001年,至少有50个程序将SMTP实现为一个客户端(消息的发送者)或一个服务器(消息的接收者),包括了Philip Hazel的exim,IBM的Postfix, D. J. Bernstein的Qmail,以及Microsoft Exchange Server

由于这个协议开始時,是基于纯ASCII文本的,它在二进制文件上处理得并不好。例如MIME的标准被开发来编码二进制文件,以使其透過SMTP來傳輸。今天,大多数SMTP服务器都支持8位MIME扩展,它使二进制文件的传输,变得几乎和纯文本一样简单。

SMTP是一个“推送”协议,它不允许从远程服务器上接收消息。若要接收消息到客户端,邮件客户端必须使用POP3或IMAP。另一个SMTP服务器可以使用ETRN在SMTP上触发一个发送。

互联网

2005年Opte项目互联网一部分的路由路径

概况

治理

信息基础设施

服务

指南

  • 索引
  • 纲要
互联网主题

SMTP通信举例

在发送方(客户端)和接收方(服务器)间建立连接之后,会建立一个合法的SMTP会话,如下例。在下面的例子中,所有客户端发送的都以“C:”作为前缀,所有服务器发送的都以“S:”作为前缀。在多数计算机系统上,可以在发送的机器上使用telnet命令来建立连接,比如:

telnet www.example.com 25

它建立一个从发送的机器到主机www.example.com的SMTP连接。

S: 220 smtp.example.com ESMTP Postfix
C: HELO relay.example.com
S: 250 smtp.example.com, I am glad to meet you
C: MAIL FROM:<[email protected]>
S: 250 Ok
C: RCPT TO:<[email protected]>
S: 250 Ok
C: RCPT TO:<[email protected]>
S: 250 Ok
C: DATA
S: 354 End data with <CR><LF>.<CR><LF>
C: From: "Bob Example" <[email protected]>
C: To: Alice Example <[email protected]>
C: Cc: [email protected]
C: Date: Tue, 15 Jan 2008 16:02:43 -0500
C: Subject: Test message
C: 
C: Hello Alice.
C: This is a test message with 5 header fields and 4 lines in the message body.
C: Your friend,
C: Bob
C: .
S: 250 Ok: queued as 12345
C: QUIT
S: 221 Bye
{The server closes the connection}

虽然是可选的,但几乎所有的客户端都会使用EHLO问候消息(而不是上面所示的HELO)来询问服务器支持何种SMTP扩展,邮件的文本体(接着DATA)一般是典型的MIME格式。

SMTP安全和垃圾邮件

最初的SMTP的局限之一,在于它没有对发送方进行身份验证的机制。因此,后来定义了SMTP-AUTH扩展。

尽管有了身份认证机制,垃圾邮件仍然是一个主要的问题。但由于庞大的SMTP安装数量带来的网络效应,大刀阔斧地修改或完全替代SMTP被认为是不现实的。Internet Mail 2000就是一个替代SMTP的建议方案。

因此,出现了一些同SMTP工作的辅助协议。IRTF的反垃圾邮件研究小组正在研究一些建议方案,以提供简单、灵活、轻量级的、可升级的源端认证。最有可能被接受的建议方案是发件人策略框架协议。

提供SSL加密的SMTP協定被稱為SMTPS

Guess you like

Origin blog.csdn.net/weixin_40191861/article/details/131907263