There are no notfications.

E-mail agents and e-mail infrastructure

E-mail agents and e-mail infrastructure
Author: Stefán Örvar Sigmundsson
Initial publication:
Last updated:
Written in: English (United Kingdom)

The e-mail infrastructure as we know it today is simultaneously both young and antiquated. The first electronic messaging protocols appeared in the 1960s but the groundwork for today's e-mail communications was laid in the 1980s. Instead of there being a single comprehensive e-mail communications standard there are in fact multiple standards that complement each other. This has resulted in a lot of confusion for average users and IT newcomers. The purpose of this article is to clarify common misconceptions about e-mail agents and the different roles they play.

Background

E-mail is composed, viewed, sent and received using e-mail client applications running on personal computers but stored on e-mail server computers. For most people, the e-mail server computer is not the same computer used to compose, view, send and receive e-mails. It is not practical for all users to have their own e-mail server computers as they must be running at all time in order not to miss e-mails being sent.

Communication

When an e-mail has been composed, an e-mail client application sends it to an e-mail server computer. The sender's e-mail server computer then forwards the e-mail to the recipient's e-mail server computer.

Example 1: Adam (adam@example.com) wants to send an e-mail to Steve (steve@example.com). They are both using the same e-mail service so the e-mail goes straight from the sender's e-mail client application to the recipient's e-mail server computer:

  1. Adam's client: sends e-mail to example.com's server.
  2. example.com's server: receives e-mail from Adam's client.

Example 2: Adam (adam@example.com) wants to send an e-mail to John (john@example.org). They are using different e-mail services so the e-mail goes first from the sender's e-mail client application to the sender's e-mail server computer. After that the sender's e-mail server computer forwards the e-mail to the recipient's e-mail server computer:

  1. Adam's client: sends e-mail to example.com's server.
  2. example.com's server: receives e-mail from Adam's client.
  3. example.com's server: sends e-mail to example.org's server.
  4. example.org's server: receives e-mail to example.com's server.

When a user is ready to view their e-mails, an e-mail client application requests them from an e-mail server computer.

Example: Steve (steve@example.com) wants to view his e-mails:

  1. Adam's client: requests e-mails from example.com's server.
  2. example.com's server: receives request for e-mails from Adam's client.
  3. example.com's server: provides Adam's client with e-mails.
  4. Adam's client: receives e-mails from example.com's server.

Protocols

When e-mails are sent from client applications to server computers, a protocol called Simple Mail Transfer Protocol (SMTP) is most commonly used. When e-mails are requested by client applications for viewing, a few different protocols can be used. The most common protocol for receiving e-mails is Internet Message Access Protocol (IMAP). An older protocol called Post Office Protocol (POP) is also commonly used but will become less so with time. Microsoft uses its own proprietary protocol called Messaging Application Programming Interface (MAPI) for its own proprietary client applications and server computers.

Protocol Purpose Implementation
Simple Mail Transfer Protocol (SMTP) Send e-mails Universal
Internet Message Access Protocol (IMAP) Receive e-mails for viewing Common
Post Office Protocol (POP) Receive e-mails for viewing Common
Messaging Application Programming Interface (MAPI) Receive e-mails Microsoft only

E-mail accounts

E-mail accounts are used to authenticate users communicating with e-mail server computers. They can correspond to actual user accounts on server computers but they are most often records in database systems. The e-mail address adam@example.com could refer to a user account called adam on an e-mail server identified as example.com or, more likely, the e-mail server computer example.com keeps its e-mail accounts stored in a database system which it then must query every time an e-mail is sent or received.

E-mail storage

E-mail boxes are used to store e-mails on server computers and in some cases personal computers. For each e-mail account there typically exists an e-mail box. The two main e-mail box formats are Maildir and mbox. Maildir is the newer format indented to replace mbox.

Format Storage
Maildir Each e-mail is stored in a separate file per user.
mbox All e-mails are stored in a single file per user.

Mail agents

The terms used so far, e-mail client application and e-mail server computer, have been purposely vague. An e-mail server computer can be a computer like any other, therefore there must be some sort of software running on it that handles the e-mail service.

The different software involved in e-mail communications are formally referred to as mail agents. They should be thought of as roles more so than individual pieces of software as a single application may assume the role of more than one mail agent.

User

A mail user agent (MUA) is an application that enables users to compose and view e-mails. MUAs are what most people call e-mail clients. They typically do not send e-mails on their own but delegate that task to other pieces of software. For now, the sending software will be referred to simply as pusher.

Example: Adam (adam@example.com) wants to send an e-mail to Steve (steve@example.org):

  1. Adam's PC: MUA provides pusher with e-mail.
  2. Adam's PC: pusher sends e-mail to example.com's server.
  3. example.com's computer: receives Adam's e-mail from Adam's pusher.
  4. example.com's computer: sends Adam's e-mail to example.org's server.
  5. example.org's computer: receives Adam's e-mail from example.com's server.

MUAs are capable of requesting and receiving e-mails from server computers.

Example: Steve (steve@example.com) wants to view his e-mails:

  1. Steve's PC: MUA requests e-mails from example.com's server.
  2. example.com's computer: receives request from Steve's MUA.
  3. example.com's computer: provides Steve's MUA with e-mails.
  4. Steve's PC: MUA receives e-mails from example.com's server.

MUAs can also be web-based. Users must then compose and view e-mails using web browsers. The e-mails are stored on remote server computers and the users have no local copy on their personal computers.

Submission

A mail submission agent (MSA) is a piece of software that receives e-mails from MUAs and forwards them to their senders' e-mail server computers, which in return forward them to their recipients' e-mail server computers. A MSA is a pusher as described above although there is another more common type of pusher described below.

Example: Adam (adam@example.com) wants to send an e-mail to Steve (steve@example.org):

  1. Adam's PC: MUA provides MSA with e-mail.
  2. Adam's PC: MSA sends e-mail to example.com's server.
  3. example.com's computer: receives e-mail from Adam's MSA.
  4. example.com's computer: sends e-mail to example.org server.
  5. example.org's computer: receives e-mail from example.com's server.

It is important to note that MSAs are not commonly implemented as individual pieces of software but more commonly as part of another form of pusher.

Transfer

A mail transfer agent (MTA) is a piece of software that enables users to send e-mails. MTAs are what most people call e-mail servers. MTAs are the primary pieces of software running on e-mail server computers as they both receive e-mails being sent and also forward them to the e-mail server computers of the recipients. MTAs are also the most common type of pusher running on personal computers waiting for MUAs to invoke them since they commonly implement the roles of MSAs.

Example: Adam (adam@example.com) wants to send an e-mail to Steve (steve@example.org):

  1. Adam's PC: MUA provides MSA/MTA with e-mail.
  2. Adam's PC: MSA/MTA sends e-mail to example.com's MTA.
  3. example.com's computer: MTA receives e-mail from Adam's MSA/MTA.
  4. example.com's computer: MTA sends e-mail to example.org's MTA.
  5. example.org's computer: MTA receives e-mail from example.com's MTA.

As demonstrated above, both personal computers and server computers have their own MTA. On a personal computer the MTA is only used to forward e-mails from MUAs to e-mail server computers but on server computers they receive e-mails from personal computer, receive e-mails from other server computers (senders) and forward them to other server computers (recipients).

Delivery

A mail delivery agent (MDA), sometimes called local delivery agent (LDA), is a piece of software that gets called by MTAs to organise e-mails on server computers. MTAs both send and receive e-mails in PC-to-server communication (as well as server-to-server communication) but when e-mails have reached their final destination MTAs need to permanently store them. The way MTAs store e-mails is primitive and so MDAs are used to properly organise e-mails on server computers.

Example: Adam (adam@example.com) wants to send an e-mail to Steve (steve@example.org):

  1. Adam's PC: MUA provides MTA with e-mail.
  2. Adam's PC: MTA sends e-mail to example.com's MTA.
  3. example.com's computer: MTA receives e-mail from Adam's MTA.
  4. example.com's computer: MTA sends e-mail to example.org's MTA.
  5. example.org's computer: MTA receives e-mail from example.com's MTA.
  6. example.org's computer: MDA receives e-mail from MTA.
  7. example.org's computer: MDA moves e-mail into Steve's e-mail box.

Retrieval

A mail retrieval agent (MRA) is a piece of software that runs on personal computers and retrieves e-mails from server computers. MUAs are typically used to request and receive e-mails from server computers but some users prefer to use MRAs. MUAs store e-mails in their own custom formats whereas MRAs store e-mails in the same formats as used by MDAs. MUAs can display e-mails whereas MRAs are not intended for that purpose so users must navigate to their e-mail boxes on their personal computers.

Example: Steve (steve@example.com) wants to view his e-mails:

  1. Steve's PC: MRA requests e-mails from example.com's server.
  2. example.com's computer: receives request from Steve's MRA.
  3. example.com's computer: provides Steve's MRA with e-mails.
  4. Steve's PC: MRA receives e-mails from example.com's server.

MAPI/IMAP/POP3 servers

So far it has been stated that server computers receive requests from MUAs and MRAs for e-mails and respond by providing them with the e-mails. Server computers however have no understanding of such requests and can not respond to them on their own. Server computers responsible for e-mail services must run pieces of software that deal with requests from MUAs and MRAs. They do so by implementing one or more of the protocols for such communication.

Example: Steve (steve@example.com) wants to view his e-mails:

  1. Steve's PC: MUA/MRA requests e-mails from example.com's MAPI/IMAP/POP3 server.
  2. example.com's computer: MAPI/IMAP/POP3 server receives request from Steve's MUA/MRA.
  3. example.com's computer: MAPI/IMAP/POP3 server provides Steve's MUA/MRA with e-mails.
  4. Steve's PC: MUA/MRA receives e-mails from example.com's MAPI/IMAP/POP3 server.

It is interesting to note that this role has not been given a name that agrees with the pattern of mail role agent (MxA).

Popular e-mail software

MUAs

Client Developer Operating system Software licence
Evolution The GNOME Project Linux (GNOME) GNU General Public License
KMail KDE Linux (KDE) GNU General Public License
Microsoft Outlook Microsoft Corporation Microsoft Windows, OS X Proprietary
Mozilla Thunderbird Mozilla Foundation Cross-platform Mozilla Public License

MUAs (web-based)

Client Developer Operating system Software licence
Internet Messaging Program Horde LLC Cross-platform GNU General Public License
Roundcube Unincorporated Cross-platform GNU General Public License
SquirrelMail Unincorporated Cross-platform GNU General Public License

MSAs/MTAs

Client Developer Operating system Software licence Notes
Courier Mail Server Unincorporated Linux, Unix GNU General Public License Also an IMAP/POP3 server.
Exim Unincorporated Linux, Unix GNU General Public License
Microsoft Exchange Server Microsoft Corporation Microsoft Windows Proprietary Also an IMAP/MAPI//POP3 server.
Postfix Unincorporated Linux, Unix IBM Public License
qmail Unincorporated Linux, Unix Public domain
Sendmail Sendmail, Inc. Cross-platform Sendmail License

MDAs

Client Developer Operating system Software licence Notes
Dovecot Unincorporated Linux, Unix MIT License Also an IMAP/POP3 server.
maildrop Unincorporated Linux, Unix GNU General Public License Used by Courier Mail Server.
procmail Unincorporated Linux, Unix GNU General Public License Development discontinued.

MRAs

Client Developer Operating system Software licence
Fetchmail Unincorporated Linux, Unix GNU General Public License
getmail Unincorporated Linux, Unix GNU General Public License