80 likes | 290 Views
Email Neil Tang 12/01/2008. Outline. Email Message Format SMTP Mail Reader. Email Message Format (RFC822). Two parts: header and body Header: The header includes a series of < CRLF > -terminated lines and each header line contains a type and value separated by a colon.
E N D
EmailNeil Tang12/01/2008 CS440 Computer Networks
Outline • Email Message Format • SMTP • Mail Reader CS440 Computer Networks
Email Message Format (RFC822) • Two parts: header and body • Header: The header includes a series of <CRLF>-terminated lines and each header line contains a type and value separated by a colon. • Type: From, To, Subject, Date, Received, … CS440 Computer Networks
Email Message Format (MIME) • New MIME header lines describe the data being carried in the message body. They include MIME-Version (the version of MIME being used), Content-Description: (a human-readable description of what’s in the message), Content-Type: (the type of data contained in the message), and Content-Transfer-Encoding: (how the data in the message body is encoded). • Content-Type: image/jpeg, text/plain, text/richtext, application/msword multipart/mixed. • An Email message contain only ASCII characters. The binary data sequence will be divided to 6-bit pieces, each of which maps onto one of 64 valid ASCII characters (52 upper- and lowercase letters, the 10 digits 0 through 9, and the special characters + and /). • Content-Transfer-Encoding: base64 CS440 Computer Networks
SMTP • Mail reader: the client program used by users to read and compose an email message. • Mail daemon: the process which sends or receives email messages. • Mail readers give the daemon messages they want to send to other users, the daemon uses SMTP running over TCP to transmit the message to a daemon running on another machine. CS440 Computer Networks
SMTP • SMTP is an ASCII based protocol. • SMTP involves a sequence of exchanges between the client and the server. • In each exchange, the client posts a command (e.g., HELO, MAIL, RCPT,DATA, QUIT) and the server responds with a code (e.g., 250, 550, 354, 221). The server also returns a human-readable explanation for the code (e.g., code 550: No such user). CS440 Computer Networks
SMTP (Example) • HELLO cs.princeton.edu • 250 Hello daemon@mail.cs.princeton.edu [128.12.169.24] • MAIL FROM:<Bob@cs.princeton.edu> • 250 OK • RCPT TO:<Alice@cisco.com> • 250 OK • RCPT TO:<Tom@cisco.com> • 550 No such user here • DATA • 354 Start mail input; end with <CRLF>.<CRLF> • Blah blah blah... • ...etc. etc. etc. • <CRLF>.<CRLF> • 250 OK • QUIT • 221 Closing connection CS440 Computer Networks
Mail Reader • The user uses a mail reader to actually retrieve his or her messages from the mailbox, read them, reply to them, and possibly save a copy for future reference. • Usually, the user accesses his or her mailbox from a remote machine using another protocol, such as the Post Office Protocol (POP) or the Internet Message Access Protocol (IMAP). CS440 Computer Networks