According to abbreviationfinder, SMTP stands for Simple Mail Transfer Protocol. Simple Mail Transfer Protocol is an Application Layer protocol. Text-based network protocol used for the exchange of email messages between computers or other devices (PDA’s, mobile phones, etc.). It is defined in RFC 2821 and is an official Internet standard.
It is part of the electronic messaging that was used in the 1960s. As more computers began to be interconnected with others, especially in the United States government ARPANET, standards were developed to allow users using different systems to be able to use the email each other. SMTP grew out of these standards developed during the 1970s.
SMTP can trace its roots to the Mailbox Protocol (ca. 1971), FTP Mail (ca. 1973), and Mail Protocol. Work continued through the 1970s, until the ARPANET became the modern Internet around 1980. Jon Postel then proposed the Mail Transfer Protocol in the year 80 which began to remove the trust of mail on FTP. SMTP was published as RFC 821 in August 1982, also by Jonathan Postel.
The SMTP standard was developed around the same time USENET was, from one to several communication networks with some similarities.
SMTP became widely used in the mid-1980s. At the time, it was a complement to UUCP (Unix to Unix Copy) mail, which was better suited for handling e-mail transfers between machines that were intermittently connected. SMTP, on the other hand, works best when 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.
SMTP is based on the client-server model, where a client sends a message to one or more receivers. Communication between client and server consists entirely of lines of text made up of ASCII characters . The maximum size allowed for these lines is 1000 characters.
The responses from the server consist of a three-digit numerical code, followed by an explanatory text. The number is aimed at an automatic processing of the response by automaton, while the text allows a human to interpret the response. In the SMTP protocol, all commands, responses or data are lines of text, delimited by the <CRLF> character. All replicas have a numeric code at the beginning of the line.
In the TCP/IP suite of protocols, SMTP goes on top of TCP, typically using port 25 on the server to establish the connection.
Basic SMTP Commands
- HELO, to open a session with the server
- MAIL FROM, to indicate who sends the message
- RCPT TO, to indicate the recipient of the message
- DATA, to indicate the beginning of the message, it will end when there is a line with only a period.
- QUIT, to close the session
- RSET Aborts the current transaction and clears all records.
- SEND Starts a transaction in which the message is delivered to a terminal.
- SOML The message is delivered to a terminal or mailbox.
- SAML The message is delivered to a terminal and a mailbox.
- VRFY Requests the server to verify the argument.
- EXPN Asks the server for confirmation of the argument.
- HELP Allows you to request information about a command.
- NOOP Used to reset timers.
- TURN Requests the server to exchange packets.
Example of a communication
First, a connection must be established between the sender (client) and the receiver (server). This can be done automatically with a mail client program or through a Telnet client.
The following example shows a typical connection. It is named with the letter C to the client and with S to the server.
S: 220 ESMTP Server C: HELO mycomputer.mydomain.com S: 250 Hello, please meet you C: MAIL FROM: S: 250 Ok C: RCPT TO: S: 250 Ok C: DATA S: 354 End data with <CR ><LF>.<CR><LF> C: Subject: Subject field C: From: C: To: C: C: Hello, C: This is a test. C: Goodbye. C: C:. S: 250 Ok: queued as 12345 C: quit S: 221 Bye
SMTP message transfer example:
Lines preceded by <<“C:”>> correspond to commands issued by the client and those beginning with <<“S:”>> are the subsequent responses returned by the server. S: <waiting for TCP connection on port 25> c: <open connection to server> s:220 beta.gov Simple Mail Transfer Service ready c:HELO s:250 beta.gov c:MAIL from: s: 250 OK c:RCPT TO: s:250 OK c:RCPT TO: s:550 No such user here c:DATA s:354 Start of mail input; ends with <CRLF>.<CRLF> c:…. message content (header and body) is sent… c:<CRLF>.<CRLF> s:250 OK c:QUIT s:221 beta. gov Service closing transmission channel
Connection at the beginning of the protocol
When the TCP protocol is used, the SMTP server listens permanently to port 25, waiting for a client that wants to send it. The SMTP application protocol initiates the HELO command, followed by the client identification, the server accepts it with a <<250 OK>> code.
Once the protocol is started, messages are sent from the client to the server, through the following process.
In the first place, the address of the mailbox of the origin of the message is transmitted, the command is MAIL FROM and if the server accepts, it sends the 250 OK message. Then the destination address is transmitted, through the RCPT TO command and the server confirms with 250 OK, but if the recipient does not exist, 550 Failure is sent.
Sending the content of the message
The client informs the server that it is going to send the message through the DATA command, if the server is willing it sends 354, all the lines that the client sends from this moment on are considered part of the content of the message, at the end of the message consider sending the <<.>>, when the server receives the end of the message it confirms with 250 OK,
Closing the connection
Once all the messages have been sent, the client can close the connection using the QUIT command, otherwise the machine that received the messages is the one who sends them with the TURN command, the server confirms with 250 OK, giving a section that starts with the HELO command.