Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES E-mail Internet Protocols Simple Mail Transfer Protocol, SMTP RFC821 (August 1982)

Slides:



Advertisements
Similar presentations
Securing Bruce Maggs. Separate Suites of Protocols Protocols for retrieving POP, IMAP, MAPI (Microsoft Exchange) Protocols for sending
Advertisements

Protocols and Troubleshooting Brandon Checketts.
1 Electronic Mail u Three major components: u user agents u mail servers u simple mail transfer protocol: SMTP u User Agent u a.k.a. “mail reader” u composing,
SMTP – Simple Mail Transfer Protocol
Application: Electronic Mail Linda Wu (CMPT )
TCP/IP Protocol Suite 1 Chapter 20 Upon completion you will be able to: Electronic Mail: SMTP, POP, and IMAP Understand four configurations of architecture.
CPSC 441: FTP & SMTP1 Application Layer: FTP & Instructor: Carey Williamson Office: ICT Class.
Electronic Mail and SMTP
Simple Mail Transfer Protocol (SMTP) CS-328 Dick Steflik.
POP3 Post Office Protocol v.3. Intro The Post Office Protocol (POP) is currently the most popular TCP/IP access and retrieval protocol. It implements.
Chapter 30 Electronic Mail Representation & Transfer
Esimerkki: Sähköposti. Lappeenranta University of Technology / JP, PH, AH Electronic Mail Three major components: user agents mail servers simple mail.
Simple Mail Transfer Protocol
2440: 141 Web Site Administration Services Instructor: Enoch E. Damson.
Architecture of SMTP, POP, IMAP, MIME.
Introduction 1 Lecture 7 Application Layer (FTP, ) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
Mail Server Fitri Setyorini. Content SMTP POP3 How mail server works IMAP.
Introduction 1-1 Chapter 2 FTP & Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 IC322 Fall.
2: Application Layer1 Chapter 2 Application Layer These slides derived from Computer Networking: A Top Down Approach, 6 th edition. Jim Kurose, Keith Ross.
Electronic Mail (SMTP, POP, IMAP, MIME)
1 Web Server Administration Chapter 8 Providing Services.
SMTP, POP3, IMAP.
1 Application Layer Lecture 5 Imran Ahmed University of Management & Technology.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 9
Mail Services.
CSE401N: Computer Networks Lecture-5 Electronic Mail S. M. Hasibul Haque Lecturer Dept. of CSE, BUET.
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 2: Application.
Intro to Computer Networks Bob Bradley The University of Tennessee at Martin.
Review: –How do we address “a network end-point”? –What services are provided by the Internet? –What is the network logical topology observed by a network.
Application Layer Protocols Simple Mail Transfer Protocol.
Lecturer: Maxim Podlesny Sep CSE 473 File Transfer and Electronic in Internet.
Computer Networking From LANs to WANs: Hardware, Software, and Security Chapter 12 Electronic Mail.
Application Protocols: ELECTRONIC MAIL (SMTP, POP) CSNB534 Semester 2, 2007/2008 Asma Shakil.
1 Applications Electronic Mail. 2 Electronic Mail Many user applications use client-server architecture. Electronic mail client accepts mail.
Electronic Mail. Familiar to most of us 4 What are the functions we expect? –Outgoing mail Compose send –compress –encrypt –Incoming Mail read forward.
Sending and Receiving Mails
FTP (File Transfer Protocol) & Telnet
Simple Mail Transfer Protocol (SMTP)
File Transfer Protocol (FTP)
05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.
1 SMTP - Simple Mail Transfer Protocol –RFC 821 POP - Post Office Protocol –RFC 1939 Also: –RFC 822 Standard for the Format of ARPA Internet Text.
Securing Bruce Maggs. Separate Suites of Protocols Protocols for retrieving POP, IMAP, MAPI (Microsoft Exchange) Protocols for sending
Chapter 16: Distributed Applications Business Data Communications, 4e.
Computer Networks with Internet Technology William Stallings Chapter 03 Traditional Applications.
SIMPLE MAIL TRANSFER PROTOCOL. Introduction Simple Mail Transfer Protocol is the standard protocol on the Internet and part of the TCP/IP protocol.
CS 3830 Day 9 Introduction 1-1. Announcements r Quiz #2 this Friday r Demo prog1 and prog2 together starting this Wednesday 2: Application Layer 2.
SIMPLE MAIL TRANSFER PROTOCOL PRADEEP KOLLIPARA SANDEEP PINNAMANENI.
SMTP - Simple Mail Transfer Protocol RFC 821
CITA 310 Section 6 Providing Services (Textbook Chapter 8)
CS440 Computer Networks 1 Neil Tang 12/01/2008.
Slides based on Carey Williamson’s: FTP & SMTP1 File Transfer Protocol (FTP) r FTP client contacts FTP server at port 21, specifying TCP as transport protocol.
World Wide Web r Most Web pages consist of: m base HTML page, and m several referenced objects addressed by a URL r URL has two components: host name and.
COMP 431 Internet Services & Protocols
26.1 Electronic Mail Sending/Receiving Mail Addresses User Agent MIME Mail Transfer Agent Mail Access Protocols.
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
Spring 2006 CPE : Application Layer_ 1 Special Topics in Computer Engineering Application layer: Some of these Slides are Based on Slides.
درس مهندسی اینترنت – مهدی عمادی مهندسی اینترنت برنامه‌نویسی در اینترنت 1 SMTP, FTP.
Securing Bruce Maggs.
SMTP - Simple Mail Transfer Protocol POP - Post Office Protocol
Networking Applications
Securing Bruce Maggs.
Securing Bruce Maggs.
CIT 383: Administrative Scripting
Chapter 2: Application layer
William Stallings Data and Computer Communications
The Application Layer: SMTP, FTP
Chapter 7 Network Applications
Chapter 2 Application Layer
Securing Bruce Maggs.
Securing Bruce Maggs.
Presentation transcript:

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES Internet Protocols Simple Mail Transfer Protocol, SMTP RFC821 (August 1982) Post Office Protocol, POP3 RFC 1939 (May 1996) Internet Message Access Protocol, IMAP4 First RFC concerning IMAP year RFC 1730 (IMAP4, December 1994) RFC 3501 (new edition of IMAP4v1, March 2003) Rev /

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES transport scheme MTA - Mail Transfer Agent MDA - Mail Delivery Agent Mail Client, MTA (The Bat, Outlook) SMTP server 1, MTA SMTP SMTP server 2, MTA SMTPSMTP destination server, MTA SMTP MDA Mail Client, (The Bat, Outlook) POP3 IMAP4 POP3 server IMAP server telnet User's mailboxes

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES protocols and OSI RM APPLICATION PRESENTATION SESSION TRANSPORT NETWORK DATA LINK PHYSICAL Layer 7 Layer 6 Layer 5 Layer 4 Layer 3 Layer 2 Layer 1 TCP IP Physical TCP/IPOSI/RM SMTP, POP3, IMAP4

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES SMTP features Purpose: to transfer messages across a network. In a single session multiple mail and information messages can be transmitted in either direction across the link. By default an SMTP client application will contact the remote server using TCP/IP application port number 25 as the destination port, and will select at random a port from the dynamic or private range for the source port number. SMTP provides a mechanism that allows mail to be sent directly from sender to recipient, or through intermediate hosts if there is no direct path from one to the other (DNS: MX record).

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES SMTP commands HELO domainidentify the client to the server ("hello, I'm...") MAIL FROM: reverse-path initiate mail transaction; arg is sender's address RCPT TO: forward- path recipient's address (issue for each recipient once) DATAfollowed by the mail message (up to CRLF.CRLF) HELP [command]ask for general help or about a specific command RSETabort current mail transaction, reply OK NOOPno-op, server responds OK QUITterminate session, server responds OK TURNchange roles: server/client; server may refuse...

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES SMTP replies Standard reply codes: 221(domain) Service closing transmission channel 220(domain) Service ready 250Requested mail action okay, completed 251User not local; will forward to (forward-path) 354Start mail input; end with (CRLF).(CRLF) 421(domain) Service not available, 500Syntax error, command unrecognized 501Syntax error in parameters or arguments 551User not local; please try “forward-path” 552Requested mail action aborted: exceeded storage allocation 554Transaction failed

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES SMTP session example S: Listen for connection on TCP port 25 C: Connect to TCP port 25 on SMTP server S: 220 mail.server.ru SMTP ready C: HELO my.domain.name S: 250 mail.server.ru C: MAIL FROM: S: 250 OK C: RCPT TO: S: 250 OK C: RCPT TO: S: 550 No such user here C: RCPT TO: S: 250 OK C: DATA S: 354 Start mail input; end with. C: Blah blah blah... C:...etc, etc, etc. C:. S: 250 OK C: QUIT S: 221 mail.server.arpa Service closing transmission channel

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES Mail message structure Received: from mx10.mail.ru (mx10.mail.ru [ ]) (5) by dfe3300.karelia.ru (8.9.0/8.9.0) with ESMTP id JAA02601 for ; Thu, 18 Apr :19: Received: from f5.int ([ ] helo=f5.mail.ru) (4) by mx10.mail.ru with esmtp (Exim MX.A) id 16y46p-0002ox-00 for Thu, 18 Apr :05: Received: from mail by f5.mail.ru with local (Exim FE.5) (3) id 16y46o-000CfY-00 for Thu, 18 Apr :05: Received: from [ ] by win.mail.ru with HTTP; (2) Thu, 18 Apr :05: From: "Testing" To: Subject: For testing purposes only Mime-Version: 1.0 X-Mailer: mPOP Web-Mail 2.19 X-Originating-IP: [ ] (1) Date: Thu, 18 Apr :05: Reply-To: "Testing" Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Message-Id: X-UIDL: 74fb663e2be8352b3a0b88ca08030c1e Тестовое сообщение. BLUE text was created by originating mail agent (mail client). 4 headers (Received:) were added on each SMTP interaction (hop) (2-5).

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES CC: and BCC: headers CC - carbon copy BCC - "blind" carbon copy When sending mail message through BCC mechanism to multiple recipients, they do not know about the fact of spam. MTA cuts out string from message body and then sends multiple distinct letters using RCPT command.

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES POP3 features Purpose: to retrieve mail from server. Dedicated client and server hosts. POP3 service is mapped to TCP port 110. When the TCP connection is established, the POP3 server sends a greeting. The client and POP3 server then exchange commands and responses (respectively) until the connection is closed or aborted. Multistring reply must end by.

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES POP3 commands USER namestring identifying a mailbox (required) PASS passwda server/mailbox-specific password (required) APOP name MD5digest a string identifying a mailbox and a MD5 digest string (both required) STATinquire the content of mailbox (reply: +OK messages of overall volume of 320 octets) LIST [msg]list [all] messages RETR msgretrieve the certain message DELE msgdelete the certain message RSETreset all previous prepared actions, reply +OK NOOPno-op, server responds +OK QUITterminate session...

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES POP3 session example S: C: S: +OK POP3 server ready C: APOP mrose c4c9334bac560ecc979e58001b3e22fb S: +OK mrose's maildrop has 2 messages (320 octets) C: LIST S: +OK 2 messages (320 octets) S: S: S:. C: RETR 1 S: +OK 120 octets S: S:. C: DELE 1 S: +OK message 1 deleted C: RETR 2 S: +OK 200 octets S: S:. C: DELE 2 S: +OK message 2 deleted C: QUIT S: +OK dewey POP3 server signing off (maildrop empty) C: S:

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES IMAP vs POP3 POP3: all messages are downloaded to the client and then deleted from server. IMAP: accesses remote mail-boxes as if they were present on the local machine. The IMAP4 client can request any part of the message, such as the envelope or the headers and download the whole message only when needed. Server based searching is also supported. Messages are not deleted immediately, rather they are marked for deletion and only removed once the client logs off or sends the expunge command. POP3: useful for people working with one computer. IMAP: Because the messages are stored on the server, it doesn't really matter who or where the client is (synchronization).

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES IMAP4v1 description Purpose: to allows a client to access and manipulate electronic mail messages on a server. Messages in IMAP4rev1 are accessed by the use of numbers. These numbers are either message sequence numbers or unique identifiers. The IMAP4rev1 protocol assumes a reliable data stream such as that provided by TCP. When TCP is used (!), an IMAP4rev1 server listens on port 143. The client command begins an operation. Each client command is prefixed with an identifier (typically a short alphanumeric string, e.g., A0001, A0002, etc.) called a "tag". A different tag is generated by the client for each command. Client need not wait for reply on certain command, it can issue next command to execute

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES IMAP4v1 session states Transport connection and server greeting Non-authenticated Authenticated (operations involving mailboxes) Selected (operations involving messages) Logout, break or close connection greeting/bye greeting/ PREAUTH greeting/OK LOGIN successful SELECT / EXAMINE

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES IMAP4v1 description cont'd Unique Identifier (UID) (32 bit, greater than previous) Message Sequence Number (position of message in mailbox, can be reassigned during the session) Internal date Size Envelope structure (parsed headers part) Body structure (parsed structure of MIME content) Flags: 1.\SeenMessage has been read 2.\AnsweredMessage has been answered 3.\FlaggedMessage is "flagged" for urgent/special attention 4.\DeletedMessage is "deleted" for removal by later EXPUNGE 5.\Draft Message is marked as a draft. 6.\RecentMessage is "recently" arrived in this mailbox (only for 1st read-write session). Message attributes:

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES IMAP4v1 client commands CAPABILITY: requests a listing of capabilities that the server supports (valid in any state). Example: C: a001 CAPABILITY S: * CAPABILITY IMAP4rev1 STARTTLS AUTH=GSSAPI LOGINDISABLED S: a001 OK CAPABILITY completed C: a002 STARTTLS S: a002 OK STARTLS completed C: a003 CAPABILITY S: * CAPABILITY IMAP4rev1 AUTH=GSSAPI AUTH=PLAIN S: a003 OK CAPABILITY completed C: a004 LOGIN joe password S: a004 OK LOGIN completed Server made client to establish TLS connection. Note: strings beginning with * correspond to the reply with the following tag number.

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES IMAP4v1 client commands SELECT: selects a mailbox so that messages in the mailbox can be accessed (valid in Authenticated State). Example: C: A142 SELECT INBOX S: * 172 EXISTS S: * 1 RECENT S: * OK [UNSEEN 12] Message 12 is first unseen S: * OK [UIDVALIDITY ] UIDs valid (session ID) S: * OK [UIDNEXT 4392] Predicted next UID S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft) S: * OK [PERMANENTFLAGS (\Deleted \Seen \*)] Limited S: A142 OK [READ-WRITE] SELECT completed EXAMINE: the same as SELECT but the selected mailbox is identified as read-only.

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES IMAP4v1 client commands CREATE: creates a mailbox with the given name (valid in Authenticated State). Example: C: A003 CREATE mailbox2/ S: A003 OK CREATE completed DELETE: deletes a mailbox with the given name (valid in Authenticated State). Example: C: A104 DELETE mailbox2/ S: A104 OK DELETE completed

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES IMAP4v1 client commands Selected State CLOSE: removes all messages that have the \Deleted flag set from the currently selected mailbox, and returns to the authenticated state from the selected state. EXPUNGE: removes all messages that have the \Deleted flag set from the currently selected mailbox. SEARCH: searches the mailbox for messages that match the given searching criteria. Example: C: A282 SEARCH FLAGGED SINCE 1-Feb-1994 NOT FROM "Smith" S: * SEARCH

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES IMAP4v1 client commands Selected State FETCH: retrieves data associated with a message in the mailbox. STORE: alters data associated with a message in the mailbox. COPY: copies selected messages to the end of the specified destination mailbox.

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES IMAP4v1 session example S: * OK IMAP4rev1 Service Ready C: a001 login mrc secret S: a001 OK LOGIN completed C: a002 select inbox S: * 18 EXISTS S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft) S: * 2 RECENT S: * OK [UNSEEN 17] Message 17 is the first unseen message S: * OK [UIDVALIDITY ] UIDs valid S: a002 OK [READ-WRITE] SELECT completed C: a003 fetch 12 full S: * 12 FETCH (FLAGS (\Seen) INTERNALDATE "17-Jul :44: " RFC822.SIZE 4286 ENVELOPE ("Wed, 17 Jul :23: (PDT)" "IMAP4rev1 WG mtg summary and minutes" (("Terry Gray" NIL "gray" "cac.washington.edu")) ((NIL NIL "imap" "cac.washington.edu")) ((NIL NIL "minutes" "CNRI.Reston.VA.US") ("John Klensin" NIL "KLENSIN" "MIT.EDU")) NIL NIL " ") BODY ("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" )) S: a003 OK FETCH completed

Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES IMAP4v1 session example C: a004 fetch 12 body[header] S: * 12 FETCH (BODY[HEADER] {342} S: Date: Wed, 17 Jul :23: (PDT) S: From: Terry Gray S: Subject: IMAP4rev1 WG mtg summary and minutes S: To: S: cc: John Klensin S: Message-Id: S: MIME-Version: 1.0 S: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII S: S: ) S: a004 OK FETCH completed C: a005 store 12 +flags \deleted S: * 12 FETCH (FLAGS (\Seen \Deleted)) S: a005 OK +FLAGS completed C: a006 logout S: * BYE IMAP4rev1 server terminating connection S: a006 OK LOGOUT completed As a result, message number 12 was deleted from mailbox.