Agenda. What is ? Brief Introduction To . History Of . Components Of System. Basics

Similar documents
Basics BUPT/QMUL

Basics BUPT/QMUL

SMTP. George Porter CSE 124 February 12, 2015

Application: Electronic Mail

Electronic Mail (SMTP)

Electronic Mail. Prof. Indranil Sen Gupta. Professor, Dept. of Computer Science & Engineering Indian Institute of Technology Kharagpur

Applications & Application-Layer Protocols: FTP and (SMTP & POP)

Internet and Intranet Protocols and Applications

Internet Technology. 03r. Application layer protocols: . Paul Krzyzanowski. Rutgers University. Spring 2016

Simple Network Management Protocol (SNMP)

Electronic Mail

Lecture 6: Application Layer Web proxies, , and SMTP

Lecture 25. Tuesday, November 21 CS 475 Networks - Lecture 25 1

Electronic Mail Paradigm

CSC 4900 Computer Networks:

Simple Network Management Protocol (SNMP)

CompSci 356: Computer Network Architectures. Lecture 23: Application Layer Protocols Chapter 9.1. Xiaowei Yang

WWW: the http protocol

Electronic mail, usually called , consists of simple text messages a piece of text sent to a recipient via the internet.

SCS3004 Networking Technologies Application Layer Protocols

System: Basic Functionality

The Application Layer: & SMTP

CSCE 463/612 Networks and Distributed Processing Spring 2018

Networking. Layered Model. DoD Model. Application Layer. ISO/OSI Model

Electronic Mail. Electronic Mailboxes

Layered Model. DoD Model. ISO/OSI Model

The Application Layer: SMTP, FTP

CS 43: Computer Networks. 12: and SMTP September 28, 2018

Internet Electronic Mail

What is ? TCP/IP Standard Applications for Electronic Mail. Agenda. History

Outline. EEC-484/584 Computer Networks. Slow Start Algorithm. Internet Congestion Control Algorithm

Chapter 2 Application Layer

Network Applications Electronic Mail

. indigoo.com INTRODUCTION TO MAIL TRANSFER PROTOCOLS FOR THE INTERNET. Peter R. Egli INDIGOO.COM. 1/35 Rev Peter R.

Lecture 7 Application Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

13. Internet Applications 최양희서울대학교컴퓨터공학부

. SMTP, POP, and IMAP

Chapter 7 (Week 13) The Application Layer ANDREW S. TANENBAUM COMPUTER NETWORKS FOURTH EDITION PP BLM431 Computer Networks Dr.

The Application Layer

Motivation For Networking. Information access Interaction among cooperative application programs Resource sharing

Electronic Mail. Three Components: SMTP SMTP. SMTP mail server. 1. User Agents. 2. Mail Servers. 3. SMTP protocol

Overview. Electronic mail. History Format of . Sending . Retrieving . RFC 822, MIME, addresses SMTP, DNS. POP, IMAP, Web-based

Chapter 20 SMTP. Slides from TCP/IP - Forouzan. User Agent (UA) Addressing Delayed Delivery Aliases Mail Transfer Agent (MTA) MIME POP.

Header- A Forensic Key to Examine an

ECE 435 Network Engineering Lecture 6

Fig (1) sending and receiving s

Chapter 2: outline. 2.6 P2P applications 2.7 socket programming with UDP and TCP

Computer Network 1 1

Internet Technology 2/10/2016

Objectives CINS/F1-01

Application Inspection and Control for SMTP

Internet Protocol Stack! Principles of Network Applications! Some Network Apps" (and Their Protocols)! Application-Layer Protocols! Our goals:!

FTP. FTP offers many facilities :

Application-layer Protocols and Internet Services

Protocols and Software. Nixu Ltd.

Debian/GNU Linux Mailing

CS 3516: Computer Networks

How Internet Works

Computer Networking. Chapter #1. Dr. Abdulrhaman Alameer

INTERNET & WORLD WIDE WEB (UNIT-1) MECHANISM OF INTERNET

Chapter 2 Application Layer

Investigating . Tracing & Recovery

[Prof. Rupesh G Vaishnav] Page 1

ing With PHP History of Applications or Use

Application Layer Chapter 2

DNS and SMTP. James Walden CIT 485: Advanced Cybersecurity. James WaldenCIT 485: Advanced Cybersecurity DNS and SMTP 1 / 31

2. Introduction to Internet Applications

CIT 470: Advanced Network and System Administration. Topics. Mail Policies.

Internet Protocols. Robin Sharp

Application Layer Services Omer F. Rana. Networks and Data Communications 1

is still the most used Internet app. According to some studies around 85% of Internet users still use for communication.

Telemetry Data Sharing Using S/MIME

Network Services, VU 2.0

SMTP Simple Mail Transfer Protocol

Information Network Systems The application layer. Stephan Sigg

Chapter 2: Application layer

Debian/GNU Linux Mailing

Protocols. Networking CS 3470, Section 1 Sarah Diesburg

FTP. Mail. File Transfer Protocol (FTP) FTP commands, responses. Electronic Mail. TDTS06: Computer Networks

Applications FTP. FTP offers many facilities :

CS348: Computer Networks (SMTP, POP3, IMAP4); FTP

Mail agents. Introduction to Internet Mail. Message format (1) Message format (2)

Additional laboratory

Part 4: Message delivery protocols (POP and IMAP) Network News (Usenet News)

CSC 401 Data and Computer Communications Networks

COSC 301 Network Management. Lecture 14: Electronic Mail

What is ? A method of composing, sending, and receiving messages over electronic communication systems. Internet addresses

Text-Based Protocols. Many common protocols based on sending text messages. Built atop the TCP stream protocol. Lines terminated with \r\n.

CCNA Exploration1 Chapter 3: Application Layer Functionality and Protocols

Application Level Protocols

ColdFusion Foundations: POP3. Mosh Teitelbaum evoch, LLC

Internet Applications. Dr Steve Gordon ICT, SIIT

Foundations of Python

My The guide.

Internet Architecture

Electronic Mail ( ) System

Appendix. Web Command Error Codes. Web Command Error Codes

CHAPTER 22 DISTRIBUTED APPLICATIONS ANSWERS TO QUESTIONS ANSWERS TO PROBLEMS

Computer Networks. Wenzhong Li. Nanjing University

CMPE 151: Network Administration. Servers

Transcription:

Agenda Email Basics BUPT/QMUL 2012-04-09 Brief introduction to email Components of email system Email Standards Summary Refer to Chapter 27, textbook 2 Brief Introduction To Email 3 What is Email? Electronic Mail (email, e-mail) Provides a means to send electronic messages from one person to another asynchronously One of the most popular applications on the and one of the most important communication methods today Email Poisoning Syndrome Incurs face-to-face communication impediment Email service can be provided by ISPs: @126.com, @163.com, @sina.com, yahoo.cn, Corporations and institutes: @baidu.com, @bupt.edu.cn, @ietf.org, Bundled with other services: @139.com, @qq.com, 4 History Of Email ARPANET 1971 the first email in the world 1982 RFC 821() RFC 822 1984-1988 X.400 MOTIS 1988 Eudora 1988 POP IMAP 1993 MIME 1996 Outlook 1996 Free emails Components Of Email System Ray Tomlinson IETF CCITT ISO Steve Dorner IETF IETF Microsoft Hotmail etc. Trends: Multiple data types other than text More Users More space, larger attachment Will email be replaced by Instant Messaging? Newest development: Oct. 2008 RFC 5321 Simple Mail Transfer Protocol RFC 5322 Message Format 5 6

Components Of Email System (1) Components Of Email System (2) User Agent Mail Server Mail Server POP3 User Agent IMAP POP3,IMAP UA (User Agent) Mail Server Sender Receiver Mail Server of Sender Side User mailbox Mail Server of Receiver Side MTA MTA Transfer Transfer Reporting Reporting Displaying 8 Basic Functions Of Email System Composition - refers to the process of creating Transfer - refers to moving messages from the Reporting - refers to the process of informing the Displaying Disposition messages and answers. originator to the recipient. POP3,IMAP : used for sending an email POP3/IMAP: used for receiving an email 7 Components Of Email System (3) Composition Responsible for transmitting/receiving emails and reporting status information about mail transferring to the mail sender Both a client and a server Email protocols Spooling end-user mail program Interface between the end users and the email servers E.g., outlook, foxmail, originator what happened to the message. Sender Mail Server of Sender Side Receiver Displaying - means of showing the messages. Disposition - refers to what happened to the message after it has been read by the receiver. Mail Server of Receiver Side 9 Email Sending Other Terminologies 10 Mailboxes created by the user to store incoming email. Mailing lists means of sending identical emails to a group MTA (Mail Transfer Agent) servers and clients provide a mail transport service 11 To send an email message, a user must provide the message, the destination address and possibly some other parameters (e.g., security or security level) The message can be produced with a freestanding text editor, a word processor, or possibly with an editor built into the user agent 12

Email Address The destination address must be in a format that the user agent can deal with Many user agents expect DNS addresses of the form mailboxname@domain. (See RFC 5322 ) Email Reading Typically, when a user agent is started up, it will look at the user s mailbox for incoming email before displaying anything on the screen Each email address is unique on the because Domain name is unique on the Mailboxname is unique in the domain 13 Then it may announce the number of messages in the mailbox or display a one line summary of each one and wait for a command 14 Email Standards Email Standards Message Format RFC 5322 (Simple Mail Transfer Protocol) RFC 5321 etc. POP (Post Office Protocol) RFC 1939 etc. IMAP ( Message Access Protocol) RFC 3501 etc. MIME (Multipurpose Mail Extension) RFC 2045, RFC 2046, RFC 2049 etc. 15 16 Message Format (1) Message envelop contains whatever information is needed to accomplish transmission and delivery Message contents: comprise the object to be delivered to the recipient Headers: from, to, subject, date, postmarks Blank line Body: actual message, may have many parts 17 Message Format (2) Each header field consists of a single line of ASCII text containing the field name, a colon, and, for most fields, a value eg. from:chengli@bupt.edu.cn In normal usage, the User Agent builds a message and passes it to MTA The MTA then uses some of the header fields to construct the actual envelope User provides body & key headers, while mail system provides the rest 18

Example RFC 5322 Message Mailbox responsible for the actual transmission of the message, optional the address(es) of the primary recipient(s) of the message The header is everything up to the blank line, and the body is everything after the blank line Author of the message, required From: John Doe <jdoe@machine.example> Sender: Michael Jones <mjones@machine.example> To: Mary Smith <mary@example.net> Subject: Saying Hello headers Date: Fri, 21 Nov 1997 09:55:06-0600 Message-ID: <1234@local.machine.example> This is a message just to say hello. So, "Hello". body 19 Field Definitions Categories Header Meaning Originator fields Destination address fields The origination date field Identification fields Information fields Trace fields From: Sender: Reply-to: To: Cc: Bcc: Date: Message-Id: References: Subject: Keywords: Received: Return-Path: Person or people who created the message Email address of the actual sender Email address to which replies should be sent Email address(es) of primary recipient(s) Email address(es) of secondary recipient(s) Email address(es) for blind carbon copies The date and time the message was sent Unique number for referencing this message later Other relevant Message-Ids Short summary of the message for the one-line display User chosen keyword Line added by each transfer agent along the route Can be used to identify a path back to the sender 20 The source machine( client) establish a TCP connection to Port 25 of the destination machine( server) Listening to this port is an email daemon that speaks This daemon accepts incoming connections and copies messages from them into the appropriate mailboxes Daemon - A program that is not invoked explicitly, but lies dormant waiting for some condition(s) to occur. Unix systems run many daemons, chiefly to handle requests for services from other hosts on a network. Most of these are now started as required by a single real daemon, inetd, rather than running continuously 21 If the message cannot be delivered, an error report containing the first part of the undeliverable message is returned to the sender eventually is a simple ASCII protocol After establishing the TCP connection to port 25, the sending machine, operating as a client, waits for the receiving machine operating as the server to talk first 22 Basic Model Command Sequence stages File System File System Connection establish Mail transfer Connection release User MTA commands/replies and mail MTA client (Mail Server at sender side) server (Mail Server at receiver side) 24

Commands: Basics Commands: Extras commands HELO MAIL FROM: RCPT TO: DATA QUIT description identifies client s domain name starts a mail transaction and identifies the mail originator identifies individual recipient. There may be multiple RCPT TO: commands body of the message. sender ready to transmit a series of lines of text, each ends with \r\n. A line containing only a period. indicates the end of the data close the connection 25 EHLO (Extended Hello) Same function with HELO. But, in addition to domain name, address literal (eg. IPv4 address) is also supported VRFY (Verify) - confirm that a name is a valid recipient EXPN (Expand) - obtain the content of a mailing list NOOP - send back a positive reply (i.e. 250 OK) RSET (Reset) - abort current mail transaction HELP - cause the server to send helpful information to the client. 26 : Status Codes The Server responds with a 3 digit code that may be followed by text info 2## -- Success, Positive completion reply 3## -- Command can be accepted with more information 4## -- Command was rejected, but error condition is temporary 5## -- Command rejected, and the error condition is permanent, eg. Bad User! 27 Commands and Status codes example smith@alpha.edu sends a mail to jones@beta.gov, green@beta.gov client server TCP connection establish Connection 220 beta.gov Simple Mail Transfer Service ready establish HELO alpha.edu 250 beta.gov Mail transfer Connection release MAIL FROM: <smith@alpha.edu> 250 OK RCPT TO: <jones@beta.gov> 250 OK RCPT TO: <green@beta.gov> 550 No such user here DATA 354 End with <CR><LF>.<CR><LF> Message <CR><LF>.<CR><LF> 250 OK QUIT 221 Bye 28 Sending Email Through Telnet C:\Documents and Settings\Administrator> telnet smtp.163.com 25 220 163.com Anti-spam GT for Coremail System (163com[201110101]) helo mail.163.com 250 OK Base64 encoded username: and Password: auth login 334 dxnlcm5hbwu6 Y2F0c2hpeQ== Base64 encoded username catshiy 334 UGFzc3dvcmQ6 MTIzNDU2 Base64 encoded password 123456 235 Authentication successful mail from:<catshiy@163.com> 250 Mail OK rcpt to:<catshiy@163.com> 250 Mail OK data 354 Please start mail input. subject:test email Blank line: boundary between headers and body this is only a test for sending email through telnet. Period: end of data 250 Mail queued for delivery. quit 221 Closing connection. Good bye. 失去了跟主机的连接 C:\Documents and Settings\Administrator> 29 Base64 Encoding Divides binary data into 24 bit blocks Each block is then divided into 6 bit chunks Each 6-bit section is interpreted as one character (8 bits), 25% overhead 30

Base64 Example Base64 Encoding Table hello 01101000 01100101 01101100 01101100 01101111 011010 000110 010101 101100 011011 000110 1111 00 (26) (6) (21) (44) (27) (6) (60) (a) (G) (V) (s) (b) (G) (8) (=) agvsbg8= 01100001 01000111 01010110 01110011 01100010 01000111 00111000 00111101 Online encoding and decoding: http://rssba.com.cn/tool/mailcode.php 32 Sender s Client Transfer Mechanism Eg.1 UA Receiver User mailboxes TCP/IP network Server The server listens to wellknown port 25. is a reliable protocol. The reliability is achieved by using TCP as the transport layer mechanism. This requires a connection to be established before a message transfer can take place. An client will contact the destination host's server directly to deliver the mail. It will keep the mail item being transmitted until it has been successfully copied to the recipient's MTA. Eventually it may give up. 33 Sending Host User at a terminal UA UA User at a terminal Receiving Host Transfer Mechanism Eg.2 Queue of mail to be sent Local MTA Mail queue Mail queue Local MTA User Mailbox Organization A Local MTA Relay MTA Relay MTA Local MTA Organization B Most systems are configured to send all non-local outgoing mail to a Relay MTA for delivery. This is done or two reasons. First, is simplifies the configuration of all MTAs other than the relay MTA. Second, it allows one system at an organization to act as the mail hub, possibly hiding all the individual systems. If the Relay MTA changes, the mail configuration of all individual systems need not change. In this scenario there are four MTAs between the sender and the receiver. The Local MTA on the sender s host just delivers the mail to its Relay MTA across the organisation s local internet. The Relay MTA in the sender s organisation sends the mail to the receiving organisation s Relay MTA across the. The Relay MTA in the receiver s organization then delivers the mail to the receiver s host, by communication with the Local MTA on the receiver s host. All the MTAs in this example use, although other protocols could be used. Limitations in Only uses NVT 7 bit ASCII format How to represent other data types? No authentication mechanisms Messages are sent un-encrypted Susceptible to misuse (Spamming, faking sender address) 35 POP Basic Model File System Used to transfer mail from a mail server to a UA Server: is always on and listening via TCP port 25 holds incoming mail for user /POP Mail Server POP Mail Access Server: runs the POP3 service by listening on TCP port 110 POP User Agent Clients: connect to server to manipulate mail using message access protocols (POP or IMAP) 36

POP Features Essentially store and forward. Mail is stored on the server until the client connects and then is downloaded to the client. You MAY be able to leave a copy on the server Simple protocol and widely used. Many clients available such as Eudora, foxmail, outlook However, very bad for mobile users or users that use multiple machines during the day Common used version: POP3 (POP Version 3) POP3 Similar to command/reply lockstep protocol Used to retrieve mail for a single user requires authentication Commands and replies are ASCII lines Replies start with +OK or -ERR Replies may contain multiple lines 37 38 POP3 Commands USER - specify username PASS - specify password STAT - get mailbox status number of messages in the mailbox. LIST - get a list of messages and sizes. One per line, termination line contains. only RETR - retrieve a message DELE - mark a message for deletion from the mailbox NOOP - send back positive reply RSET - reset. All deletion marks are unmarked QUIT - remove marked messages and close the (TCP) connection 39 Retrieving Emails Through Telnet (1) C:\Documents and Settings\Administrator> telnet pop3.126.com 110 +OK Welcome to coremail Mail Pop3 Server (126coms[3adb99eb4207ae5256632eecb8f8b4 85s]) USER catshiy +OK core mail PASS 123456 +OK 1 message(s) [885 byte(s)] STAT +OK 1 885 LIST +OK 1 885 1 885. 40 Retrieving Emails Through Telnet (2) RETR 1 +OK 885 octets Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Message-ID: <DQ958982777179.06131@mcard.bta.net.cn> Date: Sun, 17 Oct 2004 22:28:20 +0800 (CST) From: smq1234@public.bta.net.cn To: catshiy@126.com Cc: Subject: 我十一月中旬以后有空, 欢迎你们过来玩 smq ----------------------------------------------. QUIT +OK core mail 失去了跟主机的连接 C:\Documents and Settings\Administrator> 41 IMAP: Message Access Protocol Features Folders and messages can be stored either on the server or on the local computer Multiple folders can be set for one user Since folders can remain on server, it is possible to access your same mail store even using a dumb terminal character based client like Pine. User can choose to download part of mail (eg. Mail header) to UA. Much better for mobile users than POP (since mail remains on the server) Gmail supports IMAP Interesting comparison of POP3 and IMAP http://www1.umn.edu/adcs/guides/email/imapvspop.html 42

Whole message POP vs. IMAP(1) POP vs. IMAP(2) POP3: All Messages IMAP: Dr.Amer Friends. headers 43 44 Web-based Mail: HTTP Can deliver mail message in web page format More reliable to use POP and IMAP than web mail account http://mail.bupt.edu.cn/ 45 MIME Motivation Originally, email consisted exclusively of the text messages written in English and expressed in ASCII (RFC 5322) Nowadays, this approach is no longer appropriate, due to: Messages in languages with accents(e.g. ö, ç, ğ) Messages in non-latin alphabets Messages in languages without alphabets Messages are not containing text at all -- audio/video MIME: Multipurpose Mail Extension 46 MIME Features Extension for multipart & multimedia email Additional mail headers define content type (text, image, audio, video, application) and subtype within (eg text/html, image/gif) encoding (ASCII, quoted printable, base64) to handle arbitrary binary data when email system can only handle normal ASCII chars Supports multipart message content type each part has its own type and encoding The basic idea of MIME is to use the ASCII format, but to add structure to the message body and define encoding rules for non-ascii messages By not deviating from RFC 5322, MIME messages can be sent using the existing mail programs and protocols Widely used now 47 MIME New Headers (1) Header MIME-Version: Content-Id: Content-Type: Content-Transfer- Encoding: Content-Description: Meaning Identifies the MIME version Unique identifier Type of the message How the body is wrapped for transmission Human readable string telling what is in the message 48

MIME New Headers (2) MIME-Version: simply tells the user agent receiving the messages that it is dealing with MIME messages and which version of MIME it uses - any message not containing a MIMEversion is assumed to an English plain-text message Content-Id: header uniquely identifies the content Content-Type: tells the type and subtype of the content Content-Transfer-Encoding: tells how the body is wrapped for transmission - multiple schemes, from the the simplest - ASCII text, through to base64 encoding Content-Description: is an ASCII string telling what is in the message 49 MIME New Headers (3) Content types and subtypes Type Subtype Description Plain Unformatted text Text Richtext Text including simple formatting commands Gif Still picture in GIF format Image Jpeg Still picture in JPEG format Audio Basic Audible sound Video Mpeg Movie in MPEG format Application Message Multipart octet-stream An uninterpreted byte sequence Postscript A printable document in PostScript RFC2822 A MIME RFC 2822 message Partial Message has been split for transmission External-body Message itself must be fetched over the net Mixed Independent parts in the specified order Alternative Same message in different formats Parallel Parts must be viewed simultaneously Digest Each part is a complete RFC 2822 message 50 MIME Message Example (1) Date: Sat, 07 Dec 2002 16:37:32 +0800 From: Adun Gaos X-Accept-Language: zh-cn MIME-Version: 1.0 To: adungaos@celldoft.com Subject: MIME message! Content-Type: multipart/mixed; boundary="------------080202030206040206090704" MIME Message Example (2) When you save the above as.eml file and open it with outlook, you can see: This is a multi-part message in MIME format. --------------080202030206040206090704 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit This is a MIME message. Here is body. --------------080202030206040206090704 Content-Type: application/x- gtar; name="binary.tgz" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="binary.tgz" H4sIABmy8T0AA+3OsQ3CMBQEUI/iEb6dBM9jhIRogpSQgu1BQhQUiCpU7zVX3BV3vMx9uadd RYk4RKSIKG36yLcUbWrjMJQo9bmv41BTjn1vvWzrrS85p37a5nO/rt92v3oAAAAAAAAAAAD4 owef/kcgacgaaa== --------------080202030206040206090704-- 51 52 Summary 53 Summary Email Components of email system Basic functions of email system Email address Communication procedure Model Commands and replies POP Model Commands and replies Communication procedure IMAP Comparison of POP and IMAP Message formats RFC 2822 MIME What are the limitations of? How POP, IMAP and MIME used to offset the limitations of? 54

Useful URLs RFCs www.ietf.org http://helpdesk.islandnet.com/pep/smtp.php http://www3.rad.com/networks/2006/smtp/intro.h tm POP & IMAP Base64 encoding and decoding online http://www.motobit.com/util/base64- decoder-encoder.asp 55