Tuesday, March 18, 2008

So who is the Postman sending the Email??

It is interesting to know that many email server administrator do not know how emails work. They can be configuring the servers and creating users but doesn’t know what happen when the user click on the “SEND” button. Therefore I decided to blog on how exactly email works as one of my beginning blog.

Email the basic communication that we are all using in our daily work. User simply open up their email client interface, type the sweetest things they can and click “send”. 9 out of 10 users won’t think about how the “postman” is sending theemail for them. But all of them will be expecting the receiver to receive their mails. Of course, we the tech geek, are the 1 out of the 10 that is concern on the amazing technology of email.

In the total process of email, we will look at few key players. The Mail Transfer Agent (MTA) e.g Exchange Mail Server, E-mail client e.g Outlook Express, Mail Exchanger (MX), Domain name Server (DNS) and the Internet. Like any game, there are a few rules to follow.

For out-going emails, Simple Mail transfer Protocol (SMTP) port 25 will be use. For in-coming mails, Post Office Protocol (POP) port 110 or Internet Message Access Protocol (IMAP) port 143 will be use.

Now let’s take a scenario to explain the email flow. John at john@philsecure.com open up his email client using Outlook express and type a email to his wife, Alice at Alice@philblog.com. After finishing his email, he clicked on “send”. Alice on the other hand, received a new incoming email on her email client. So what actually happen?

1) When John click “Send”, his email client send the email to his MTA using port 25.

2) The Email server at philsecure.com will received the address of the sender and the address of the recipient, as well as the body of the message. It will consider the email address as two parts: the recipient name (Alice) and the domain name (philblog.com). If the "to" address had been another user at philsecure.com, the Email server would simply hand the message to the server processing the POP3 or IMAP for philsecure.com and the mail will be sent to the appropriate user account.

3) Here, the email server will look up to the domain name server (DNS) for the IP address of the email server of philblog .com. The DNS replies with the IP address of the SMTP server that philblog.com operates. This IP referring to the Mail Exchanger (MX) IP address.

4) The email server of philsecure.com then send the mail to philblog.com according to the MX record it got from the DNS.

5) The email server of philblog.com received the email and send it to the server running POP3 or IMAP and it will then be deliver to the user’s account.

6) The user log on to its mail client depending on if it is using POP3 or IMAP to download the email.

That’s it! Email a simple yet wonderful technology.