Electronic mail protocol evolution Email standards Electronic Mail

  • Slides: 41
Download presentation
Electronic mail – protocol evolution

Electronic mail – protocol evolution

E-mail standards

E-mail standards

Electronic Mail outgoing message queue user mailbox Three major components: • user agents •

Electronic Mail outgoing message queue user mailbox Three major components: • user agents • mail servers • simple mail transfer protocol: SMTP, TCP port 25 User Agent • a. k. a. “mail reader” • composing, editing, reading mail messages • e. g. , Eudora, Outlook, elm, Netscape Messenger • outgoing, incoming messages stored on server user agent mail server SMTP mail server user agent SMTP user agent mail server user agent

SMTP (RFC 821)

SMTP (RFC 821)

Sample SMTP interaction: TCP port 25 S: C: S: C: C: C: S: 220

Sample SMTP interaction: TCP port 25 S: C: S: C: C: C: S: 220 hamburger. edu HELO crepes. fr 250 Hello crepes. fr, pleased to meet you MAIL FROM: <alice@crepes. fr> 250 alice@crepes. fr. . . Sender ok RCPT TO: <bob@hamburger. edu> 250 bob@hamburger. edu. . . Recipient ok DATA 354 Enter mail, end with ". " on a line by itself Do you like ketchup? How about pickles? . 250 Message accepted for delivery QUIT 221 hamburger. edu closing connection

Mail Standard RFC 822 • • • Published in 1982 Lines no longer than

Mail Standard RFC 822 • • • Published in 1982 Lines no longer than 1000 char Message body - plain US-ASCII text Message header lines - plain US-ASCII text Limit on message length

RFC 822 format

RFC 822 format

RFC 822 restrictions • • • no multiple objects in a single message no

RFC 822 restrictions • • • no multiple objects in a single message no multi-part message bodies no non-textual bodies no X. 400 messages can be gatewayd no multifont messages

ASCII times are over! Now we want: • National language support • Possibility to

ASCII times are over! Now we want: • National language support • Possibility to send – pictures – audiofiles – other applications – video files – multimedia applications

MIME - Multipurpose Internet Mail Extension RFC 2045 -2048 obsolete RFC 1521, 1522, 1590

MIME - Multipurpose Internet Mail Extension RFC 2045 -2048 obsolete RFC 1521, 1522, 1590 • RFC 2045 Format of Internet Message Bodies • RFC 2046 Media Types • RFC 2047 Message Header Extension for Non-ASCII Text • RFC 2048 Registration Procedures To solve RFC 822 restrictions without serious incompatibilities with it

MIME

MIME

MIME types and sub-types

MIME types and sub-types

base 64 encoding

base 64 encoding

Mail message format SMTP: protocol for exchanging email msgs RFC 822: standard for text

Mail message format SMTP: protocol for exchanging email msgs RFC 822: standard for text message format: • header lines, e. g. , – To: – From: – Subject: different from SMTP commands! • body – the “message”, 7 -bit ASCII characters only header body blank line

Message format: multimedia extensions • MIME: multimedia mail extension, RFC 2045, 2056 • additional

Message format: multimedia extensions • MIME: multimedia mail extension, RFC 2045, 2056 • additional lines in msg header declare MIME content type MIME version method used to encode data multimedia data type, subtype, parameter declaration encoded data From: alice@crepes. fr To: bob@hamburger. edu Subject: Picture of yummy crepe. MIME-Version: 1. 0 Content-Transfer-Encoding: base 64 Content-Type: image/jpeg base 64 encoded data. . . . . base 64 encoded data

Multipart Type From: alice@crepes. fr To: bob@hamburger. edu Subject: Picture of yummy crepe. MIME-Version:

Multipart Type From: alice@crepes. fr To: bob@hamburger. edu Subject: Picture of yummy crepe. MIME-Version: 1. 0 Content-Type: multipart/mixed; boundary=98766789 --98766789 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Dear Bob, Please find a picture of a crepe. --98766789 Content-Transfer-Encoding: base 64 Content-Type: image/jpeg base 64 encoded data. . . . . base 64 encoded data --98766789 --

Multipart Type From: alice@crepes. fr To: bob@hamburger. edu Subject: Picture of yummy crepe. MIME-Version:

Multipart Type From: alice@crepes. fr To: bob@hamburger. edu Subject: Picture of yummy crepe. MIME-Version: 1. 0 Content-Type: multipart/mixed; boundary=Start. Of. Next. Part --Start. Of. Next. Part Dear Bob, Please find a picture of a crepe. --Start. Of. Next. Part Content-Transfer-Encoding: base 64 Content-Type: image/jpeg base 64 encoded data. . . . . base 64 encoded data --Start. Of. Next. Part Do you want the reciple?

Mail access protocols user agent SMTP sender’s mail server access protocol receiver’s mail server

Mail access protocols user agent SMTP sender’s mail server access protocol receiver’s mail server • SMTP: delivery/storage to receiver’s server • Mail access protocol: retrieval from server – POP: Post Office Protocol [RFC 1939] • authorization (agent <-->server) and download – IMAP: Internet Mail Access Protocol [RFC 1730] • more features (more complex) • manipulation of stored msgs on server – HTTP: Hotmail , Yahoo! Mail, etc. user agent

Try SMTP interaction for yourself: • telnet servername 25 • see 220 reply from

Try SMTP interaction for yourself: • telnet servername 25 • see 220 reply from server • enter HELO, MAIL FROM, RCPT TO, DATA, QUIT commands above lets you send email without using email client (reader)

Post Office Protocol (POP)

Post Office Protocol (POP)

POP 3 protocol authorization phase • client commands: – user: declare username – pass:

POP 3 protocol authorization phase • client commands: – user: declare username – pass: password • server responses – +OK – -ERR transaction phase, client: • list: list message numbers • retr: retrieve message by number • dele: delete • quit S: C: S: +OK POP 3 server ready user bob +OK pass hungry +OK user successfully logged C: S: S: S: C: C: S: list 1 498 2 912. retr 1 <message 1 contents>. dele 1 retr 2 <message 1 contents>. dele 2 quit +OK POP 3 server signing off on

IMAP

IMAP

Web Mail http: //www. squirrelmail. org

Web Mail http: //www. squirrelmail. org

(Adjusted) Mail Architecture Off-Campus E-mail smtp_internal Anti-virus Director Content Filter Antispam smtp_notify smtp_externel root

(Adjusted) Mail Architecture Off-Campus E-mail smtp_internal Anti-virus Director Content Filter Antispam smtp_notify smtp_externel root mail parrot petrel alpha admsrvcs mx=10 “smtp_external” mx=20 “smtp_backup” mx=30 “smtp. ecs. ” | “smtp”

Mail from El Presidente Return-Path: <elvis@graceland. org> Delivered-To: steve@blighty. com Received: from fake-name. example.

Mail from El Presidente Return-Path: <elvis@graceland. org> Delivered-To: steve@blighty. com Received: from fake-name. example. com (unknown [64. 71. 176. 18]) by gp. word-to-the-wise. com (Postfix) with SMTP id 3 DD 7790000 D for <steve@blighty. com>; Tue, 2 Dec 2003 12: 55: 36 -0800 (PST) From: El Presidente <president@whitehouse. com> To: Steve Atkins <steve@blighty. com> Subject: Fake Mail Message-Id: <20031202205536. 3 DD 779@gp. word-to-the-wise. com> Date: Tue, 2 Dec 2003 12: 55: 36 -0800 (PST) Status: RO Content-Length: 15 Lines: 1 Some body text

Sending spam (relay hijacking) Third-party mailserver (10. 11. 12. 13) Spammer (64. 71. 176.

Sending spam (relay hijacking) Third-party mailserver (10. 11. 12. 13) Spammer (64. 71. 176. 18) SMTP Recipients MX POP 3

Sending spam (relay hijacking) Received: from openrelay. com (mail. openrelay. com [10. 11. 12.

Sending spam (relay hijacking) Received: from openrelay. com (mail. openrelay. com [10. 11. 12. 13]) by gp. word-to-the-wise. com (Postfix) with SMTP id 3 DD 7790000 D for <steve@blighty. com>; Tue, 2 Dec 2003 12: 55: 36 -0800 (PST) Received: from fake-spammer-helo (spammer. net [64. 71. 176. 18]) by openrelay. com (Postfix) with SMTP id 3 DD 7790000 D for <steve@blighty. com>; Tue, 2 Dec 2003 12: 55: 36 -0800 (PST) You can see the relay, and the original spammer

Sending spam (direct to MX) Spammer (64. 71. 176. 18) SMTP POP 3 Recipients

Sending spam (direct to MX) Spammer (64. 71. 176. 18) SMTP POP 3 Recipients MX

Sending spam (direct to MX) Received: from fake-spammer-helo (spammer. net [64. 71. 176. 18])

Sending spam (direct to MX) Received: from fake-spammer-helo (spammer. net [64. 71. 176. 18]) by gp. word-to-the-wise. com (Postfix) with SMTP id 3 DD 7790000 D for <steve@blighty. com>; Tue, 2 Dec 2003 12: 55: 36 -0800 (PST) You can see the spammer

Sending spam (proxy hijacking) Open proxy (192. 168. 1. 1) Spammer (64. 71. 176.

Sending spam (proxy hijacking) Open proxy (192. 168. 1. 1) Spammer (64. 71. 176. 18) HTTP SMTP Recipients MX POP 3

Sending spam (proxy hijacking) Received: from fake-spammer-helo (open-proxy. net [192. 168. 1. 1]) by

Sending spam (proxy hijacking) Received: from fake-spammer-helo (open-proxy. net [192. 168. 1. 1]) by gp. word-to-the-wise. com (Postfix) with SMTP id 3 DD 7790000 D for <steve@blighty. com>; Tue, 2 Dec 2003 12: 55: 36 -0800 (PST) You can see the open proxy

Sending spam (trojans) Infected computer (192. 168. 1. 1) Spammer (64. 71. 176. 18)

Sending spam (trojans) Infected computer (192. 168. 1. 1) Spammer (64. 71. 176. 18) IRC? SMTP Recipients MX POP 3

Mapping email to postal mail- the envelope ~ Sender ID’s authorization proof Mail From

Mapping email to postal mail- the envelope ~ Sender ID’s authorization proof Mail From / Envelope From / Return Path Recipient To

Email Authentication Proposals • Client SMTP Validation (CSV): – http: //www. ietf. org/internet-drafts/draft-ietf-marid-csv-intro-01. txt

Email Authentication Proposals • Client SMTP Validation (CSV): – http: //www. ietf. org/internet-drafts/draft-ietf-marid-csv-intro-01. txt • Bounce Address Tag Validation (BATV): – http: //www. ietf. org/internet-drafts/draft-levine-mass-batv-00. txt • Domain. Keys: – http: //antispam. yahoo. com/domainkeys • Identified Internet Mail (IIM): – http: //www. ietf. org/internet-drafts/draft-fenton-identified-mail-01. txt • Sender ID (SPF + PRA): – http: //www. ietf. org/internet-drafts/draft-ietf-marid-pra-00. txt – http: //www. ietf. org/internet-drafts/draft-ietf-marid-core-03. txt

SPF: Sender Policy Framework Domains use public records (DNS) to direct requests for different

SPF: Sender Policy Framework Domains use public records (DNS) to direct requests for different services (web, email, etc. ) to the machines that perform those services. All domains already publish email (MX) records to tell the world what machines receive mail for the domain. SPF works by domains publishing "reverse MX" records to tell the world what machines send mail from the domain. When receiving a message from a domain, the recipient can check those records to make sure mail is coming from where it should be coming from. With SPF, those "reverse MX" records are easy to publish: one line in DNS is all it takes.

Client SMTP Validation (CSV): CSV considers two questions at the start of each SMTP

Client SMTP Validation (CSV): CSV considers two questions at the start of each SMTP session: o Does a domain's management authorize this MTA to be sending email? o Do independent accreditation services consider that domain's policies and practices sufficient for controlling email abuse?

Identified Internet Mail (IIM): Identified Internet Mail (IIM) provides a means by which cryptographic

Identified Internet Mail (IIM): Identified Internet Mail (IIM) provides a means by which cryptographic signatures can be applied to email messages to demonstrate that the sender of the message was authorized to use a given email address. Message recipients can verify the signature and consult the sender's domain to determine whether the key that was used to sign the message was authorized by that domain for that address. This confirms that the message was sent by an party authorized to use the sender's email address.

Domain. Keys Under Domain. Keys, a domain owner generates one or more private/public key-pairs

Domain. Keys Under Domain. Keys, a domain owner generates one or more private/public key-pairs that will be used to sign messages originating from that domain. The domain owner places the public-key in his domain namespace (i. e. , in a DNS record associated with that domain), and makes the private-key available to the outbound email system. When an email is submitted by an authorized user of that domain, the email system uses the private-key to digitally sign the email associated with the sending domain. The signature is added as a "Domain. Key-Signature: " header to the email, and the message is transferred to its recipients in the usual way. When a message is received with a Domain. Key signature header, the receiving system can verify the signature as follows: 1. Extract the signature and claimed sending domain from the email. 2. Fetch the public-key from the claimed sending domain namespace. 3. Use public-key to determine whether the signature of the email has been generated with the corresponding private-key, and thus whether the email was sent with the authority of the claimed sending domain. In the event that an email arrives without a signature or when the signature verification fails, the receiving system retrieves the policy of the claimed sending domain to ascertain the preferred disposition of such email. $ openssl rsa -in rsa. private -out rsa. public -pubout -outform PEM -----BEGIN PUBLIC KEY----MHww. DQYJKo. ZIhvc. NAQEBBQADaw. Awa. AJh. AKJ 2 lz. DLZ 8 Xl. Vamb. Qf. MXn 3 LRGKOD 5 o 6 l MIgulcl. Wj. Zw. P 56 LRqdg 5 ZX 15 bhc/Gsv. W 8 x. W/R 5 Sh 1 Nnk. JNy. L/cq. Y 1 a+Gzz. L 47 t 7 E Xz. Vc+n. RLWT 1 kw. Tv. FNGIo. AUs. FUq+J 6+Oprw. IDAQAB -----END PUBLIC KEY----This public-key data is placed in the DNS: _domainkey IN TXT "t=y; o=-; n=notes; r=email. Address"

Domain. Keys Example DNS TXT query for: brisbane. _domainkey. football. example. com Domain. Key-Status:

Domain. Keys Example DNS TXT query for: brisbane. _domainkey. football. example. com Domain. Key-Status: good Domain. Key-Signature: a=rsa-sha 1; s=brisbane; d=football. example. com; c=simple; q=dns; b=dzd. Vy. Of. AKCd. LXd. JOc 9 G 2 q 8 Lo. XSl. Eni. Sbav+yu. U 4 z. Geeru. D 00 lsz. Z Vo. G 4 ZHRNi. Yz. R; Received: from dsl-10. 2. 3. 4. football. example. com [10. 2. 3. 4] by submitserver. football. example. com with SUBMISSION; Fri, 11 Jul 2003 21: 01: 54 -0700 (PDT) From: "Joe Six. Pack" <joe@football. example. com> To: "Suzie Q" <suzie@shopping. example. net> Subject: Is dinner ready? Date: Fri, 11 Jul 2003 21: 00: 37 -0700 (PDT) Message-ID: <20030712040037. 46341. 5 F 8 J@football. example. com> Hi. We lost the game. Are you hungry yet? Joe.

Two authentication strategies compared IP based (Sender ID) Digital Signature (Domain. Keys) • Find

Two authentication strategies compared IP based (Sender ID) Digital Signature (Domain. Keys) • Find outbound IPs, publish • Generate public/private keys, in DNS publish public-key in DNS • Receiver verifies mail from • Sign mail with private-key authorized IP • Receiver verifies signature • Sender is not authenticated • Original Sender is authenticated -- Last IP to touch mail is • In transit modifications may • Forwarders & mail lists invalidate signature must change before technology can be fully used 19