Tuesday 20 December 2011

Its great to know about SMTP

We all are handling with loads of emails..But we are not aware of things happening behind. This Simple Mail Transfer Protocol (SMTP) is an Internet Standard email transmission across Internet Protocol (IP) networks. 


Let us know what exactly happens when we send emails. client applications usually use either the Post Office Protocol (POP) or the Internet Message Access Protocol (IMAP) on a proprietary system (such as Microsoft Outlook or Thunderbird) to access their mail box accounts on a mail server. As ”Picture speaks far more than words” we’ll deal this with a picture. 





  • MUA(Mail User Agent) 
  • MSA(Mail Submission Agent) 
  • MTA(Mail Transfer Agent) 
  • MDA(Mail Delivery Agent) 



From the above picture we can clearly arrive at how stuff works behind the email servers.

Our email client will act as the MUA’s.when we send the mails it searches for the MSA and this submits the mail to the MTA.This MTA is playing a very vital role in  transferring the mail to the MDA.Thereafter the mails are finally drop into the receiver’s mail box.




When we compose a message and press the Send button, here's what happens:

1. Outlook Express connects to the SMTP server at mail.yahoo.com using port 25.

2. Outlook Express has a conversation with the SMTP server, telling the SMTP server the address of the sender and the address of the recipient, as well as the body of the message.

3. The SMTP server takes the "to" address (sathish@yahoo.com) and breaks it into two parts: the recipient name (sathish) and the domain name (yahoo.com). If the "to" address had been another user at yahoo.com, the SMTP server would simply hand the message to the POP3 server for yahoo.com (using a little program called the delivery agent). Since the recipient is at another domain, SMTP needs to communicate with that domain.

4. The SMTP server has a conversation with a Domain Name Server, or DNS .It says, "Can you give me the IP address of the SMTP server for yahoo or gmail. The DNS replies with the one or more IP addresses for the SMTP server(s) that Server operates.

5. The SMTP server at yahoo.com connects with the SMTP server at gmail using port 25. It has the same simple text conversation that my e-mail client had with the SMTP server for Yahoo, and gives the message to the gmail The google server recognizes that the domain name for sathish is at , so it hands the message to gmail’s POP3 server, which puts the message in receipient mailbox.

If, for some reason, the SMTP server at Yahoo cannot connect with the SMTP server at Gmail, then the message goes into a queue. The SMTP server on most machines uses a program called sendmail to do the actual sending, so this queue is called the sendmail queue. Sendmail will periodically try to resend the messages in its queue. For example, it might retry every 15 minutes. After four hours, it will usually send you a piece of mail that tells you there is some sort of problem. After five days, most sendmail configurations give up and return the mail to you undelivered.


The SMTP server understands very simple text commands like HELO, MAIL, RCPT and DATA. The most common commands are:

· HELO - introduce yourself

· EHLO - introduce yourself and request extended mode

· MAIL FROM: - specify the sender

· RCPT TO: - specify the recipient

· DATA - specify the body of the message (To, From and Subject should be the first three lines.)

· RSET - reset

· QUIT - quit the session

· HELP - get help on commands

· VRFY - verify an address

· EXPN - expand an address

· VERB - verbose

If your very curious to try it from your terminal.follow the steps to do so.





No comments:

Post a Comment