Dr. Mark Humphrys

School of Computing. Dublin City University.

Home      Blog      Teaching      Research      Contact

My big idea: Ancient Brain


CA114      CA170

CA668      CA669      Projects


7.2 Email


Message transfer agents - Move email across the network.

Source machine establishes TCP socket connection to port 25 on destination machine.

Sample SMTP conversation delivering an email from client C to server S.


DCU mail servers

It was easier to see how mail servers worked when DCU had its own mail servers. But these are being phased out.

Now all DCU email is done through a Gmail service.

Incoming server: imap.gmail.com
Outgoing server: smtp.gmail.com 
Of course, these "server" addresses have entire server farms behind them.
If any DCU mail servers still running, try these out:
$ telnet mail.dcu.ie 25

$ telnet mailhost.computing.dcu.ie 25
214-2.0.0 This is sendmail version 8.12.10
214-2.0.0 Topics:
214-2.0.0       HELO    EHLO    MAIL    RCPT    DATA
214-2.0.0       RSET    NOOP    QUIT    HELP    VRFY
214-2.0.0       EXPN    VERB    ETRN    DSN     AUTH
214-2.0.0       STARTTLS

Email headers

Basic email header fields.
Message consists of:
Header fields
(blank line)
Message body

Other email header fields.
Applications can invent their own. Must begin with X-.
e.g. X-Spam-Status:

Email headers in forensic work

I receive an unpleasant email from Hotmail.
But where is it actually from? America?

"View - Headers - All" (or something similar) in your email client and you can see the actual email headers.
These reveal the path it travelled and also the original IP address, which you can then look up.
Lookup here said it was Eircom, who I then complained to.
I could even see what part of Ireland this came from.


MIME encoding for binary data to be sent by email (designed for text data).
Encodes it as simple plain text 7-bit ASCII chars.

base64 encoding: For binary attachments.
Can encode any binary stream whatsoever as (a really safe subset of) 7-bit ASCII.
"The resultant base64-encoded data has a length that is approximately 33% greater than the original data"

Content-Type: application/msword; name="Postgrad_Prospectus_Research.doc";
 x-mac-type="42494E41"; x-mac-creator="4D535744"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Postgrad_Prospectus_Research.doc"


Quoted-printable encoding: For basically plaintext with 8-bit ASCII chars.
Encodes everything as 7-bit ASCII. The 8-bit chars are encoded as: "=nn".
"=" itself encoded as "=3D".

I have had several enquiries =
IEEE Xplore (full-text access to IEEE and IEE publications) and would =
like to=20
inform you of some recent developments. As part of the<A=20
href=3D"http://www.library.dcu.ie/news/index.htm#HES"> IReL</A> =
initiative (funded=20
by SFI and HEA) to provide increased access to e-journals, negotiations =
for IEEE=20
Xplore are at an advanced stage.

MIME headers.

MIME content types.

HTTP uses these too.

Standalone email clients

Email clients - Read and send email.

Mail server: mail.isp.com receives and stores your email when you are offline.

To read it you might:

  1. Use a web interface the ISP has set up at: www.isp.com

  2. Use a standalone client to communicate with mail.isp.com over the network, using various protocols.

Both types of email client (web clients and standalone clients) are popular.

(a) mail.isp.com collects your email.
(b) You periodically use a client to connect to mail.isp.com


The original protocol for standalone clients.

POP3 client sets up TCP connection to the mail server at port 110.

Sample POP3 conversation to retrieve 3 email messages.
You can retrieve and then delete from server. Or retrieve and leave on server.


Updated protocol for standalone clients.

Web-based email

Web-based email like Gmail

Keep everything on server (like IMAP). No standalone client. Just web browser.

Not everyone uses web client only:

Note that most big web email services can be accessed through either web client or standalone client.
Gmail supports IMAP access.

Proprietary email protocols


2012 survey shows the three popular ways of reading email: desktop web browser, desktop standalone client, and mobile.

Survey of email clients, 2012 shows a mix of mobile and desktop clients.
Huge amount of reading email on Apple mobile devices.
Also shows a mix of webmail and standalone email clients.

Survey of email clients, 2015

ancientbrain.com      w2mind.org      humphrysfamilytree.com

On the Internet since 1987.

Wikipedia: Sometimes I link to Wikipedia. I have written something In defence of Wikipedia. It is often a useful starting point but you cannot trust it. Linking to it is like linking to a Google search. A starting point, not a destination. I automatically highlight in red all links to Wikipedia and Google search and other possibly-unreliable user-generated content.