CORNELL CS 5190 - Application Protocols: SMTP and others

Unformatted text preview:

12: Application Layer14: Application Protocols: SMTP and othersLast Modified: 2/3/2003 8:07:08 PM2: Application Layer2Electronic Mail2: Application Layer3Electronic MailThree major components:❒ user agents ❒ mail servers ❒ simple mail transfer protocol: smtpUser Agent❒ a.k.a. “mail reader”❒ composing, editing, reading mail messages❒ e.g., Eudora, Outlook, elm, Netscape Messenger❒ outgoing, incoming messages stored on serveruser mailboxoutgoing message queuemailserveruseragentuseragentuseragentmailserveruseragentuseragentmailserveruseragentSMTPSMTPSMTP2: Application Layer4Electronic Mail: mail serversMail Servers❒ mailbox contains incoming messages (yet to be read) for user❒ message queue of outgoing (to be sent) mail messages (if message cannot be delivered will stay in queue)❒ smtp protocol between mail servers to send email messages❍ Mail server is an SMTP client when sending mail❍ Mail server is an SMTP server” when receiving mail mailserveruseragentuseragentuseragentmailserveruseragentuseragentmailserveruseragentSMTPSMTPSMTP2: Application Layer5Electronic Mail: smtp [RFC 2821]❒ Uses tcp to reliably transfer email msg from client to server, port 25❒ direct transfer: sending server to receiving server❒ three phases of transfer❍ handshaking (greeting)❍ transfer of messages❍ closure❒ command/response interaction❍ commands: ASCII text❍ response: status code and phrase❍ Much like HTTP 2: Application Layer6SMTP History❒ SMTP has been around a long time ❍RFC done in 1982❍In use well before that❒ Messages must be in 7-bit ASCII (made sense in text-based early days)❒ Requires encoding for binary data (jpegs, etc.) in 7-bit ASCII (yuck!)22: Application Layer7Sample smtp interactionS: 220 hamburger.edu C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: <[email protected]> S: 250 [email protected]... Sender ok C: RCPT TO: <[email protected]> S: 250 [email protected] ... Recipient ok C: DATA S: 354 Enter mail, end with "." on a line by itself C: Do you like ketchup? C: How about pickles? C: . S: 250 Message accepted for delivery C: QUIT S: 221 hamburger.edu closing connection2: Application Layer8try smtp interaction for yourself:❒ telnet servername 25❒ see 220 reply from server❒ enter HELO, MAIL FROM, RCPT TO, DATA, QUIT commandsabove lets you send email without using email client (reader)❒How do you know the right server name? Trace it – does your mail data go in the clear?2: Application Layer9What is missing?❒ Some commands processed by SMTP protocol mirror mail headers we are used to seeing in our email messages (To, From, …), but are not the same things ❒ Email headers (To, From, CC, Subject, Date, ..) are considered part of the data by SMTP and are not processed SMTP server at all!❒ Email headers are processed by the mail reader software and ignored by SMTP❍ How is Bcc implemented?❒Another example of “protocol” layering (like HTML and HTTP)2: Application Layer10Mail message formatsmtp: protocol for exchanging email msgsRFC 2822: standard for text message format (format of data from smtp perspective)❒ header lines, e.g.,❍ To:❍ CC:❍ Subject:different from SMTP commands!❒ body❍ the “message”, ASCII characters onlyMessage headersMessage bodyblanklineSMTP Data2: Application Layer11Sample smtp interactionS: 220 hamburger.edu C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: <[email protected]> S: 250 [email protected]... Sender ok C: RCPT TO: <[email protected]> S: 250 [email protected] ... Recipient ok C: DATA S: 354 Enter mail, end with "." on a line by itself C: To: [email protected] C: Subject: dinner preferencesC: From: [email protected]:C: Do you like ketchup? C: How about pickles? C: . S: 250 Message accepted for delivery C: QUIT S: 221 hamburger.edu closing connection2: Application Layer12SMTP format❒ SMTP requires that message (header & body) be in 7-bit ascii❒ Certain character strings are not permitted in message (e.g., CRLF.CRLF). Thus message has to be encoded (usually into either base-64 or quoted printable)❒ SMTP server uses CRLF.CRLF to determine end of message32: Application Layer13What about sending pictures and other binary data?❒ Don’t try this by hand ☺❒ MIME: multimedia mail extension, RFC 2045, 2056❒ additional lines in msg header declare MIME content typeFrom: [email protected] To: [email protected] Subject: Picture of yummy crepe. MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Type: image/jpeg base64 encoded data ..... ......................... ......base64 encoded data multimedia datatype, subtype, parameter declarationmethod usedto encode dataMIME versionencoded data2: Application Layer14MIME types: ExtensibleContent-Type: type/subtype; parametersText❒ example subtypes: plain, htmlImage❒ example subtypes: jpeg, gifAudio❒ example subtypes: basic(8-bit mu-law encoded), 32kadpcm (32 kbps coding)Video❒ example subtypes: mpeg, quicktimeApplication❒ other data that must be processed by reader before “viewable”❒ example subtypes: msword, octet-stream 2: Application Layer15Multipart TypeFrom: [email protected] To: [email protected] Subject: Picture of yummy crepe. MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=98766789--98766789Content-Transfer-Encoding: quoted-printableContent-Type: text/plainDear Bob, Please find a picture of a crepe.--98766789Content-Transfer-Encoding: base64Content-Type: image/jpegbase64 encoded data ..... ......................... ......base64 encoded data --98766789--2: Application Layer16Spam/forged mail❒ “Received:” and “MessageID” headers are part of the data❍ Accurate and helpful from legitimate servers and user agents❒Start with a legitimate server you trust❍ Don’t relay messages from a site outside your domain to another host outside your domain❍ Verify the Mail From field (resolvable domain and matching IP address)❍ Refuse traffic from known spammers2: Application Layer17Sample SpamFrom [email protected] Sat Sep 4 16:55:41 1999 Received: from cs2.CS.Berkeley.EDU (cs2.CS.Berkeley.EDU [169.229.60.56])by mnemosyne.CS.Berkeley.EDU (8.9.1a/) with ESMTP id QAA20836 for <[email protected]>;Sat, 4 Sep 1999 16:55:38 -0700 (PDT) Received: from mail.everfaster.com (mail.everfaster.com [197.46.220.4])by cs2.CS.Berkeley.EDU (8.9.1a/8.6.6.Beta11) with ESMTP id LAA18735 for <[email protected]>; Sat, 4Sep 1999 16:55:04


View Full Document

CORNELL CS 5190 - Application Protocols: SMTP and others

Download Application Protocols: SMTP and others
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Application Protocols: SMTP and others and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Application Protocols: SMTP and others 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?