Information about Simple Mail Transfer Protocol

Simple Mail Transfer Protocol (SMTP) is the de facto standard for e-mail transmissions across the Internet. Formally SMTP is defined in RFC 821 (STD 10) as amended by RFC 1123 (STD 3) chapter 5. The protocol used today is also known as ESMTP and defined in RFC 2821.

Description

SMTP is a relatively simple, text-based protocol, in which one or more recipients of a message are specified (and in most cases verified to exist) and then the message text is transferred. It is a client-server protocol, whereby a client transmits an email message to a server. Either an end-user's email client, a.k.a. MUA (Mail User Agent), or a relaying server's MTA (Mail Transfer Agents) can act as an SMTP client.

An email client knows the outgoing mail SMTP server from its configuration. A relaying server typically determines which SMTP server to connect to by looking up the MX (Mail eXchange) DNS record for each recipient's domain name (the part of the email address to the right of the at (@) sign). Conformant MTAs (not all) fall back to a simple A record in the case of no MX. Some current mail transfer agents will also use SRV records, a more general form of MX, though these are not widely adopted. (Relaying servers can also be configured to use a smart host.)

The SMTP client initiates a TCP connection to server's port 25 (unless overridden by configuration). It is quite easy to test an SMTP server using the telnet program (see below).

SMTP is a "push" protocol that does not allow one to "pull" messages from a remote server on demand. To do this a mail client must use POP3 or IMAP. Another SMTP server can trigger a delivery in SMTP using ETRN.

History

Forms of one-to-one electronic messaging were used in the 1960s. People communicated with one another using systems developed for a particular mainframe computer. As more computers began to be interconnected with others, especially in the US Government's ARPANET, standards were developed to allow users using different systems to be able to email one another. SMTP grew out of these standards developed during the 1970s.

SMTP can trace its roots to the Mail Box Protocol (ca. 1971), FTP Mail (ca. 1973),[1] and Mail Protocol.[2] The work continued throughout the 1970s, until the ARPANET converted into the modern Internet around 1980. Jon Postel then proposed a Mail Transfer Protocol in 1980 that began to remove the mail's reliance on FTP.[3] SMTP was published as RFC 821 in August 1982, also by Jonathan Postel.[1]

The SMTP standard was developed around the same time the Usenet was, a one-to-many communication network with some similarities.

SMTP became widely used in the early 1980s. At the time, it was a complement to UUCP (Unix to Unix CoPy) mail, which was better suited to handle e-mail transfers between machines that were intermittently connected. SMTP, on the other hand, works best when both the sending and receiving machines are connected to the network all the time. Both use a store and forward mechanism and are examples of push technology. Usenet's newsgroups are still propagated with UUCP between servers[4], but UUCP mail has virtually disappeared[5] along with the "bang paths" it used as message routing headers.

The article about sender rewriting contains technical background info about the early SMTP history and source routing before RFC 1123.

Sendmail was one of the first (if not the first) mail transfer agents to implement SMTP. Some other popular SMTP server programs include Postfix, qmail, Novell GroupWise, Exim, Novell NetMail, Microsoft Exchange Server and Sun Java System Messaging Server. As of 2001 there were at least 50 programs that implemented SMTP either as clients (senders of messages) or as servers (receivers of messages).

Message Submission (RFC 2576) and SMTP-AUTH (RFC 2554) were introduced in 1998 and 1999, both describing new trends in email delivery. Originally, SMTP servers were typically internal to an organization, receiving mail for the organization from the outside, and relaying messages from the organization to the outside. But as time went on, SMTP servers (Mail transfer agents), in practice, were expanding their roles to become Mail submission agents for Mail user agents, some of which were now relaying mail from the outside of an organization. (e.g. A company executive wishes to send email while on a trip using the corporate SMTP server.) This issue, a consequence of the rapid expansion and popularity of the World Wide Web, meant that the SMTP protocol had to include specific rules and methods for relaying mail and authenticating users to prevent abuses such as unsolicited email (spam) relaying.

Since this protocol started out as purely ASCII text-based, it did not deal well with binary files. Standards such as Multipurpose Internet Mail Extensions (MIME) were developed to encode binary files for transfer through SMTP. MTAs developed after Sendmail also tended to be implemented 8-bit-clean, so that the alternate "just send eight" strategy could be used to transmit arbitrary data via SMTP. Non-8-bit-clean MTAs today tend to support the 8BITMIME extension, permitting binary files to be transmitted almost as easily as plain text.

Developers

Many people edited or contributed to the core SMTP specifications, among them Jon Postel, Eric Allman, Dave Crocker, Ned Freed, Randall Gellens, John Klensin, and Keith Moore.

Outgoing mail SMTP server

An email client requires the name or the IP address of an SMTP server as part of its configuration. The server will deliver messages on behalf of the user. This setting allows for various policies and network designs. End users connected to the Internet can use the services of an e-mail provider that is not necessarily the same as their connection provider. Network topology, or the location of a client within a network or outside of a network, is no longer a limiting factor for email submission or delivery. Modern SMTP servers typically use a client's credentials (authentication) rather than a client's location (IP address), to determine whether it is eligible to relay email.

Another choice is whether to use TCP port 25 (SMTP) or port 587 (Submission), as established by RFC 2476, for relaying outbound mail to a mail server. Many servers support both. Some servers still support port 465 for legacy secure SMTP, but it is preferable to use encryption on standard ports according to RFC 2487. Some servers are set up to reject all relaying on port 25, but valid users authenticating on port 587 are allowed to relay mail to any valid address. A server that relays all email for all destinations for all clients connecting to port 25 is known as an open relay and is now generally considered a bad practice worthy of blacklisting.

Sample communications

After establishing a connection between the sender (the client) and the receiver (the server), the following is a legal SMTP session. In the following conversation, everything sent by the client is prefaced with C: and everything sent by the server is prefaced with S:. On most computer systems, a connection can be established using the telnet command on the client machine, for example.

telnet www.example.com 25


which opens a TCP connection from the sending machine to the MTA listening on port 25 on host www.example.com.

S: 220 www.example.com ESMTP Postfix C: HELO mydomain.com S: 250 Hello mydomain.com C: MAIL FROM:<sender@mydomain.com> S: 250 Ok C: RCPT TO:<friend@example.com> S: 250 Ok C: DATA S: 354 End data with <cr><lf>.<cr><lf> C: Subject: test message C: From: sender@mydomain.com C: To: friend@example.com C: C: Hello, C: This is a test. C: Goodbye. C: . S: 250 Ok: queued as 12345 C: QUIT S: 221 Bye

Please note that the data the client sends in the HELO and MAIL FROM commands can be retrieved in additional headers that the server adds to the message: Received and Return-Path respectively.

Although optional and not shown above, nearly all clients ask the server which SMTP extensions the server supports, by using the EHLO greeting to invoke Extended SMTP (ESMTP). These clients use HELO only if the server does not respond to EHLO.

Contemporary clients will use the ESMTP extension keyword SIZE to inquire of the server the maximum message size that will be accepted. Older clients and servers will try to transfer huge messages that will be rejected after wasting the network resources, including a lot of connect time to dialup ISPs that are paid by the minute.

For the edit planning of giant files or sending with older clients, users can manually determine in advance the maximum size accepted by ESMTP servers. The user telnets as above, but substitutes "EHLO mydomain.com" for the HELO command line.

S: 220-serverdomain.com ESMTP {postfix version and date} S: 220 NO UCE. {etc., terms of service} C: EHLO mydomain.com S: 250-serverdomain.com Hello mydomain.com [127.0.0.1] S: 250-SIZE 14680064 S: 250-PIPELINING S: 250 HELP

This serverdomain.com declares that it will accept a fixed maximum message size no larger than 14,680,064 octets (8-bit bytes). Depending on the server's actual resource usage, it may be currently unable to accept a message this large.

In the simplest case, an ESMTP server will declare a maximum SIZE with only the EHLO user interaction. If no number appears after the SIZE keyword, or if the current message limit must be exactly determined, the user can further interact by simulating the ESMTP header of a message with an estimated size. See External Link RFC 1870 below.

Security and spamming



One of the limitations of the original SMTP is that it has no facility for authentication of senders. Therefore the SMTP-AUTH extension was defined. However, the impracticalities of widespread SMTP-AUTH implementation and management means that E-mail spamming is not and cannot be addressed by it.

Modifying SMTP extensively, or replacing it completely, is not believed to be practical, due to the network effects of the huge installed base of SMTP. Internet Mail 2000 is one such proposal for replacement.

Spam is enabled by several factors, including vendors implementing broken MTAs (that do not adhere to standards, and therefore make it difficult for other MTAs to enforce standards), security vulnerabilities within the operating system (often exacerbated by always-on broadband connections) that allow spammers to remotely control end-user PCs and cause them to send spam, and a regrettable lack of "intelligence" in many MTAs.

There are a number of proposals for sideband protocols that will assist SMTP operation. The Anti-Spam Research Group (ASRG) of the Internet Research Task Force (IRTF) is working on a number of E-mail authentication and other proposals for providing simple source authentication that is flexible, lightweight, and scalable. Recent Internet Engineering Task Force (IETF) activities include MARID (2004) leading to two approved IETF experiments in 2005, and DomainKeys Identified Mail in 2006.

Other Protocols for Email

Email is "handed off" (pushed) from a client (MUA) to a mail server (MSA), usually using Simple Mail Transfer Protocol or IMAP. From there, the MSA delivers the mail to a MTA, usually running on the same machine. The MTA looks up the destination(s)'s MX records with a DNS lookup, and begins to relay (push) the message to the server on record via TCP port 25 and SMTP. Once the receiving MTA accepts the incoming message, it is delivered via a mail delivery agent (MDA) to a server which is designated for local mail delivery. The MDA either delivers the mail directly to storage, or forwards it over a network using either SMTP or LMTP, a derivative of SMTP designed for this purpose. Once delivered to the local mail server, the mail is stored for batch retrieval by authenticated mail clients (MUAs). Generally speaking, mail retrieval (pull) is performed using either a type of online folders (e.g. IMAP 4, a protocol that both delivers and organizes mail) or the older single repository format (e.g. POP3, the Post Office Protocol). Webmail clients may use either method, but the retrieval protocol is often not a formal standard. Some local mail servers and MUAs are capable of either push or pull mail retrieval.

References

1. ^ RFC 469 - Network Mail Meeting Summary
2. ^ RFC 524 - A Proposed Mail Protocol
3. ^ RFC 772 - Mail Transfer Protocol
4. ^ [2]
5. ^ [3]

Related Requests For Comments (RFCs)

  • RFC 3700 Internet Official Protocol Standards (STD 1). As of 2004, this RFC Designates RFC 821 and RFC 822 as the SMTP and MAIL standards, respectively, with RFC 2821 and RFC 2822 as proposed standards. However, in practice the newer "proposed standards" are said to "obsolete" the original.
  • RFC 821 (official standard) Simple Mail Transfer Protocol
  • RFC 822 (official standard) Standard for the Format of ARPA Internet Text Messages
  • RFC 1123 Requirements for Internet Hosts -- Application and Support (STD 3)
  • RFC 1870 SMTP Service Extension for Message Size Declaration (оbsoletes: RFC 1653)
  • RFC 2505 Anti-Spam Recommendations for SMTP MTAs (BCP 30)
  • RFC 2554 SMTP Service Extension for Authentication
  • RFC 2821 The Simple Mail Transfer Protocol (obsoletes RFC 821 aka STD 10, RFC 974, and RFC 1869)
  • RFC 2822 Internet Message Format (obsoletes RFC 822 aka STD 11)
  • RFC 2920 SMTP Service Extension for Command Pipelining (STD 60)
  • RFC 3030 SMTP Service Extensions for Transmission of Large and Binary MIME Messages
  • RFC 3207 SMTP Service Extension for Secure SMTP over Transport Layer Security (obsoletes RFC 2487)
  • RFC 3461 SMTP Service Extension for Delivery Status Notifications (obsoletes RFC 1891)
  • RFC 3462 The Multipart/Report Content Type for the Reporting of Mail System Administrative Messages (obsoletes RFC 1892)
  • RFC 3463 Enhanced Status Codes for SMTP (obsoletes RFC 1893 )
  • RFC 3464 An Extensible Message Format for Delivery Status Notifications (obsoletes RFC 1894)
  • RFC 3552 Guidelines for Writing RFC Text on Security Considerations (contains SMTP example)
  • RFC 3834 Recommendations for Automatic Responses to Electronic Mail
  • RFC 4409 Message Submission for Mail (obsoletes RFC 2476)

See also

External links

cr.yp.to links

Other links

De facto is a Latin expression that means "in fact" or "in practice" but not spelled out by law. It is commonly used in contrast to de jure (which means "by law") when referring to matters of law, governance, or technique (such as standards), that are found in the
..... Click the link for more information.
E-mail (short for electronic mail; often also abbreviated as e-mail, email or simply mail) is a store and forward method of composing, sending, storing, and receiving messages over electronic communication systems.
..... Click the link for more information.
Internet is a worldwide, publicly accessible series of interconnected computer networks that transmit data by packet switching using the standard Internet Protocol (IP). It is a "network of networks" that consists of millions of smaller domestic, academic, business, and government
..... Click the link for more information.
Extended SMTP (ESMTP), sometimes referred to as Enhanced SMTP, is a definition of protocol extensions to the Simple Mail Transfer Protocol standard. The extension format was defined in RFC 1869 in 1995.
..... Click the link for more information.
Usually used in reference to a computer application, especially a computer game, a text-based application is one whose primary input and output are based on text rather than graphics.
..... Click the link for more information.
Client-server is a computing architecture which separates a client from a server, and is almost always implemented over a computer network. Each client or server connected to a network can also be referred to as a node.
..... Click the link for more information.
A client is an application or system that accesses a (remote) service on another computer system known as a server by way of a network. The term was first applied to devices that were not capable of running their own stand-alone programs, but could interact with remote computers
..... Click the link for more information.
Server Computer

The inside/front of a server computer

Connects to:
  • Internet via one of

..... Click the link for more information.
An e-mail client is a frontend computer program used to manage e-mail. Large all-in-one e-mail clients such as the open source Mozilla Thunderbird and Microsoft Outlook today combine the operations of an MSA, MDA, MRA and MUA in one application.
..... Click the link for more information.
A mail transfer agent or MTA (also called a mail transport agent, message transfer agent, mail server, SMTPD (short for SMTP daemon), or a mail exchanger
..... Click the link for more information.
An MX record or Mail exchanger record is a type of resource record in the Domain Name System (DNS) specifying how Internet e-mail should be routed. MX records point to the servers that should receive an e-mail, and their priority relative to each other.
..... Click the link for more information.
On the Internet, the Domain Name System (DNS) associates various sorts of information with so-called domain names; most importantly, it serves as the "phone book" for the Internet by translating human-readable computer hostnames, e.g. en.wikipedia.
..... Click the link for more information.
domain name has multiple related meanings:
  • A name that identifies a computer or computers on the internet. These names appear as a component of a Web site's URL, e.g. wikipedia.org. This type of domain name is also called a hostname.

..... Click the link for more information.
e-mail address identifies a location to which e-mail messages can be delivered. The term "e-mail address" is also used as the formal pre-registered authoritative electronic mailing delivery site for an individual (example: an attorney's e-mail address registered for delivery of
..... Click the link for more information.
An SRV record or Service record is a category of data in the Internet Domain Name System specifying information on available services. It is defined in RFC 2782. Newer internet protocols such as SIP and XMPP often require SRV support from clients.
..... Click the link for more information.
An MX record or Mail exchanger record is a type of resource record in the Domain Name System (DNS) specifying how Internet e-mail should be routed. MX records point to the servers that should receive an e-mail, and their priority relative to each other.
..... Click the link for more information.
A smart host is a type of mail relay server which allows an SMTP server to route e-mail to an intermediate mail server rather than directly to the recipient’s server.
..... Click the link for more information.
The Transmission Control Protocol (TCP) is one of the core protocols of the Internet protocol suite. TCP provides reliable, in-order delivery of a stream of bytes, making it suitable for applications like file transfer and e-mail.
..... Click the link for more information.
port is a special number present in the header of a data packet. Ports are typically used to map data to a particular process running on a computer.

Ports can be readily explained with an analogy: think of IP addresses as the street address of an apartment building, and the
..... Click the link for more information.


TELNET (TELecommunication NETwork) is a network protocol used on the Internet or local area network (LAN) connections.
..... Click the link for more information.
An e-mail client is a frontend computer program used to manage e-mail. Large all-in-one e-mail clients such as the open source Mozilla Thunderbird and Microsoft Outlook today combine the operations of an MSA, MDA, MRA and MUA in one application.
..... Click the link for more information.
In computing, local e-mail clients use the Post Office Protocol version 3 (POP3), an application-layer Internet standard protocol, to retrieve e-mail from a remote server over a TCP/IP connection.
..... Click the link for more information.
The Internet Message Access Protocol (commonly known as IMAP or IMAP4, and previously called Internet Mail Access Protocol, Interactive Mail Access Protocol (RFC 1064), and Interim Mail Access Protocol[1]
..... Click the link for more information.
ETRN (Extended Turn) is an extension to the SMTP e-mail protocol. ETRN is defined in RFC 1985. It enables a mail server to request a second mail server to forward outstanding mail messages to it.
..... Click the link for more information.
Electronic messaging may refer to:

One to One communication
  • Instant message (on a computer network)
  • Personal message (on a computer network)
  • Text message (on a cellular phone network)
  • SMTP (on a computer network)

..... Click the link for more information.
Centuries: 19th century - 20th century - 21st century

1930s 1940s 1950s - 1960s - 1970s 1980s 1990s
1960 1961 1962 1963 1964
1965 1966 1967 1968 1969

- -
-

Their 1960s decade refers to the years from 1960 to 1969, inclusive.
..... Click the link for more information.
Mainframe may refer to one of the following:
  • Mainframe computer, large data processing systems
  • Mainframe Entertainment, a Canadian computer animation and design company.
  • Mainframe is the city that the CGI cartoon ReBoot takes place in.

..... Click the link for more information.
The ARPANET, developed by DARPA of the United States Department of Defense, was the world's first operational packet switching network, and the predecessor of the global Internet.
..... Click the link for more information.
E-mail (short for electronic mail; often also abbreviated as e-mail, email or simply mail) is a store and forward method of composing, sending, storing, and receiving messages over electronic communication systems.
..... Click the link for more information.
Centuries: 19th century - 20th century - 21st century

1940s 1950s 1960s - 1970s - 1980s 1990s 2000s
1970 1971 1972 1973 1974
1975 1976 1977 1978 1979

- -
- The 1970s decade refers to the years from 1970 to 1979, also called
..... Click the link for more information.


This article is copied from an article on Wikipedia.org - the free encyclopedia created and edited by online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of the wikipedia encyclopedia articles provide accurate and timely information please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.
Herod_Archelaus


page counter