Provided by Colasoft Co., Ltd.

SMTP ( Simple Mail Transfer Protocol )

Home > Protocols > SMTP Update: 2005-11-10 16:24:14    I have words to say about this protocol
On this page
SUMMARY
Protocol : Simple Mail Transfer Protocol
Protocol suite : TCP/IP
Layer : Application Layer
Type : Message transfer protocol
Ports : 25 (TCP)
366 (TCP) ODMR, On-Demand Mail Relay
Related protocols : LMTP
MIME subtype : application/batch-SMTP
Working groups : Msgtrk, Message Tracking Protocol
DESCRIPTION
SMTP (Simple Mail Transfer Protocol) is a TCP/IP protocol used in sending and receiving e-mail. However, since it is limited in its ability to queue messages at the receiving end, it is usually used with one of two other protocols, POP3 or IMAP, that let the user save messages in a server mailbox and download them periodically from the server. In other words, users typically use a program that uses SMTP for sending e-mail and either POP3 or IMAP for receiving e-mail. On Unix-based systems, sendmail is the most widely-used SMTP server for e-mail. A commercial package, Sendmail, includes a POP3 server. Microsoft Exchange includes an SMTP server and can also be set up to include POP3 support.

SMTP usually is implemented to operate over Internet port 25. An alternative to SMTP that is widely used in Europe is X.400. Many mail servers now support Extended Simple Mail Transfer Protocol (ESMTP), which allows multimedia files to be delivered as e-mail.


SMTP Commands
CommandDescription
ATRNAuthenticated TURN.
AUTHAuthentication.
BDATBinary data.
DATAData. Consider the lines following the command to be e-mail from the sender.
EHLOExtended Hello.
ETRN
EXPNExpand. Ask the receiver to confirm that a mailing list has been identified.
HELOIdentify the SMTP sender to the SMTP receiver.
HELPHelp. Ask the receiver to send helpful information to the sender.
MAILStart an e-mail transaction to deliver the e-mail to one or more recipients.
NOOPNo operation. Ask the receiver to send a valid reply (but specify no other action).
QUITQuit. Ask the receiver to send a valid reply, and then close the transmission channel.
RCPTRecipient. Identify an individual recipient of e-mail.
RSETReset. End the current e-mail transaction.
SAMLSend and mail. Deliver e-mail to one or more work stations and recipients if the user is not active.
SENDSend. Deliver e-mail to one or more work stations.
SOMLSend or mail. Deliver e-mail to one or more work stations or recipients if the user is not active.
STARTTLS
TURNTurn. Ask the receiver to send a valid reply and then become the SMTP sender, or else ask the receiver to send a refusal reply and remain the SMTP receiver.
VRFYVerify. Ask the receiver to confirm that a user has been identified.



SMTP Replies
CodeDescription
211System status, or system help reply.
214Help message.
220Domain service ready. Ready to start TLS.
221Domain service closing transmission channel.
250OK, queuing for node node started. Requested mail action okay, completed.
251OK, no messages waiting for node node. User not local, will forward to forwardpath.
252OK, pending messages for node node started. Cannot VRFY user (e.g., info is not local), but will take message for this user and attempt delivery.
253OK, messages pending messages for node node started.
354Start mail input; end with..
355Octet-offset is the transaction offset.
421Domain service not available, closing transmission channel.
432A password transition is needed.
450Requested mail action not taken: mailbox unavailable. ATRN request refused.
451Requested action aborted: local error in processing. Unable to process ATRN request now
452Requested action not taken: insufficient system storage.
453You have no mail.
454TLS not available due to temporary reason. Encryption required for requested authentication mechanism.
458Unable to queue messages for node node.
459Node node not allowed: reason.
500Command not recognized: command. Syntax error.
501Syntax error, no parameters allowed.
502Command not implemented.
503Bad sequence of commands.
504Command parameter not implemented.
521Machine does not accept mail.
530Must issue a STARTTLS command first. Encryption required for requested authentication mechanism.
534Authentication mechanism is too weak.
538Encryption required for requested authentication mechanism.
550Requested action not taken: mailbox unavailable.
551User not local; please try forwardpath.
552Requested mail action aborted: exceeded storage allocation.
553Requested action not taken: mailbox name not allowed.
554Transaction failed.



Collected Status Codes
First Digit
2.X.XSuccess
4.X.XPersistent Transient Failure
5.X.XPermanent Failure
Second and Third Digits
X.1.0Other address status
X.1.1Bad destination mailbox address
X.1.2Bad destination system address
X.1.3Bad destination mailbox address syntax
X.1.4Destination mailbox address ambiguous
X.1.5Destination mailbox address valid
X.1.6Mailbox has moved
X.1.7Bad sender"s mailbox address syntax
X.1.8Bad sender"s system address
X.2.0Other or undefined mailbox status
X.2.1Mailbox disabled, not accepting messages
X.2.2Mailbox full
X.2.3Message length exceeds administrative limit
X.2.4Mailing list expansion problem
X.3.0Other or undefined mail system status
X.3.1Mail system full
X.3.2System not accepting network messages
X.3.3System not capable of selected features
X.3.4Message too big for system
X.4.0Other or undefined network or routing status
X.4.1No answer from host
X.4.2Bad connection
X.4.3Routing server failure
X.4.4Unable to route
X.4.5Network congestion
X.4.6Routing loop detected
X.4.7Delivery time expired
X.5.0Other or undefined protocol status
X.5.1Invalid command
X.5.2Syntax error
X.5.3Too many recipients

Top of Page

EXAMPLES
Example 1


This SMTP example shows mail sent by Smith at host Alpha.ARPA, to Jones, Green, and
Brown at host Beta.ARPA. Here we assume that host Alpha contacts host Beta directly.

S: MAIL FROM:
R: 250 OK

S: RCPT TO:
R: 250 OK

S: RCPT TO:
R: 550 No such user here

S: RCPT TO:
R: 250 OK

S: DATA
R: 354 Start mail input; end with .
S: Blah blah blah...
S: ...etc. etc. etc.
S: .
R: 250 OK

The mail has now been accepted for Jones and Brown. Green did not have a mailbox at
host Beta.
Example 2: Forwarding


Either
S: RCPT TO:
R: 251 User not local; will forward to

Or
S: RCPT TO:
R: 551 User not local; please try

Example 3: Verifying a User Name


Either
S: VRFY Smith
R: 250 Fred Smith

Or
S: VRFY Smith
R: 251 User not local; will forward to

Or
S: VRFY Jones
R: 550 String does not match anything.

Or
S: VRFY Jones
R: 551 User not local; please try

Or
S: VRFY Gourzenkyinplatz
R: 553 User ambiguous.

The case of expanding a mailbox list requires a multiline reply as shown in example 4.

Example 4: Expanding a Mailing List


Either
S: EXPN Example-People
R: 250-Jon Postel
R: 250-Fred Fonebone
R: 250-Sam Q. Smith
R: 250-Quincy Smith <@USC-ISIF.ARPA:Q-Smith@ISI-VAXA.ARPA>
R: 250-
R: 250

Or
S: EXPN Executive-Washroom-List
R: 550 Access Denied to You.

Example 5: Connection Opening


R: 220 BBN-UNIX.ARPA Simple Mail Transfer Service Ready
S: HELO USC-ISIF.ARPA
R: 250 BBN-UNIX.ARPA

Example 6: Undeliverable Mail Notification Message


S: MAIL FROM:<>
R: 250 ok
S: RCPT TO:<@HOSTX.ARPA:JOE@HOSTW.ARPA>
R: 250 ok
S: DATA
R: 354 send the mail data, end with .
S: Date: 23 Oct 81 11:22:33
S: From: SMTP@HOSTY.ARPA
S: To: JOE@HOSTW.ARPA
S: Subject: Mail System Problem
S:
S: Sorry JOE, your message to SAM@HOSTZ.ARPA lost.
S: HOSTZ.ARPA said this:
S: "550 No Such User"
S: .
R: 250 ok

Example 7: Return Path and Received Time Stamps


Return-Path: <@GHI.ARPA,@DEF.ARPA,@ABC.ARPA:JOE@ABC.ARPA>
Received: from GHI.ARPA by JKL.ARPA ; 27 Oct 81 15:27:39 PST
Received: from DEF.ARPA by GHI.ARPA ; 27 Oct 81 15:15:13 PST
Received: from ABC.ARPA by DEF.ARPA ; 27 Oct 81 15:01:59 PST
Date: 27 Oct 81 15:01:01 PST
From: JOE@ABC.ARPA
Subject: Improved Mailing System Installed
To: SAM@JKL.ARPA

Top of Page


PROTOCOL RELATIONS
Parent layer
Child layer
TCP
SMTP
Top of Page

GLOSSARY
Client
Clinet is a program which requests services of another program. It is a client part of a client-server architecture. Typically, a client is an application that runs on a personal computer or workstation and relies on a server to perform some operations. For example, an e-mail client is an application that enables you to send and receive e-mail.

Domain
A group of computers and devices on a network that are administered as a unit with common rules and procedures. Within the Internet, domains are defined by the IP address. All devices sharing a common part of the IP address are said to be in the same domain.

In database technology, domain refers to the description of an attribute's allowed values. The physical description is a set of values the attribute can have, and the semantic, or logical, description is the meaning of the attribute.

ESMTP
ESMTP (Extended Simple Mail Transfer Protocol) specifies extensions to the original protocol for sending e-mail that supports graphics, audio and video files, and text in various national languages. The original Internet protocols for sending e-mail are described in Request for Comments (RFC) 822, Standard for the Format of ARPA Internet Text Messages, Simple Mail Transfer Protocol (SMTP). As users began to want to attach various kinds of files to e-mail, the need for additional capabilities arose and resulted in RFC 1869, Extended Simple Mail Transfer Protocol.

ESMTP provides the capability for a client e-mail program to ask a server e-mail program which capabilities it supports and then communicate accordingly. Currently, most commercial e-mail servers and clients support ESMTP.

IMAP
IMAP 9Internet Message Access Protocol) is a protocol for retrieving e-mail messages. The latest version, IMAP4, is similar to POP3 but supports some additional features. For example, with IMAP4, you can search through your e-mail messages for keywords while the messages are still on mail server. You can then choose which messages to download to your machine.

LMTP
LMTP(Local Mail Transfer Protocol)
In some limited circumstances, outside the area of mail exchange between independent hosts on public networks, it is desirable to implement a system where a mail receiver does not manage a queue. LMTP protocol for transporting mail into such systems.

Although LMTP is an alternative protocol to ESMTP, it uses (with a few changes) the syntax and semantics of ESMTP. This design permits LMTP to utilize the extensions defined for ESMTP. LMTP should be used only by specific prior arrangement and configuration, and it MUST NOT be

used on TCP port 25.

Mailbox
Mailbox is an area in memory or on a storage device where e-mail is placed. In e-mail systems, each user has a private mailbox. When the user receives e-mail, the mail system automatically puts it in the mailbox.

The mail system allows you to scan mail that is in your mailbox, copy it to a file, delete it, print it, or forward it to another user. If you want to save mail, it is a good idea to copy it to a file, because files tend to be more stable than mailboxes.

Msgtrk
msgtrk(Message Tracking Protocol) is a diagnostic protocol for a message originator to request information about the submission, transport, and delivery of a message regardless of its delivery status.

The group will produce two standards track documents: a message tracking model document and a protocol document.

ODMR
ODMR(On-Demand Mail Relay), an e-mail service that allows a user to request e-mail from any internet connection by using a dynamic IP address as opposed to a static IP address. With OMDR, the user connects to an ISP that supports OMDR, authenticates and then requests e-mail. When the user requests e-mail, the roles of client and server reverse and normal SMTP operations proceed.

POP3
POP3 (Post Office Protocol 3) is the most recent version of a standard protocol for receiving e-mail. POP3 is a client/server protocol in which e-mail is received and held for you by your Internet server. Periodically, you (or your client e-mail receiver) check your mail-box on the server and download any mail, probably using POP3. This standard protocol is built into most popular e-mail products, such as Eudora and Outlook Express. It's also built into the Netscape and Microsoft Internet Explorer browsers.

Server
A computer or device on a network that manages network resources. For example, a file server is a computer and storage device dedicated to storing files. Any user on the network can store files on the server. A database server is a computer system that processes database queries. Servers are often dedicated, meaning that they perform no other tasks besides their server tasks. On multiprocessing operating systems, however, a single computer can execute several programs at once. A server in this case could refer to the program that is managing resources rather than the entire computer.

Top of Page

REFERENCES
Related links:
                SMTP service extensions
RFCs:
[RFC 876] Survey of SMTP Implementations.
[RFC 1047] DUPLICATE MESSAGES AND SMTP.
[RFC 1090] SMTP on X.25.
[RFC 1123] Requirements for Internet Hosts -- Application and Support.
[RFC 1652] SMTP Service Extension for 8bit-MIME transport.
                Obsoletes: RFC 1426.
[RFC 1845] SMTP Service Extension for Checkpoint/Restart.
[RFC 1846] SMTP 521 Reply Code.
[RFC 1870] SMTP Service Extension for Message Size Declaration.
                Obsoletes: RFC 1653.
[RFC 1985] SMTP Service Extension for Remote Message Queue Starting.
                Defines the SMTP command ETRN.
[RFC 2034] SMTP Service Extension for Returning Enhanced Error Codes.
[RFC 2442] The Batch SMTP Media Type.
[RFC 2505] Anti-Spam Recommendations for SMTP MTAs.
[RFC 2554] SMTP Service Extension for Authentication.
                Defines the SMTP command AUTH.
[RFC 2645] ON-DEMAND MAIL RELAY (ODMR) SMTP with Dynamic IP Addresses.
                Describes ODMR, defines the SMTP command ATRN.
[RFC 2821] Simple Mail Transfer Protocol.
                Obsoletes: RFC 821, RFC 974, RFC 1869.
                Updates: RFC 1123.
[RFC 2846] GSTN Address Element Extensions in E-mail Services.
[RFC 2852] Deliver By SMTP Service Extension.
                Updates: RFC 1894.
[RFC 2920] SMTP Service Extension for Command Pipelining.
                Obsoletes: RFC 2197.
[RFC 3030] SMTP Service Extensions for Transmission of Large and Binary MIME Messages.
                Obsoletes: RFC 1830.
[RFC 3027] Protocol Complications with the IP Network Address Translator.
[RFC 3191] Minimal GSTN address format in Internet Mail.
                Obsoletes: RFC 2303.
                Updates: RFC 2846.
[RFC 3192] Minimal FAX address format in Internet Mail.
                Obsoletes: RFC 2304.
                Updates: RFC 2846.
[RFC 3207] SMTP Service Extension for Secure SMTP over Transport Layer Security.
                Obsoletes: RFC 2487.
[RFC 3461] Simple Mail Transfer Protocol (SMTP) Service Extension for Delivery Status Notifications (DSNs).
                Updated by: RFC 3798, RFC 3885.
                Obsoletes: RFC 1891.
[RFC 3463] Enhanced Mail System Status Codes.
                Updated by: RFC 3886.
                Obsoletes: RFC 1893.
[RFC 3464] An Extensible Message Format for Delivery Status Notifications.
                Defines MIME content type message/delivery-status.
                Obsoletes: RFC 1894.
[RFC 3675] .sex Considered Dangerous.
[RFC 3798] Message Disposition Notification.
                Defines MIME media subtype message/disposition-notification.
                Obsoletes: RFC 2298.
                Updates: RFC 2046, RFC 3461.
[RFC 3848] ESMTP and LMTP Transmission Types Registration.
[RFC 3865] A No Soliciting Simple Mail Transfer Protocol (SMTP) Service Extension.
[RFC 3885] SMTP Service Extension for Message Tracking.
                Updates: RFC 3461.
[RFC 3886] An Extensible Message Format for Message Tracking Responses.
                Updates: RFC 3463.
Obsolete RFCs:
[RFC 788] SIMPLE MAIL TRANSFER PROTOCOL.
                Obsoleted by: RFC 821.
[RFC 821] Simple Mail Transfer Protocol.
                Obsoleted by: RFC 2821.
                STD: 10.
                Obsoletes: RFC 772, RFC 780, RFC 788.
[RFC 1425] SMTP Service Extensions.
                Obsoleted by: RFC 1651.
[RFC 1426] SMTP Service Extension for 8 bit-MIME transport.
                Obsoleted by: RFC 1652.
[RFC 1427] SMTP Service Extension for Message Size Declaration.
                Obsoleted by: RFC 1653.
[RFC 1651] SMTP Service Extensions.
                Obsoleted by: RFC 1869.
                Obsoletes: RFC 1425.
[RFC 1653] SMTP Service Extension for Message Size Declaration.
                Obsoleted by: RFC 1870.
                Obsoletes: RFC 1427.
[RFC 1830] SMTP Service Extensions for Transmission of Large and Binary MIME Messages.
                Obsoleted by: RFC 3030.
[RFC 1854] SMTP Service Extension for Command Pipelining.
                Obsoleted by: RFC 2197.
[RFC 1869] SMTP Service Extensions.
                Obsoleted by: RFC 2821.
                STD: 10.
                Obsoletes: RFC 1651.
[RFC 1891] SMTP Service Extension for Delivery Status Notifications.
                Obsoleted by: RFC 3461.
[RFC 1893] Enhanced Mail System Status Codes.
                Obsoleted by: RFC 3463.
[RFC 1894] An Extensible Message Format for Delivery Status Notifications.
                Obsoleted by: RFC 3464.
[RFC 2197] SMTP Service Extension for Command Pipelining.
                Obsoleted by: RFC 2920.
                Obsoletes: RFC 1854.
[RFC 2303] Minimal PSTN address format in Internet Mail.
                Obsoleted by: RFC 3191.
[RFC 2304] Minimal FAX address format in Internet Mail.
                Obsoleted by: RFC 3192.
[RFC 2487] SMTP Service Extension for Secure SMTP over TLS.
                Obsoleted by: RFC 3207.
                Defines SMTP command STARTTLS.
                


Top of Page

OTHER PROTOCOLS OF TCP/IP SUITE
AARP   RRP   RTP Video   RTP Audio   RTP   COPS   Gopher   HSRP   ICP   MPLS   IEEE 802.2   CIP   FTP - Data   FTP - Ctrl   IMAPS   IP Fragment   LDAPS   PUP   MSSQL   RSH   SQL   POP3s   RTELNET   RSVP   STP   VLAN   MSN   H.323   MSRDP   HTTPS   WINS   LPD   GTP   ICMPv6   POP   TELNET   H.225   VRRP   PIM   RARP   SAP   OSPF   RLOGIN   SCTP   SIP   RTCP   PPPoE   Mobile IP   IMAP3   WhoIs   SLP   NCP   PPTP   MGCP   LDAP   L2TP   Kerberos   IPv6   GRE   Ethernet SNAP   AFP   CIFS   IEEE 802.3   Finger   NBDGM   NetBEUI   NBSSN   ESP   EIGRP   EGP   DHCP   CGMP   CDP   BOOTP   AH   NBNS   EthernetII   ICQ   PPP   ARP   RIP   IPX   IGRP   IGMP   SSH   RPC   NetBIOS   TFTP   SNMP   SNA   SMB   RADIUS   NTP   NNTP   UDP   TCP   BGP   DNS   SOCKS   IMAP   RTSP   NFS   ICMP   IP   FTP   Telnet   POP3   SMTP   HTTP  
Search RFCs:

Advanced Search
Search Glossary:
Exact search
Fuzzy search


All Protocols
Submit a Request

Recommend an Article

 Layer 7 Application Layer
  AFP
  BOOTP
  CIFS
  CIP
  COPS
  DHCP
  DNS
  Finger
  FTP
  FTP - Ctrl
  FTP - Data
  Gopher
  HSRP
  HTTP
  HTTPS
  ICP
  ICQ
  IMAP
  IMAP3
  IMAPS
  Kerberos
  LPD
  MGCP
  MSN
  MSRDP
  MSSQL
  NCP
  NFS
  NNTP
  NTP
  POP
  POP3
  POP3s
  RADIUS
  RLOGIN
  RRP
  RSH
  RTCP
  RTELNET
  RTP
  RTP Audio
  RTP Video
  RTSP
  SAP
  SIP
  SLP
  SMB
  SMTP
  SNA
  SNMP
  SOCKS
  SSH
  Telnet
  TELNET
  TFTP
  WhoIs
  WINS
 Layer 6 Presentation Layer
  NBNS
  NBSSN
  NCP
  NetBIOS
 Layer 5 Session Layer
  LDAP
  LDAPS
  NCP
  NetBEUI
  RPC
 Layer 4 Transport Layer
  H.225
  H.323
  NBDGM
  NetBEUI
  PUP
  SCTP
  TCP
  UDP
 Layer 3 Network Layer
  AARP
  AH
  BGP
  EGP
  EIGRP
  ESP
  GRE
  GTP
  ICMP
  ICMPv6
  IGMP
  IGRP
  IP
  IP Fragment
  IPv6
  IPX
  Mobile IP
  MPLS
  OSPF
  PIM
  PPPoE
  RIP
  RSVP
  STP
  VRRP
 Layer 2 Data Link Layer
  ARP
  CDP
  CGMP
  Ethernet SNAP
  EthernetII
  IEEE 802.2
  IEEE 802.3
  L2TP
  PPP
  PPTP
  RARP
  SQL
  VLAN
 Layer 1 Physical Layer
© 2006 - 2007 Colasoft Co., Ltd. All rights reserved.