A Practical Study of E-Mail Communication Through
A Practical Study of E-Mail Communication Through
net/publication/227859099
CITATIONS READS
6 14,974
3 authors, including:
All content following this page was uploaded by M. Tariq Banday on 31 May 2014.
Abstract
Simple Mail Transfer Protocol (SMTP) is an application layer protocol for e-mail
communication. It has been adopted as a standard by Internet Engineering Task Force
(IETF). SMTP has set conversational and grammatical rules for exchanging messages
between connected computers. It has evolved through several revisions and extensions since
its formation by Jon Postel in 1981. In SMTP, the sender establishes a full-duplex
transmission channel with a receiver. The receiver may be either the ultimate destination or
an intermediate forwarding agent. SMTP commands are issued by the sender and are sent to
the receiver, which responds to these commands through codes. Each SMTP session between
the sender and the receiver consists of three phases namely: connection establishment, mail
transactions and connection termination. This paper describes and illustrates the process of
e-mail communication through SMTP by issuing the individual SMTP commands directly to
transmit e-mail messages. It also describes individual SMTP commands and extensions with
practical implementation using a Telnet client.
Reference: Banday M.T., Qadri J.A., Shah N.A. (2010). "A Practical Study of E-mail
Communication through SMTP ," . Sprouts: Working Papers on Information Systems,
10(20). http://sprouts.aisnet.org/10-20
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study of E-mail Communication through SMTP - Sprouts 2010
Authors: Banday, M.T, Qadri, J.A. and Shah, N.A.
‘Alice’ composes an e-mail message on her computer Webmail program. This model of electronic
called client for ‘Bob’ and sends it to her sending server communication involves a number of hardware and
‘smtp.a.org’ using Simple Mail Transfer Protocol software components that communicate with each other
(SMTP) [03, 4]. Sending server performs a lookup for using some protocols especially SMTP protocol. SMTP
the mail exchange record of receiving server ‘b.org’ protocol has evolved as a complex system since its
through DNS protocol on DNS server ‘dns.b.org’. The inception. Its commands have been augmented by
DNS server responds with the highest priority mail inclusion of various extensions which may or may not be
exchange server ‘mx.b.org’ for the domain ‘b.org’. adopted by every SMTP client and server.
Sending server establishes SMTP connection with the
The remaining paper is organized as follows: Section 2
receiving server and delivers the e-mail message to the
describes various hardware and software components of
mailbox of ‘Bob’ on the receiving server. ‘Bob’
e-mail system. Section 3 describes SMTP connection,
downloads the message from his mailbox on receiving
mail transmission and termination processes. Section 4
server to local mailbox on his client computer using
presents and demonstrates various SMTP commands and
POP3 or IMAP protocols. Optionally, ‘Bob’ can also
extensions. Section 5 briefly presents SMTP reply codes
read the message stored in his server mailbox without
followed by conclusion.
downloading it to the local mailbox by using some
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study of E-mail Communication through SMTP - Sprouts 2010
Authors: Banday, M.T, Qadri, J.A. and Shah, N.A.
Each vertex corresponds to an e-mail node which is communicator’, ‘Qualcomm Eudora’, ‘KDE KMail’,
essentially a software unit involved in e-mail ‘Apple Mail’, and ‘Mozilla Thunderbird’ are examples
communication process and works on application layer of MUAs. Two or more MTAs can be used at the
of TCP/IP model. Nodes working on lower layers such sending servers to make e-mail delivery. Several Web-
as routers and bridges represent options to send e-mail based e-mail programs and services (known as Webmail)
without using SMTP are not considered in this model as such as ‘AIM Mail’, ‘Yahoo Mail’, ‘Gmail’, and
almost all e-mail communication uses SMTP directly or ‘Hotmail’ which integrate e-mail clients and servers
indirectly. Further, proprietary nodes used for internal behind a Web server are also used as MUAs. Mail
deliveries at sending and receiving servers are also not transfer Agent (MTA) nodes are in effect postal sorting
considered in this model. All Mail User Agent (MUA) agents that have the responsibility of retrieving the
nodes are software packages that run on client computers relevant Mail eXchange (MX) record from the Domain
and allow end users to compose, create or read e-mail. Name Servers (DNS) [6] for each e-mail to be send and
Some MUAs may be used to send e-mail to the receiving thus map the distinct e-mail addressee’s domain name
MTAs directly or indirectly. ‘Microsoft Outlook’, with the relevant IP address information. DNS is a
‘Microsoft Outlook Express’, ‘Lotus Notes’, ‘Netscape distributed directory database that correlated domain
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study of E-mail Communication through SMTP - Sprouts 2010
Authors: Banday, M.T, Qadri, J.A. and Shah, N.A.
names to IP addresses. MTAs can also be used to mails and transfer them with protocols other that SMTP
compose and create e-mail messages. ‘Sendmail’, and GWA, SMTP performs the inverse process at incoming
‘Postfix’, ‘Exim’, and ‘Exchange Server’, are examples and outgoing interfaces. Gateway nodes GWA,B do not
of MTAs. A receiving MTA can also perform the use SMTP either for incoming or outgoing interfaces. A
operation of delivering e-mail message to the respective process called Proxy may be done at these nodes when
mailbox of the receiver on the mail server and thus is incoming and outgoing interfaces use same protocols.
also called Mail Delivery Agent (MDA). Node named MailServ node represent e-mail server providing users
OtherAgents are software packages that send e-mail mail access service using IMAP or POP3 protocols. It
message through gateways. WebServ nodes are the e- also provides an internal interface to a Web server for
mail Web servers that provide the Web environment to HTTP based e-mail access.
compose, send and read an e-mail message. SMTP-
The e-mail nodes establish connections with one or more
Relays [7] are the nodes that perform e-mail relaying.
nodes. Each edge of the graph connecting two e-mail
Relaying is the process of receiving e-mail message from
nodes represents possible e-mail flow between them
one SMTP e-mail node and forward it to another one.
using a particular set of protocols. Table 1, lists basic
Gateway nodes are used to convert e-mail messages
protocols used in e-mail flow between two possible e-
from one application layer protocol to other. Gateway
mail nodes.
nodes named GWSMTP, B accept SMTP protocol based e-
Protocol
Basic Protocols
Group
SMTP protocol (RFC 821), SMTP service extension protocols ESMTP including Service Extension for
Authentication (RFC 2554), Delivery by SMTP Service Extension (RFC 2852), SMTP Service Extension for
۾܂ۻ܁
Routing Enhanced error (RFC 2034), and SMTP Service Extension for Secure SMTP over Transport Layer
Security (RFC 3207).
All protocols in SMTP group and all SMTP extensions for e-mail submission from MUA to e-mail node with SMTP
incoming interface. E-mail node can be MTA defined in RFC 2821, MSA defined in RFC 2476. Using MSA various
כ ۾܂ۻ܁
methods can be applied for ensuring authenticating user that include IP address restrictions, secure IP and POP
authentication.
All Internet application protocols except those specified in ܵ כܲܶܯgroup, all propraitory application protocols
SMTP* used on the Internet (also used for tunneling), all Internet protocols on the transport and network layers such as
TCP/IP as it is possible to send e-mail without the use of application layer protocols.
۶۾܂܂ሺ܁ሻ HTTP (RFC 2616), HTTP over SSL and HTTP over TLS (RFC 2818).
۷܂ۼ ESP specific protocols and procedures for internal e-mail delivery between e-mail nodes.
All e-mail access protocols used to transfer e-mails from the recipient e-mail server to MUA that include IMAP
۾ۯۻ
version 4 (RFC 1730), MAPI and POP version 3 (RFC 1939).
Some recent standard or experimental extensions to service environments [8], international delivery status
SMTP are extensions pertaining to: support for diverse and deposition notifications [9], internationalized e-mail
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study of E-mail Communication through SMTP - Sprouts 2010
Authors: Banday, M.T, Qadri, J.A. and Shah, N.A.
SMTP uses TCP protocol to make mail transfer reliable information using MAIL and RCPT TO commands. The
and efficient. In the first phase, the sender also called MAIL command which includes the sender identification
client makes a TCP connection with the receiver on an is issued by the sender. The receiver responses with a go
ephemeral TCP port. The receiver also called the server ahead service code (250). The receiver may validate the
sends connection acceptance reply using a code (220). sender and also may reject e-mail reception for security
The reply also includes server information including full reasons. On receiving the service code 250, the sender
server name and the version of the SMTP server specifies recipients using one or more RCPT TO
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study of E-mail Communication through SMTP - Sprouts 2010
Authors: Banday, M.T, Qadri, J.A. and Shah, N.A.
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study of E-mail Communication through SMTP - Sprouts 2010
Authors: Banday, M.T, Qadri, J.A. and Shah, N.A.
c) Once connection is established, SMTP commands can be issued to establish SMTP session and send mail as
shown in the below example.
HELO MYDOMAIN.COM
250- mailboxXXXX.mailhostingXXXX.com ….
MAIL FROM: [email protected]
250 2.1.0 OK
RCPT TO: [email protected]
250 2.1.5 OK
DATA
354 End Data with <CR><LF>.<CR><LF>
Subject: Test Message
Date: 10-01-2010
This is my message body.
.
250 2.0.0 Ok: queued as 85313139007B
QUIT
221 2.0.0 Bye
d) To work with some commands like STARTTLS, TELNET has to be connected with Transport Layer Security
(TLS) System. This may be achieved by using some telnet program that supports TLS or by setting up some
listener that establishes a secure connection between the SMTP server and the client.
Figure 6: Illustration of the use of Telnet to Establish SMTP Session between Sender and Receiver.
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study of E-mail Communication through SMTP - Sprouts 2010
Authors: Banday, M.T, Qadri, J.A. and Shah, N.A.
sender, but it also can be a list of hosts that were used to command is DATA. Please see figure 6 for a working
relay the mail message from its original Sender-SMTP. example of this command.
In a list of hosts, the first host is the current Receiving-
RSET
SMTP server. The last is the destination of the e-mail.
Syntax: The syntax of this command is MAIL FROM: This command nullifies the entire message transaction
(<>/Reverse-Path) [Mail-parameters]. Please see figure and resets the buffer without closing the connection. The
6 for a working example of this command. receiver sends a "250 OK" reply to a RSET command
with no arguments. Since EHLO implies some additional
RCPT TO
processing and response by the server, RSET will
This command is used to identify an individual recipient normally be more efficient than reissuing that command,
of the mail data; multiple recipients can be specified by even though the formal semantics are the same. Syntax:
multiple use of this command. The argument field The syntax of this command is RSET.
contains a forward-path and may contain optional
Example 3:
parameters. If service extensions were negotiated, the C: RSET
RCPT command may also carry parameters associated S: 250 2.0.0 Ok
with a particular service extension offered by the server. VRFY
Syntax: The syntax of this command is RCPT TO:
This command will request that the receiving SMTP
(<Postmaster@" domain>/ <Postmaster>/ Forward-
server verify that a given e-mail username is valid. The
Path) [Rcpt-parameters. Please see figure 6 for a
SMTP server will reply with the login name of the user.
working example of this command.
Syntax: The syntax of this command is VRFY
DATA <username>.
and headers such as the subject line. The mail data is EXPN
terminated by a line containing only a period, that is, the
This command asks the receiver to confirm that the
character sequence <CRLF>.<CRLF>. Receipt of the
argument identifies a mailing list, and if so, to return the
end of mail data indication requires the server to process
membership of that list. A server does not return a 250
the stored mail transaction information. This processing
code in response to a VRFY or EXPN commands unless
Consumes the information in the reverse-path buffer, the
it has actually verified the address. In that case, 502
forward-path buffer, and the mail data buffer, and on the
(Command not implemented) or 500 (Syntax error,
completion of this command these buffers are cleared. If
command unrecognized) is returned. In certain cases
the processing is successful, the receiver MUST send an
when address appears to be valid but cannot be
OK reply. When the SMTP server accepts a message
reasonably verified a reply code 252 is returned. Syntax:
either for relaying or for final delivery, it inserts a trace
The syntax of this command is EXPN <username>.
record also called time stamp line or received line at the
top of the mail data. Syntax: The syntax of this
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study of E-mail Communication through SMTP - Sprouts 2010
Authors: Banday, M.T, Qadri, J.A. and Shah, N.A.
transmission channel until it sends a QUIT command This command is used for authenticated TURN. After a
and waits until it receives the reply even if there was an client has been authenticated to the SMTP server, this
error response to a previous command. The syntax of command instructs the Receiver to assume the charge of
this command is QUIT. Please see figure 6 for a working sender. The receiver can return an OK response if it is
example of this command. ready to assume charge of sender or otherwise, returns
a Bad Gateway message (reply code 502) and remain in
SAML
the role as receiver.
This stands for Send and Mail. Mail is the typical use
today with SMTP. The send method is meant to be used SIZE [14]
when the SMTP server has been implemented to deliver The SIZE command, allows the receiving host to tell the
mail directly to a recipient that is actively connected. sending host the maximum message size before the
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study of E-mail Communication through SMTP - Sprouts 2010
Authors: Banday, M.T, Qadri, J.A. and Shah, N.A.
DSN [15]
ETRN
This command enables delivery status notifications. It
ETRN define extensions to the SMTP service whereby a
notifies the host of a delivery failure, and is considered
client ("sender-SMTP") may request that the server
an improvement over simple non-delivery reports. An
("receiver-SMTP") start the processing of its mail queues
extended SMTP server which implements this service
for messages that are waiting at the server for the client
extension will accept an optional NOTIFY parameter
machine. If any messages are at the server for the client,
with the RCPT command. If present, the NOTIFY
then the server creates a new SMTP session and sends
parameter alters the default conditions for generation of
the messages at that time. The extended ETRN
Delivery Status Notifications only on failure. The
command is issued by the client host when it wishes to
ESMTP client may also request (via the RET parameter)
start the SMTP queue processing of a given server host.
whether the entire contents of the original message
Syntax: The syntax of this command is: ETRN [<option
should be returned as opposed to just the headers of that
character>] <node name>.
message, along with the DSN. A RCPT command issued
by a client may contain the optional ESMTP-keyword Example 7:
C: ETRN
"NOTIFY", to specify the conditions under which the S: 500 Syntax Error
SMTP server should generate DSNs for that recipient. C: ETRN localname
S: 501 Syntax Error in Parameter
C: ETRN b.com
Example 6:
S: 458 Unable to queue messages for node b.com
C: EHLO MYDOMAIN.COM
S: 250- mailboxXXXX.mailhostingXXXX.com
C: ETRN allowed.com
S: 250-PIPELINING
S: 250 OK, queuing for node allowed.com started
S: 250-SIZE 20971520
S: 250-VRFY
C: ETRN allowed.com
S: 250-ETRN
S: 251 OK, no messages waiting for node allowed.com
S: 250-AUTH PLAIN LOGIN
S: 250-AUTH=PLAIN LOGIN
C: ETRN allowed.com
S: 250-ENHANCEDSTATUSCODES
S: 252 OK, pending messages for node allowed.com
S: 250-8BITMIME
started
S: 250-DNS
C: MAIL FROM: [email protected] RET=HDRS
CHUNKING
ENVID=QQ314159
S: 250 2.1.0 OK
C: RCPT TO: [email protected] NOTIFY=SUCCESS The CHUNKING command indicates that the recipient
RCPT=rfc822;[email protected] supports the use of the BDAT command. The BDAT
S: 250 recipient ok
C: RCPT TO: [email protected] NOTIFY=FAILURE command is used as an alternative to the DATA
RCPT=rfc822;[email protected] command. It replaces the DATA command so that the
10
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study of E-mail Communication through SMTP - Sprouts 2010
Authors: Banday, M.T, Qadri, J.A. and Shah, N.A.
SMTP host does not have to continuously scan for the C: MAIL FROM: [email protected]
S: 250 sender <[email protected]> OK
end of the data; this command sends a BDAT command
C: RCPT TO: [email protected]>
with an argument that contains the total number of bytes S: 250 recipient <[email protected]> OK
C: RCPT TO: <[email protected]>
in a message. The receiving server counts the bytes in
S: 250 recipient <[email protected]> OK
the message and, when the message size equals the value C: RCPT TO:<[email protected]>
S: 250 recipient <[email protected]> OK
sent by the BDAT command, the server assumes it has
C: DATA
received all of the message data. For example of S: 354 End Data with <CR><LF>.<CR><LF>
C: Subject: Test Message
Chunking, please see the BDAT command.
C: Date: 10-01-2010
C: This is my message body.
PIPELINING [16] C: .
C: 250 2.0.0 Ok: queued as 85313139007B
Command pipelining is batching up of multiple C: QUIT
S: 221 2.0.0 Bye
commands into a single TCP send operation. It provides
the ability to send a stream of commands without In the above simple example the client waits for a server
waiting for a response after each command which is response 8 times. But if pipelining is employed (as
shown in example below) it is possible to reduce the
inefficient way to communicate with a host. If a client waiting time.
wishes to employ command pipelining, it first
Example 9:
determines its support by the server by issuing the C: EHLO MYDOMAIN.COM
EHLO command. If the server responds with code 250 S: 250- mailboxXXXX.mailhostingXXXX.com
S: 250-PIPELINING
and the response includes the EHLO keyword value S: 250-SIZE 20971520
PIPELINING, then the server supports command S: 250-VRFY
S: 250-ETRN
pipelining. The client may transmit groups of SMTP S: 250-AUTH PLAIN LOGIN
commands in batches without waiting for a response to S: 250-AUTH=PLAIN LOGIN
S: 250-ENHANCEDSTATUSCODES
each individual command. In particular, the commands S: 250-8BITMIME
RSET, MAIL FROM, SEND FROM, SOML FROM, S: 250-DNS
C: MAIL FROM: [email protected]
SAML FROM, and RCPT TO can all appear anywhere C: RCPT TO: [email protected]>
in a pipelined command group. The EHLO, DATA, C: RCPT TO: <[email protected]>
C: RCPT TO :<[email protected]>
VRFY, EXPN, TURN, QUIT, and NOOP commands C: DATA
can only appear as the last command in a group since S: 250 sender <[email protected]> OK
S: 250 recipient <[email protected]> OK
their success or failure produces a change of state which S: 250 recipient <[email protected]> OK
the client must accommodate. S: 250 recipient <[email protected]> OK
S: 354 End Data with <CR><LF>.<CR><LF>
C: Subject: Test Message
Because current networks are reliable enough, the
C: Date: 10-01-2010
transmit-and-wait nature of SMTP is no longer C: This is my message body.
C: .
necessary. As an alternative, ESMTP supports
C: QUIT
pipelining. Pipelining refers to the host's ability to send C: 250 2.0.0 Ok: queued as 85313139007B
S: 221 2.0.0 Bye
commands in batches, without having to wait for a
response after each command. In the above example using pipelining, the client waits
for a server response 3 times only.
Example 8:
C: HELO MYDOMAIN.COM
S: 250- mailboxXXXX.mailhostingXXXX.com
11
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study of E-mail Communication through SMTP - Sprouts 2010
Authors: Banday, M.T, Qadri, J.A. and Shah, N.A.
The AUTH command is a SMTP service extension by [email protected] test) are not sent as plain text but are
which an SMTP client may indicate an authentication encoded using BASE64 encoding to form
protocol exchange, optionally negotiate a security layer to send the username and password, together with the
for subsequent protocol interactions during this session AUTH PLAIN command, as a single line as shown
12
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study of E-mail Communication through SMTP - Sprouts 2010
Authors: Banday, M.T, Qadri, J.A. and Shah, N.A.
BASE64 coded message Username:. The BASE64 the output of a Hash-based Message Authentication
encoded username dEBuaWN0c29mdC5jb20= of text Code calculation with the password as the secret key and
username [email protected] is given in the next response the SMTP server's original challenge as the message.
from the client. The server responds with 334 The SMTP server also calculates its own digest with its
UGFzc3dvcmQ6 which is 334 status code with BASE64 notion of the user's password. The authentication is
coded message Password:. The BASE64 encoded successful if the client's digest and the server's digest
13
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study of E-mail Communication through SMTP - Sprouts 2010
Authors: Banday, M.T, Qadri, J.A. and Shah, N.A.
E-mail plain text communicate using SMTP protocol In the above example the client first establishes a
over the Internet is insecure because the message travels connection with the server to know its supported
through one or more routers that are not trusted. To extensions. The client requests the server to start
improve security, an encrypted TLS (Transport Layer Transport Layer Security. Once status code 220 is
Security) connection can be used when communicating received by the client, it issues EHLO command again to
between the e-mail server and the client. TLS is most start a new SMTP session under TLS. The AUTH
useful when a login username and password (using command is next used to authenticate the sender under a
AUTH command) are encrypted. TLS can be used to TLS cover.
encrypt the whole e-mail message, but the command
8BITMIME [19]
does not guarantee that the whole message will stay
encrypted the whole way to the receiver; some e-mail Initially, e-mail messages consisted of ASCII text only.
servers can decide to send the e-mail message with no As such, e-mail messages typically used a 7-bit encoding
encryption. But at least the username and password used scheme, which was ideally suited for messages
with the AUTH command will stay encrypted. Use of consisting of letters, numbers and some special symbols.
STARTTLS command together with the AUTH Currently, e-mail messages now include HTML-
command is a very secure way to authenticate users. The elements, large documents of different formats as
following example demonstrates the STARTTLS. attachments and Unicode characters that are not a part of
the ASCII character set but SMTP still encodes
Example 15:
C: EHLO MYDOMAIN.COM messages in a 7-bit format. To get around the limitations
S: 250- mailboxXXXX.mailhostingXXXX.com of 7-bit encoding, SMTP messages typically are encoded
S: 250-PIPELINING
S: 250-SIZE 20971520 in 8bitmime, and then encapsulated in a 7-bit packet for
S: 250-VRFY transmission. Upon receipt, the 7-bit capsule is stripped
S: 250-ETRN
S: 250-AUTH PLAIN LOGIN away, and the message is converted back to its original
S: 250-AUTH=PLAIN LOGIN 8bitmime format. This encapsulation puts additional
S: 250- STARTTLS
S: 250-ENHANCEDSTATUSCODES burden on the mail server thus reducing its performance.
S: 250-8BITMIME To avoid this, ESMTP protocol supports 8bitmime
S: 250-DNS
C: STARTTLS natively wherein the e-mail can be transmitted and
S: 220 Ready to start TLS received in this format without the need for 7-bit
C: EHLO MYDOMAIN.COM
S: 250- mailboxXXXX.mailhostingXXXX.com encapsulation. A mail client that wants to transmit
S: 250-PIPELINING 8bitmime data, first enquires the receiver about its
S: 250-SIZE 20971520
S: 250-VRFY support through EHLO command. The 8bitmime
S: 250-ETRN complaint server in response to EHLO command besides
S: 250-AUTH PLAIN LOGIN
S: 250-AUTH=PLAIN LOGIN other replies also replies with 250-8BITMIME.
S: 250- STARTTLS Following example demonstrates the usage of
S: 250-ENHANCEDSTATUSCODES
S: 250-8BITMIME 8BITMIME.
S: 250-DNS
C: AUTH LOGIN Example 16:
S: 334 VXNlcm5hbWU6 C: EHLO MYDOMAIN.COM
C: dEBuaWN0c29mdC5jb20= S: 250- mailboxXXXX.mailhostingXXXX.com
S: 334 UGFzc3dvcmQ6 S: 250-PIPELINING
C: dGVzdA== S: 250-SIZE 20971520
S: 235 2.7.0 Authentication successful
14
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study of E-mail Communication through SMTP - Sprouts 2010
Authors: Banday, M.T, Qadri, J.A. and Shah, N.A.
S: 250-ENHANCEDSTATUSCODES Status Codes registry has three tables namely Class Sub-
S: 250-8BITMIME
Codes, Subject Sub-Codes, and Enumerated Status
C: MAIL FROM: [email protected] BODY=8BITMIME
S: 250 Sender and 8BITMIME ok Codes. Status codes consist of three numerical fields
C: RCPT TO: [email protected]
separated by ".". The first sub-code indicates whether the
S: 250 recipient ok
C: DATA delivery attempt was successful. The second sub-code
S: 354 Send 8BITMIME message, ending in
indicates the probable source of any delivery anomalies,
CRLF.CRLF.
C: …. and the third sub-code indicates a precise error
C: ….
condition. The syntax of the new status codes is defined
C: .
S: 250 ok as:
C: QUIT
S: 221 Goodbye status-code = class "." subject "." detail
class = "2"/"4"/"5"
It is essential to understand the differentiate between subject = 1*3digit
8BITMIME and BINARYMIME responses of server. detail = 1*3digit
8BITMIME server response to EHLO command
indicates that the local SMTP virtual server supports SMTP Reply Codes
eight-bit Multipurpose Internet Mail Extensions (MIME)
SMTP and ESMTP [21, 22] reply codes are of three
messages. The BINARYMIME server response to EHLO
digits. The first reply code digit indicates the success or
command indicates that the SMTP virtual server accepts
failure of the command in general terms. This digit is
a message that contains binary material without transport
interpreted in exactly the same way as it is in FTP. The
encoding by using a BODY parameter with a value of
second reply code digit is used to categorize messages
"BINARYMIME" in the MAIL command. When the
into functional groups. This digit is used in the same
SMTP server accepts a MAIL command with a BODY
general way as in FTP, but some of the functional groups
parameter of BINARYMIME, the server agrees to
are different in SMTP. The third reply code digit
preserve all bits in each octet passed using the BDAT
indicates a specific type of message within each
command. The BINARYMIME SMTP extension can
functional groups described by the second digit. The
only be used with CHUNKING.
third digit allows each functional group to have ten
ENHANCEDSTATUSCODES different reply codes for each reply type given by the
first code digit that e.g. preliminary success and transient
Request for Comments RFC3463 [19] provides an
failure. SMTP reply codes with a short description of
enhanced set of status codes for Delivery Status
each are listed in table 2. The support of
Notification (DSN) messages. The Enhanced Status
ENHANCEDSTATUSCODES SMTP extension
Codes provide a standard mechanism for reporting mail
supplements reply codes and thus the receiving server
system errors, and provide more meaningful information
can issue them in response to each command. These
than the standard error codes defined in the SMTP RFC
ESMTP codes are similar to the standard reply codes and
(821). The server response to client EHLO command
are also of three digits, but the digits are separated by
includes 250-ENHANCEDSTATUSCODES if the server
periods. These enhanced codes provide more
supports enhanced delivery status notification messages.
information to the sending clients about the results of
Recently, IANA has created the registry "SMTP
operations, especially errors.
Enhanced Status Codes" [20]. The SMTP Enhanced
15
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study of E-mail Communication through SMTP - Sprouts 2010
Authors: Banday, M.T, Qadri, J.A. and Shah, N.A.
Reply
Description
Code
This error code is send when SMTP server or e-mail program is unable to start an SMTP session. Various possible
reasons may be incorrectly spelt SMTP server, invalid IP address and invalid or busy SMTP port. Typical example of
101
error messages with this error code are: "SMTP Error 101, Error opening connection" or "SMTP Error 101, cannot
open SMTP stream".
This is a reply code that includes message about the mail server status. The server responds with this code in reply to
211 some clients commands e.g. the client may issue a command to the mail server to display a list of commands it
supports and the server responds with a reply 211 followed by the requested list.
This is a response to the "HELP" command. It displays information about the server, usually a URL to the FAQ page
214
of the SMTP software running on the server.
This code indicates the mail service is running. It will normally contain a welcome message and/or the title of the
220
SMTP software and, sometimes, the version number of the mail server software.
This reply indicates that the server is ending the mail session, i.e. it is closing the conversation as it has no more mail
221
to send in this sending session. Typical examples are: "221 Closing connection" -or- "221 Goodbye".
This code indicates that the e-mail account is not local to the mail server but the server will accept the e-mail and will
251
forward it.
This response code means that the user account appears to be valid but could not be verified, however the server will
252
try to deliver the message.
This is normally in response to the DATA command. It indicates that the server has received the mail envelope and is
354
ready to accept mail body.
This reply code indicates that the mail transfer service is unavailable because of some transient event. It generally
421
indicates that the mail server is currently unavailable but may be available later.
It indicates that either the recipient’s mailbox or the message delivery folder on the recipient’s mail server has
422
crossed its storage limits.
431 This reply code is an indication of disk full error or out of memory error on the recipient mail server.
This is a status response specific to Exchange Server. It indicates that the recipient’s mail queue on their Exchange
432
Server has been stopped.
441 This is generated by sending client and indicates that the recipient’s server is not responding.
This error code indicates that the connection was dropped during transmission which may be an unusual transient
442
error.
446 This code indicates that the maximum hop count has exceeded for the message.
It indicates that the outgoing message has timed out because of some problems with the receiving server which
447
objected to the message.
This response is specific to Exchange Server. It indicates that an SMTP connector is configured to use DNS without a
449
smart host and also uses a non-SMTP address space.
This response indicates that the mailbox is unavailable at the receiver. It is a transient error at the receiver and the
450 sender can retry after some time. Typical examples are: "450 Please try again later" -or- "SMTP Error 450 5.2.3 Msg
Size greater than that allowed by Remote Host"
This code indicates that the action has been aborted locally. This is usually due to overloading at the server as a result
451 of many messages or transient failures. Typical examples are: "SMTP error 451 Unable to complete command, DNS
not available or timed out" -or- "451 Domain of sender address does not resolve".
16
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study of E-mail Communication through SMTP - Sprouts 2010
Authors: Banday, M.T, Qadri, J.A. and Shah, N.A.
Reply
Description
Code
It indicates that the server’s disk system has run out of storage space. Occasionally this error may be raised if the
452
receiving mail server is overloaded by messages. Typical example is: "452 Out of memory".
This response is specific to Exchange Server returned by the recipient’s server in case incoming e-mail specifies a
465
Code Page that is not installed on the recipient’s server.
This is a local error on the sending server and is often followed with "Please try again later" message. The error may
471
be caused due to some problem with anti-spam or anti-virus software.
500 It indicates syntax error which may be generated due to an invalid SMTP command.
This error code indicates that the command or function issued by the sending mail server is valid but has not been
502
activated.
It indicates that the command and parameters of the issued SMTP command are valid, but some parameter is not
504
implemented on the receiving server, or some additional parameter or action is missing.
510 This code indicates that the e-mail address specified in the SMTP command is invalid.
511 This code indicates that the e-mail address specified in the SMTP command is invalid.
This response indicates that the host server for the recipient’s domain cannot be found through DNS. This response
512
code is received when one intermediate servers is unable to resolve the domain name of a recipient e-mail address.
513 This status code is received in case the e-mail addresses are not defined correctly by the sender’s mail server.
523 This error is received in case the total size of the sent message exceeds the limits on the recipient’s server.
This error code indicates that the requested action has not been performed because the mailbox is not available.
550
Typical examples are: "550 Invalid recipient", “550 User account is unavailable" and “550 No such user".
552 It indicates that the recipient’s mailbox has reached its maximum allowed storage limit.
553 It indicates an invalid e-mail address in "To", "CC", or "BCC" field of the message.
This is a permanent error indicating the transactions failure that cannot be resolved by resending the message in its
554
current form.
17
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study
y of E-mail Com
mmunication thhrough SMTP - Sprouts 20100
Authoors: Banday, M..T, Qadri, J.A. and
a Shah, N.A.
simple Telneet client has not proved sufficient, annd a mpus, Londonn, UK in 20088. At present he
Cam h is Lecturerr
P server and the
secure conneection betweeen the SMTP Brittish Institute of Technologgy & Ecommeerce, London,,
client was esstablished befoore using Telnnet. For studyy and Uniited Kingdom
m. His reseearch articless have beenn
developmentt of SMTP exxtensions it iss desired to build
b pub
blished in jouurnals and conference procceedings. Hiss
SMTP-Email utility thatt besides perrmitting to issue
i Currrent researcch interests are Intern
net Security,,
mands directtly can also perform varrious
SMTP comm Kno
owledge Management and W
Web Accessib
bility.
other functioons required during
d developpment and testting.
Nisar A. Sh
hah was born
n in 1953. Hee
These incluude format conversionns, support for
did his M. Scc. and Ph. D. Degrees from
m
cryptographyy, handling of security cerrtificates, suppport
the departmeent of Physiccs, Universityy
batch submisssion of SMT
TP commands,, establishmennt of
of Kashmir,, Srinagar, In
ndia in 19766
TCP and UD
DP sessions with
w other servvers without need
n
and 1981 resspectively. Att present he iss
to disconnecct the current session and to support varrious
worrking as Profeessor in the Deepartment of Electronics
E &
file operationns. It would be
b our endeavor to build suuch a
Insttrumentation Technology,
T U
University off Kashmir. Hee
system in neaar future.
has to his credit about 150 reesearch publiccations whichh
Biographiies ve been pubblished in nnational and internationall
hav
jourrnals of repuute. He has suupervised sev
veral researchh
M. Tariq Banday was
w born in 1969.
scholars in M. Phil.
P and Ph. D. programss. His currentt
He did his M. Sc. and M. Phil. Deggrees
reseearch interestss include Diggital Signal Prrocessing andd
from thee Departmentt of Electronnics,
Nettwork Securityy.
Universitty of Kashmiir, Srinagar, India
in 1996 and 2008 respectively. Hee did Reeferences
advanced diiploma coursee in computeers and qualiified
[1] Markus Jaakobsson (Edd.) and Steven
n Myers (Ed.),,
UGC NET examination inn 1997 and 19998. At presennt he
‘Phishingg and Coun
ntermeasures::
is working as
a Assistant Professor
P in thhe Departmennt of
Understan
nding the Increasing Problem off
Electronics & Instrumentaation Technoloogy, Universitty of
Electronicc Identity Theft”, Ado
obe E-Book,,
Kashmir, Srinagar, India.. He has to his
h credit sevveral
ISBN: 9788-0-470-086009-4, Dec 2006
6.
research pubblications in reeputed journals and confereence
[2] Resnick, P. Ed., ‘Intternet Messa
age Format’,,
proceedings. He is a mem
mber of Com
mputer Societyy of
C 2822, Apr 22001.
IETF RFC
India, Internaational Assocciation of Enggineers and AC
CM.
[3] Klensin ‘Simple Mail Transfer Prrotocol’ IETF
F
His current research
r intereests include Network
N Secuurity,
RFC 28211, Apr 2001.
Internet Protoocols and Nettwork Architecture.
[4] R. Siembborski, Ed., and A. Meelnikov, Ed.,,
w born in 1972.
Jameel A. Qadri was ‘SMTP Service
S Exten
nsion for Autthentication’,,
He did his
h M.Sc. deggree in Electroonics IETF RFC
C 4954, Jul 20007.
and Poost Graduatte Diploma in [5] G. Schryyen, ‘A Forrmal Approa
ach towardss
Computter Applications f
from Assessingg the Effecctiveness off Anti-spam
m
Departm
ment of Electrronics, Univerrsity Procedurees’, In proceedings of 39th Hawaiii
of Kashmirr, Srinagar, India in 1998
1 and 2000
2 International Conferencce on System Science, vol..
respectively. He receivedd M. Sc. Deggree in Electrronic 6 pp. 129aa-129a, May 22006.
Commerce from Midddlesex Univversity, Henndon
18
8
Sprouts - http://sprouts.aisnet.org/10-20
A Practical Study of E-mail Communication through SMTP - Sprouts 2010
Authors: Banday, M.T, Qadri, J.A. and Shah, N.A.
[6] D. Atkins and R. Austein, ‘Threat analysis of the [17] G. Vaudreuil, ‘SMTP Service Extensions for
Domain Name System (DNS)’, IETF RFC 3833, Transmission of Large and Binary MIME
Aug 2004. Messages’, IETF RFC 3030, Dec 2000.
[7] P.J. Sandford, J. M. Sandford, and D. J. Parish, [18] P. Hoffman, ‘SMTP Service Extension for
‘Analysis of SMTP Connection Characteristics Secure SMTP over Transport Layer Security’,
for Detecting Spam Relays’, International Multi- IETF RFC 3207, Feb 2002.
Conference on Computing in the Global [19] J. Klensin, N. Freed, M. Rose, E. Stefferud, and
Information Technology - (ICCGI'06), pp.68, D. Crocker, ‘SMTP Service Extension for 8bit-
2006. MIMEtransport’, IETF RFC 1652 , July 1994.
[8] D. Cridland, Ed., A. Melnikov, Ed., and S. Maes, [20] T. Hansen, and J. Klensin, ‘A Registry for SMTP
Ed., ‘The Internet Email to Support Diverse Enhanced Mail System Status Codes’ IETF RFC
Service Environments (Lemonade) Profile’ IETF 5248, Jun 2008.
RFC 5550, Aug 2009. [21] G. Vaudreuil, ‘Enhanced Mail System Status
[9] C. Newman, and A. Melnikov, Ed., Codes’, IETF RFC 3463, Jan 2003.
‘Internationalized Delivery Status and [22] N. Freed, ‘SMTP Service Extension for
Disposition Notifications’, IETF RFC 5337, Sep Returning Enhanced Error Codes’, IETF RFC
2008. 2034, Oct 1996.
[10] J. Yao, Ed., and W. Mao, Ed., ‘SMTP Extension
for Internationalized Email Addresses’, IETF
RFC 5336, Sep 2008.
[11] G. White, and G. Vaudreuil, ‘SMTP Submission
Service Extension for Future Message Release’,
IETF RFC 4865, May 2007.
[12] K. Toyoda, and D. Crocker, ‘SMTP and MIME
Extensions for Content Conversion’, IETF RFC
4141, Nov, 2005.
[13] E. Allman, and T. Hansen, ‘SMTP Service
Extension for Message Tracking’, IETF RFC
3885, Sep 2004.
[14] J. Klensin, N. Freed, and K. Moore, ‘SMTP
Service Extension for Message Size
Declaration’, IETF RFC 1870, Nov 1995.
[15] K. Moore, ‘Simple Mail Transfer Protocol
(SMTP) Service Extension for Delivery Status
Notifications (DSNs)’, IETF RFC 3461, Jan
2003.
[16] N. Freed, ‘SMTP Service Extension for
Command Pipelining’ IETF RFC 2920, Sep
2000.
19
Sprouts - http://sprouts.aisnet.org/10-20
Working Papers on Information Systems | ISSN 1535-6078
Editors:
Michel Avital, University of Amsterdam
Kevin Crowston, Syracuse University