Close or Esc Key

Arduino Projects   |   Raspberry Pi   |   Electronic Circuits   |   AVR   |   PIC   |   8051   |   Electronic Projects

Email: Working of Email

Written By: 

Anshul Thakur

 

Since the dawn of time, communication has played a pivotal role in advance of every great civilization. It has been a constant endeavor to convey things in a fast and secure manner in the absence of which, great empires have just succumbed to crisis. There is an old saying that highlights the feat that a little miscommunication achieved, ‘For the want of a nail, a horseshoe was lost. For the want of a horseshoe, the steed was lost. For the want of a steed, the message was not delivered. For the want of that undelivered message, the war was lost.’ The means to transport and deliver messages have evolved ever since. From barefoot messengers, horse riders and pigeons to organized postal services carrying letters in parchment form and then, to telegraph and modern electronic mail systems delivering messages over streams of electrons in a wire or over wireless electromagnetic links, the entire concept of sending mails has gone a thorough makeover. Of all the modern means of communication, electronic mail is one such means that still encapsulates the core ideology of writing, and adapting it to modern times, ensuring accurate and timely delivery.
Symbolic Presentation of Email
Fig. 1:  Symbolic Presentation of Email

History
Message exchange has existed in some form or the other since the time of timeshared computers. Compatible Time-Sharing System (CTSS) started off in MIT in 1961 where multiple users could log on using remote dial-up terminals and store files online. To share messages, users made files with the names of the person being addressed to and put it up on the shared folder. In 1971, Ray Tomlinson developed the first ARPANET email application by adding a program CPYNET on top of the local email programs SNDMSG and READMAIL for the TENEX OS. This piece of code was capable of copying files over the network and used the ‘@’ symbol to combine user and host names as a part of its addressing system. Though it was command line driven, it set up the basic model that still is the framework of email systems. Until the Simple Mail Transport Protocol (SMTP) was developed in 1980’s, the commands like MAIL and MLFL were added to the FTP program to provide network transport functionalities to emails on ARPANET. Among other features, SMTP allowed the sending of a single message to more than one addressee on a domain.
 
Lawrence Roberts, wrote a program named RD for TENEX which was later improved into NRD by Barry Wessler to sort email headers by date and subject allowing users to sort their mails and various other features. Marty Yonke later recoded SNDMSG and NRD into an independent program WRD (later renamed to BANANARD) which became the first program to integrate reading and sending mails on a single application. Features like forwarding, configurable interfaces and Answer command (which made the mails look more like threaded conversations rather than independent mails) were added upon BANANARD by John Vittal and the program was named MSG. This could be considered to be the first modern email program. In 1975, DARPA initiated a program to develop mailing capabilities for UNIX environment as a result of which, Mail Handler (MH) was developed, which became the standard email application for Unix. Standardization followed in 1977 in the form of RFC 733 specifications which was later revised to RFC 822. The ability to deliver mail over dial up connections which weren’t connected to ARPANET was developed at University of Delaware by the name of Multi-purpose Memo Distribution Facility (MMDF).
 
Various other people like Doug Kingston enhanced it like developing the TCP/IP layer and integrated into other networks like CSNET. Eric Allman later developed ’delivermail’ which integrated multiple email transport services, creating a sort of switch and became the most popular SMTP server used on internet. The first commercial email service was launched in 1988 through CNRI for experimental use. By 1993 network providers like AOL and Delphi had started to connect their email systems to internet, beginning the era of adoption of internet email as a global standard. The term ‘email’ was copyrighted by V.A. Shiva Ayyadurai on 30th August 1982.
 
Structure of E-Mail
Electronic mail or simply email is a method of sending and receiving messages in a digital form between users. Primarily it is a simple text message addressed to another user who is called the recipient. With the addition of features like attachments along with email messages, the size of the message might have increased, but they still are text messages.
 
An email message contains 3 components: envelope, header and a message body. Envelope is a part that the user of email would never see. It is an internal process used in routing the email to the appropriate destination. Body is the part of the message that contains the useful data meant for the recipient. The header consists of the control information which includes the sender’s address and the destination address in its minimalistic form. Further it may contain the subject header information and the time stamp of various mail transfer agents. Some of these values may be taken directly from the envelope information. A typical header may look like one in the figure below:
 
A Typical Email Header
Fig. 2: A Typical Email Header
 
There is an additional feature of adding a signature block to an email. This can be the user’s name, title or legal notice that might be added to all emails of that person. Typing the same thing in each mail can get tedious, thus this signature which is automatically appended at the end of the body of the email may be used instead. A signature may be created following certain rules called netiquette (network etiquette).
 

Email Working

How does E-Mail work
Each domain registered on the internet has an email server that manages all email addresses for that domain. Thus each email has a very simple and elegant structure like ‘abcd@pqr.xxx’ where each domain’s email server manages all the accounts associated with that domain. The name following the ‘@’ sign is the name of the domain. Thus any email may be delivered to a user by resolving the IP address of the domain over the internet using DNS systems and then transferring the email to the recipient at that domain using standard SMTP. There can be second and even third level domains being addressed to in the emails. The whole concept of Domain Name architecture stemmed out of the need of providing relays between the different networks which were not directly connected. In case DNS were not developed, we would have to remember the entire addresses of the hops occurring in transition of the email from our network to a different network.
 
An email system contains many parts playing various roles throughout the lifecycle of an email. These include:
Mail User Agent (MUA): These may be offline software clients like Outlook, Thunderbird etc. or web based clients like mail.yahoo.com, mail.google.com etc. which allow the user to read mails, create mails and send mails. These are configured to connect to a MTA and MAA for sending and receiving mails.
 
Mail Transport Agent (MTA): It is a software that accepts emails from MUA and performs its routing over various hops (relays) to its destination. The receiving MTA also performs a few security related functions like rejection and redirection. It works in a store and forward fashion.
 
Mail Delivery Agent (MDA): A MDA performs functions like mail processing, virus scanning, spam filtering, sorting and forwarding email to mailboxes. It is the MDA that needs to be configured on the user’s location. It is often called the mailer-daemon and it is the MDA that generates the failure or bounce message in case of errors.
 
Mail Access Agent (MAA): Every one cannot stay online 24x7. During the time a user is offline, the mails addressed to him are stored by the MDA on server hard disks. These mailboxes are stored on remote servers provided by service providers like Gmail, Yahoo mail, Rediff mail etc. When the user comes online, the MUA connects to these remote servers through a MAA server. After authentication of the user, the MAA downloads a copy of the mailbox to the MUA where the user may read, store or delete it.
 
Mail Submission Agent (MSA): It is an additional layer of filtering to facilitate the MDA. In recent times, more than 90% of the emails that are directed to any user are spam and an MSA takes care of filtering such spam and/or viruses before they are given to a MTA or MDA.
 
The flow of a message from a sender to a recipient is shown below.
 
Block Diagram Explaining Working of Emails
Fig. 3: Block Diagraam Explaining Working of Emails

Email Protocols

E-Mail Protocols
Different parts of the mailing system communicate with each other in defined message formats and rules called protocols. There are numerous standard protocols defined, out of which a few important ones are:
 
Simple Mail Transfer Protocol (SMTP): SMTP and its modern form Enhanced SMTP are used by an MUA to talk to the MTAs and by the MTAs to talk amongst themselves. It is the most widespread protocol used for mailing purposes and is defined in RFC-5321 and 5322. It is a simple text based protocol in which the sender communicates with the receiver by issuing command strings over a TCP connection. A single transaction may consist of command sequences like MAIL (to establish Return Path) ->RCPT (To establish recipients) ->DATA (To send message header and body). The replies to such commands may be intermediate replies for DATA which may be positive replies, negative replies or even permanent failure replies.
 
Post Office Protocol (POP): Also known as POP3, it is used between a MUA and MAA and is defined in RFC-1939. Being cheap and simple, it is popular among ISPs. Here, a username and password is sent following which, entire mailbox can be downloaded to the MUA. This has only one option, either to retain the mails on the server or to delete them after downloading.
 
Internet Message Access Protocol (IMAP): This is yet another protocol used between a MUA and MAA. It is more powerful and flexible than a POP, but is more taxing on the ISPs in resource count. It allows selective message downloading and deleting among many other features. It is defined by RFC-3501.  
 
The mail programs used to drop the 8th bit of every byte to attain 12.5% speed up. This however couldn’t be used when formats like GIFs and binary files were sent as attachments. Thus another protocol Multipurpose Internet Mail Extensions (MIME) was developed for the same which provided for the styled text wherein the body of the message was split into several parts by MIME separator strings and each part was separately encoded and decoded. MIME is invisible to MAA, MDA and MTAs. But it is almost obsolete since users started using HTML for emails.
 
Emails have definitely made communication faster and better for all and sundry. But they do have their fair share of annoyances too. The prime most is Spam. Spam is any sort of unsolicited email that a user receives. Though much effort has been put in by service providers to filter out most kinds of spam, some variants are still too deceptive for the servers to figure out. Spam may range from advertisements to worm attacks, viruses or hoaxes that might lure users into letting out their passwords (phishing). There are privacy issues related as there isn’t any firm body or law governing the privacy issues over internet. With the use of encrypted mails using different encryption methods like the public key cryptography, this problem can however be rectified to a certain limits. People with malicious intent may fire denial of service attacks on the servers of targeted organizations with Mail-bombs etc. or embedded malicious code.
 
But despite of this, emails are easy to use, fast and easy to prioritize. Though emails cannot take away the aesthetic appeal that has always been associated with a hand written note dispatched over postal services, these are the best medium to communicate on a frequent basis where both the parties have very little waiting time and the environment is more of a conversation than a mere verbose.

 

 

Comments

I am a pharmacist and live in Iran. My email is Microsoft: dr.farhad.najafi@hotmail.com If possible, please send me a working email, because I am teaching at the university. Thanks a lot.