Qondio
Front
Intel
IntelMart
Shares
My Qondio
Account
Tema Hassan > Intel > Understanding SMTP

qondio.com/UAC7 PRINT EMAIL

Understanding SMTP

By Tema Hassan of Azahar Technologies

SMTP stands for Simple Mail Transfer Protocol, and is the basis for sending mail from one location to another on the internet. It was proposed as a standard in RFC 821 in 1982 by the late Jon Postel, and has been updated with RFC 2821, RFC 2822, RFC 2920, RFC 3030, and RFC 2487, which extended the original specification.

SMTP is an agreed, standard method in which mail servers can talk to one another, regardless of the system they are running on, and enable the transfer of emails in a reliable way. As an example to describe how this is performed, we will say we have two users, user@red.net and customer@hotmail.com.

Composing the message

user@red.net wants to send a mail to customer@hotmail.com, so they use their email client (e.g. Thunderbird or Outlook). After composing the message, user@red.net clicks on the 'Send' button. The email client has no knowledge of how to send a mail directly to customer@hotmail.com, as its purpose is simply to allow a user to create and send mails, so the delivery of the mail is to be done by user@red.net's SMTP server.

The SMTP server

At this point, the first stage of sending a mail via SMTP takes place: the email client connects to its SMTP server, (in this case we will say smtp.red.net - this is configured in the email client preferences). The email client then starts a discussion with smtp.red.net, providing the following information:

* user@red.net's IP address, for logging and authenticating the email
* who the mail sender is
* where it is going to.

After this, the data of the message is sent. This includes information such as the date, subject, message body and any attachments that are to be sent with the email.

At this point, smtp.red.net will check to ensure that it is supposed to relay the mail for the sender, by verifying the IP address. If accepted, smtp.red.net will inform the email client that everything is OK and the message should be sent.

Domains and MX records

Now, smtp.red.net must examine the message and determine where it is supposed to be delivered to. This is determined by looking at the recipient's domain name (this is the information to the right of the '@' symbol), in this case hotmail.com. The SMTP server will look for Mail Exchanger (MX) records for this domain. MX records are a public list of servers (held in DNS) which will accept mail (via SMTP) for this domain. Once this information has been gathered, smtp.red.net will attempt to connect to hotmail.com's Mail Exchangers in order of preference. Preference is declared with MX records, with the lowest numbered MX being the most preferred exchanger. This will be discussed further later in this document.

Once smtp.red.net has connected to a hotmail.com Mail Exchanger, it declares its IP address, who the mail is from and who it is to. If the hotmail.com Mail Exchanger accepts mail for the user customer@hotmail.com, it responds that this is fine, and the message is transferred. At this time, the mail has completely left red.net's mail systems and has been successfully delivered to hotmail.com.

Notes

We have described a normal, successful session where mail is sent from one user to another on the internet, regardless of their locations. However, this is not always possible. As mentioned, Mail Exchangers have preferences with their MX records (which are stored in a DNS). The preference is a number (normally between 0-99), and declares which server is to be preferred. Take an example where there are 3 Mail Exchangers listed - mxA.red.net, mxB.red.net and mxC.red.net. They are given the preferences 0,10 and 20 respectively, and handle mail for the domain red.net.

In normal circumstances, mail sent to user@red.net should be sent to mxA.red.net. That is to say, that any remote SMTP system will want to connect to this system first, as it is the highest priority MX for the domain (the lower the number, the higher the priority). However, there are times that mxA.red.net may be down, for example, a reboot, high system load or system maintenance. In this eventuality, remote SMTP systems will then try the next MX, in our example mxB.red.net, to accept the mail. If this happens, mxB.red.net will accept the mail and attempt to send the mail to mxA.red.net on a regular basis until it has been accepted. This is known as queuing mail for delivery.


Contributor's Note

IPinfinity is one of the fastest growing online technical resources for IT and Communications professionals. Tema Hassan is a technical consultant with Azahar Technologies.

This intel first appeared on: http://www.ipinfinity.com/index.php/Understanding_SMTP

Images


Contributed by Tema Hassan on December 3, 2008, at 11:24 AM UTC.

Reactions

No reactions yet.

Rate This Intel

Please login or sign up to rate this intel.

Comments

Please login or sign up to add a comment.

Share

Copyright Notice

The copyright for this content entitled "Understanding SMTP" has been specified by the contributor as:

All Rights Reserved

This content may not be copied, distributed or adapted by anyone under any circumstances.

Login Here with
Any Email Address
Any Password
No account? Sign up.

Intel Contributor
This intel was contributed by Tema Hassan


Tema Hassan

Qondio Archive
May, 2012
123456
78910111213
14151617181920
21222324252627
28293031


2008
January, February, March, April, May, June, July, August, September, October, November, December
2009
January, February, March, April, May, June, July, August, September, October, November, December
2010
January, February, March, April, May, June, July, August, September, October, November, December
2011
January, February, March, April, May, June, July, August, September, October, November, December
2012
January, February, March, April, May

Sign Up
Not a member yet? Qondio is a powerful network for making it online. If you have a website to promote, we can help. Sign up and get in on the action.

About Qondio
Welcome to Qondio! Discover the awesome power this network can deliver by going to our About page. Or you could skip straight to the Sign Up form.

ABOUT
SUCCESS GUIDE
FEATURES
FAQ
ADVERTISE
CONTACT
USAGE POLICY
PRIVACY POLICY


TWITTER
FACEBOOK