INFS2052 lecture 2.7

Electronic mail and message content

References

Tanenbaum section 7.4 Electronic Mail

RFC 821 - Simple Mail Transfer Protocol

RFC 822 - Message format

RFC 2045 - MIME multipurpose Internet mail extensions - format of message bodies

RFC 2046 - MIME - media types

Electronic mail - recall why and what

Internet email - RFC 821 and 822

One of the earliest open application protocols - 1982

Very simple protocol for transferring human-readable mail messages.

Messages include envelope and content information.

OSI email - X.400

Open Systems alternative to Internet email.

A more complicated family of protocols over the OSI 7 layer stack, with

  • more powerful functions than the original SMTP - acknowledgements, deliver after date, abandon if not delivered before date...
  • more complex message encoding ASN.1
  • more complex protocols for transfers between
    UA, MTA and MS (message store)
  • Little implemented, interoperability function largely replaced by Internet mail.

    Email handling processes - agents

    User agent interacts with user:

  • browses inbuilt message store of received messages
  • displays chosen messages to user
  • prepares messages for sending
  • hands messages to transfer agent for transfer (or stores for local user)
  • Transfer agent sends and receives messages over network - client-server, connection via port 25.

    User Agents and Message Transfer

    There are very many examples of user agents:

  • elm, mailtool, emacs vm, xmh, Netscape mail, etc etc.
  • The user agent prepares the message from user interaction
    including message transfer header fields;
    expands user's address aliases

    The message transfer agent (such as UNIX sendmail) acts as client, makes a connection with an agent acting as server at the destination host computer.

    Messages are transferred with SMTP - simple mail transfer protocol
    often via intermediate mail hosts
    where address aliases may be expanded.

    Messages are commonly stored at receiver for
    later pickup by user agent

    OR
    transfer to further remote user using Post Office Protocol POP.

    Format of email messages - original - RFC 822

    Messages consist of

    From: somebody

    To: someone else

    Subject: something that you want to write about

    This format should be familiar to those who have looked at HTTP (see also lecture 5 in this series) - which is based on the RFC 822 standard.

    Tanenbaum fig. 7-42, Tanenbaum fig. 7-43 Some RFC 822 headers

    MIME - Multipurpose Internet Mail Extensions - RFC 2045

    Added to basic message format to allow

    Content-type:

    text/plain

    image/gif

    application/octet-stream

    can also specify more interpretation information,
    such as text/plain - character set in which the message is to be interpreted, using attribute=value notation added to type/subtype

    text/plain charset=us-ascii

    text/plain charset=iso8859-1

    Headers added by MIME - Tanenbaum fig. 7-44

    The MIME content types and subtypes - Tanenbaum fig. 7-45

    Example

    Tanenbaum fig 7-46 - multipart message

    HTTP and MIME extensions to RFC822 message formats

    These headers are also used in HTTP.

    When appearing in the header of a HTTP response, the client (browser) is informed how to display the message body.

    HTTP also adds further related headers, such as

    Content-encoding:

    [HTTP specification section 14.12, RFC 2068, HTTP/1.1]

    specifies compression method used for body data

    gzip

    compress

    Protocol for email message transfer RFC 821

    The transfer protocol is simple.

  • 4 character requests e.g. HELO, RCPT, MAIL
  • 3 decimal digit reply codes e.g. 200, 322, 345
  • all in 7-bit ASCII (printable ASCII) character set.
  • Connection oriented - assumes error free transport service (TCP).

    Client may transfer many messages in one session.

    SMTP protocol sequence - Halsall "Data communication,s computer networks and open systems" 3rd edition, Addison Wesley 1992, fig 12-6

    Example of message transfer - Tanenbaum fig. 7-47

    Email transfer encoding

    Needed to carry different types of data through the very low-ability RFC821 service of 7 bit ASCII characters only.

    MIME header Content-transfer-encoding:

    7bit - default if no header included

    8bit

    binary

    quoted-printable - 7 bit characters plus hex-encoding for extension set

    Now is winter=B4s ending=20

    just around the corner.

    base64 - groups of 24 bits grouped as 4x6 bits,
    each 6 bit group represented by a single printable ASCII character
    in A..Z, a..z, 0..9, +, /
    where = and == mean a short group of 8 or 16 bits at the end.

    AAUWBwACAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAPgAAABAAAAAJAAAATgAAACAA

    AAACAAAAbgAAAR5BZ2VuZGEgMy85NyBKdWx5VzZCTk1TV0QBAP////8AAAAAAAAAAAAA

    AAAAAAAAAAAAAAEAAAABAAAAAAAAAAAej0hu/+RwAS8ASG7/7Ehu//Bw+avtVE9Krv/s

    Zwa4rv8QQWdlbmRhIDMvOTcgSnVseSACAAIAVzZCTk1TV0QAAAIAVzZCTk1TV0QAAAAA

    AAAAAAAAAAAAAAAAAAAAAAAAAACv7/lAAABuAAAAAR5QIm7/4CNoAAQAGCBu//AgUCJu

    /+AjUAAISgVnHkoGZxogeAK2IGgBGHAIwKgACGcKLy7/4E66BopYT1mPqNgmXy8KLwuo

    3C8LcAE/AD8AqOEvCi8LLwqo5i8LqNlVjy8u/+AvLgAULwpwDavtNh9nDAxD/4BnBj1D

    ABhgYgxD/4BmAAABAAAAAQAAAAAAAAAAHgKf7IwdBAAAABwAHv//


    Lecture Notes Index Lecture 10 Lecture 8

    Last modified: Tue Mar 30 11:21:15 EST 1999
    Queries to : help3056@iwaki.anu.edu.au