Internet Technology 2/13/2013

Similar documents
FTP and . Computer Networks. FTP: the file transfer protocol

Chapter 2 Application Layer. Lecture 5 FTP, Mail. Computer Networking: A Top Down Approach

CSCI-1680 SMTP Chen Avin

CPSC Network Programming. , FTP, and NAT.

CS43: Computer Networks . Kevin Webb Swarthmore College September 24, 2015

Protocolo FTP. FTP: Active Mode. FTP: Active Mode. FTP: Active Mode. FTP: the file transfer protocol. Separate control, data connections

2- Electronic Mail (SMTP), File Transfer (FTP), & Remote Logging (TELNET)

FTP: the file transfer protocol

Electronic Mail

Evolution of the WWW. Communication in the WWW. WWW, HTML, URL and HTTP. HTTP Abstract Message Format. The Client/Server model is used:

DATA COMMUNICATOIN NETWORKING

Networking Applications

FTP: the file transfer protocol

2- Electronic Mail (SMTP), File Transfer (FTP), & Remote Logging (TELNET)

Evolution of the WWW. Communication in the WWW. WWW, HTML, URL and HTTP. HTTP - Message Format. The Client/Server model is used:

. Daniel Zappala. CS 460 Computer Networking Brigham Young University

1 Introduction: Network Applications

The Application Layer. CS158a Chris Pollett May 9, 2007.

Computer Networks. Instructor: Niklas Carlsson

, SNMP, Securing the Web: SSL

Network Services. SMTP, Internet Message Format. Johann Oberleitner SS 2006

Application Example: WWW. Communication in the WWW. WWW, HTML, URL and HTTP. Loading of Web Pages. The Client/Server model is used in the WWW

Simple Mail Transfer Protocol

Mail system components. Electronic Mail MRA MUA MSA MAA. David Byers

Remote login (Telnet):

Appendix. Web Command Error Codes. Web Command Error Codes

Cours du 22 novembre

Digital Communication in the Modern World Application Layer cont. DNS, SMTP

Electronic mail security. MHS (Message Handling System)

Internet Technologies Internet Protocols and Services

. MIME is the protocol that was devised to allow non-ascii encoded content in an and attached files to an .

Sonian Getting Started Guide October 2008

Writing for Developers: The New Customers. Amruta Ranade

Collax Mail Server. Howto. This howto describes the setup of a Collax server as mail server.

Applications and Services. DNS (Domain Name System)

Application-layer Protocols and Internet Services

Introduction. -- some basic concepts and terminology -- examples for attacks on protocols -- main network security services

Telematics. 13th Tutorial - Application Layer Protocols

Communication Systems Network Applications - Electronic Mail

Issue 2EN. Nokia and Nokia Connecting People are registered trademarks of Nokia Corporation

The Application Layer: DNS

1. The Web: HTTP; file transfer: FTP; remote login: Telnet; Network News: NNTP; SMTP.

CS 164 Winter 2009 Term Project Writing an SMTP server and an SMTP client (Receiver-SMTP and Sender-SMTP) Due & Demo Date (Friday, March 13th)

File Transfer Protocol (FTP) & SSH

Technical papers How works

Internet Security [1] VU Engin Kirda

Mail agents. Introduction to Internet Mail. Message format (2) Authenticating senders

internet technologies and standards

Integrated Migration Tool

Integrated Migration Tool

IxLoad Data Mail (SMTP, POP3, IMAP) Features

Introduction. Friday, June 21, 2002

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ MEng. Nguyễn CaoĐạt

Management CSCU9B2 CSCU9B2 1

Using WinGate 6 . Concepts, Features, and Configurations.

MailEnable Web Mail End User Manual V 2.x

Quick Scan Features Setup Guide. Scan to Setup. See also: System Administration Guide: Contains details about setup.

Sending via Public Sites Model 5300 Controller

Configuring Outlook to send mail via your Exchange mailbox using an alternative address

Troubleshooting IBM Lotus Domino 8 mail routing issues

Business Internet service from Bell User Guide

WEBROOT ARCHIVING SERVICE. Getting Started Guide North America. The best security in an unsecured world. TM

s sent to the FaxFinder fax server must meet the following criteria to be processed for sending as a fax:

Articles Fighting SPAM in Lotus Domino

Introduction to Computer Networks

Quick Scan Features Setup Guide

4.1: Securing Applications Remote Login: Secure Shell (SSH) PEM/PGP. Chapter 5: Security Concepts for Networks

PCRecruiter Internal Client

The basic groups of components are described below. Fig X- 1 shows the relationship between components on a network.

Domain Name System (DNS)

CS 356 Lecture 27 Internet Security Protocols. Spring 2013

Implementing MDaemon as an Security Gateway to Exchange Server

XGENPLUS SECURITY FEATURES...

Electronic Mail Security

Introduction to Computer Security Benoit Donnet Academic Year

Quick-Start Guide

QMAIL & SMTP: A Secure Application for an Unsecure Protocol. Orr Dunkelman. orrd@vipe.technion.ac.il. January 27, 2004 SMTP and QMAIL Slide 1

Mail Programs. Manual

Category: Experimental February 1996

Introduction to LAN/WAN. Application Layer (Part II)

Warwick The Switch Over to

Proxies. Chapter 4. Network & Security Gildas Avoine

How to Pop to Outlook

Issue 1 EN. Nokia and Nokia Connecting People are registered trademarks of Nokia Corporation

Objective This howto demonstrates and explains the different mechanisms for fending off unwanted spam .

Web Mail Classic Web Mail

StreamServe Persuasion SP4 Connectors

Network Technologies

Lab 7: Introduction to Pen Testing (NMAP)

My FreeScan Vulnerabilities Report

Using Avaya Aura Messaging

Advanced Settings. Help Documentation

A New Approach to Enhance Performance Through SMTP Protocol

smtplib SMTP protocol client

Nokia for Business. Nokia and Nokia Connecting People are registered trademarks of Nokia Corporation

Application layer Protocols application transport

Domain Name System WWW. Application Layer. Mahalingam Ramkumar Mississippi State University, MS. September 15, 2014.

Clearswift Information Governance

JAVAMAIL API - SMTP SERVERS

Transcription:

Internet Technology 03r. Application layer protocols: email Email: Paul Krzyzanowski Rutgers University Spring 2013 1 2 Simple Mail Transfer Protocol () Defined in RFC 2821 (April 2001) Original definition in RFC 821 (August 1982) Designed for: Direct transfer from the sender to the receiver (rather then go through a set of relays) Destination system is always up and connected Use TCP to transfer email from client to destination server Note: There are a lot of variations on email delivery, transmission, and routing. We ll look at a basic model here. Our interest is the app-layer protocol and we ll avoid the terminology of mail submission agents, mail transfer agents, mail exchangers, and mail delivery agents. In most cases one program serves as the role all of these. Original model: Alice sends message to Bob In the early days of email, users were logged into one system. A mail application would send a message to a local mail server. The local mail server would maintain a queue and send messages to their destinations. Receiving users would run a mail application on the server that would open the mail file their queue of received messages. Alice uses a mail application (User Agent, UA) to compose a message to Bob Alice s UA sends the message to her local mail server message is in the outbound queue The local server (acting as an client) uses DNS to look up the MX record (Mail Exchanger) for Bob s domain; opens TCP connection with Bob s mail server Client machine Local client/ser ver Alice s local mail server (acting as a client) sends Alice s message over the TCP connection using Bob s mail server receives it and places the message in Bob s mailbox Bob runs his UA, which can access his mailbox Server machine 3 4 Small enhancements to the model Mail delivery Alice will usually not be on the same machine as the local server Alice s UA is a email app running on her phone or laptop. It sends the message to her email provider s server using The email provider uses to talk to the destination server Mail receipt Bob is usually not on the same machine as his mail server His mail program cannot access his mailbox directly Bob s UA needs to use a network protocol such as IMAP or POP to get the message Simple Mail Transfer Protocol () Three phases: 1. Handshaking (greeting) 2. Transfer of message 3. Closing Command/response interaction The protocol is conversational text A set of one-line messages & one-line responses Then the message followed by a single line containing a period (.) Finally, a QUIT command All transactions in 7-bit ASCII text Responses contain a status code & phrase (like HTTP and FTP) Alice s Mac Alice s email provider Bob s email provider Bob s iphone 5 6 Paul Krzyzanowski 1

The basic protocol Sample Interaction The following sequence of commands are used to send email HELO rutgers.edu MAIL FROM: <pxk@cs.rutgers.edu> RCPT TO: <testuser@pk.org> RCPT TO: <anotheruser@pk.org> DATA QUIT The client identifies itself as rutgers.edu. This is often ignored now since the server may do a reverse DNS lookup on the IP address. Identify the address of the mail sender. Note that the domain here may be different from that in the HELO message. Identify the destination(s) for this message. You can have a list of these one line per destination. Now give the server the mail message. All the lines after this are the message. A line containing a single period ends it. We re done! $ telnet cs.rutgers.edu 25 This is a sample interaction with me connecting to a Trying 128.6.4.2... Rutgers server via the telnet program and typing in commands. My typing is in blue. Connected to cs.rutgers.edu. 220 aramis.rutgers.edu E Sendmail 8.11.7p3+Sun/8.8.8; Mon, 11 Feb 2013 16:59:12-0500 (EST) HELO cs.rutgers.edu 250 aramis.rutgers.edu Hello aramis.rutgers.edu [128.6.4.2], pleased to meet you MAIL FROM: <pxk@cs.rutgers.edu> 250 2.1.0 <pxk@cs.rutgers.edu>... Sender ok RCPT TO: <testuser@pk.org> 250 2.1.5 <p@pk.org>... Recipient ok DATA 354 Enter mail, end with "." on a line by itself From: Paul Krzyzanowski <pxk@cs.rutgers.edu> Subject: test message Date: Mon, 11 Feb 2013 17:00:16-0500 To: Whomever <testuser@pk.org> Hi, This is a test. 250 2.0.0 r1blxln29829 Message accepted for delivery quit 221 2.0.0 aramis.rutgers.edu closing connection This is the message body. Headers may define the structure of the message but are ignored for delivery. 7 8 Comparison with HTTP HTTP: pull (you request content) : push (you provide content) Both use ASCII command/response interaction Status codes & messages HTTP Each object is encapsulated in its own message Multiple objects can be sent in a multipart message ( is oblivious to this) Mail message format RFC 822 defines the basic format for text messages Header lines: To: From: Subject: Each line contains field_name: field_value Terminated by a blank line Body The actual message All this is treated as the message by It s up to the user agents to interpret those headers Header fields Message body See RFC 822 for details 9 10 Mail headers versus data is interested in delivering the message The crucial data is in the RCPT TO: commands All mail headers are ignored by From:, To:, Subject:, Cc:, Bcc:, etc. These are strictly for the mail apps (user agents) to use Mail is delivered exactly the same way whether a recipient is specified as a To, Cc, or Bcc: they will always end up as RCPT TO: commands in Multimedia extensions: MIME MIME: multimedia mail extension (RFC 2045, 2056) Lines in the message header define the content type Type of data Method used to encode the data Version of the format Other stuff, such as how to present it and what the filename is Encoded data From: Paul Krzyzanowski <p@pk.org> Content-Type: image/jpg Content-Transfer-Encoding: base64 Subject: test mime Date: Mon, 11 Feb 2013 17:13:32-0500 To: Paul Krzyzanowski <p@pk.org> Mime-Version: 1.0 Content-Disposition: inline; filename=test-photo.jpg /9j/4RZpRXhpZgAATU0AKgAAAAgADAEAAAMAAAABAcIA AAEBAAMAAAABAUEAAAECAAMAAAADAAAA ngegaamaaaabaaiaaaesaamaaaabaaeaaaevaamaa AABAAMAAAEaAAUAAAABAAAApAEbAAUAAAAB 11 12 Paul Krzyzanowski 2

Multimedia extensions: multipart MIME Support multiple items in one message Start of content 1 Start of content 2 From: Paul Krzyzanowski <p@pk.org> Content-Type: multipart/mixed; boundary= Split-96E43D94-57D4" Subject: multipart mime demo Date: Mon, 11 Feb 2013 17:19:08-0500 To: Paul Krzyzanowski <p@pk.org> Mime-Version: 1.0 --Split-96E43D94-57D4 Content-Disposition: INLINE; filename=test_image.jpg Content-Type: IMAGE/JPG; name=test_image.jpg; x-unix-mode=0644 Content-Transfer-Encoding: BASE64 /9j/4RZpRXhpZgAAT... <rest of content> --Split-96E43D94-57D4 Content-Disposition: ATTACHMENT; filename=test.skp Content-Type: APPLICATION/OCTET-STREAM; name=test.skp; x-unix-mode=0644 Content-Transfer-Encoding: BASE64 //7/DlMAawBl... <rest of content> Mail access protocols: POP & IMAP 13 14 Mail access deals with mail deliver Sending messages to their destination When people started to run mail apps on machines other than the mail server: The app didn t have direct (file system) access to the mailbox A protocol was needed to interact with the user s mailbox on the server Two protocols were developed POP3: Post Office Protocol version 3 (RFC 1939) IMAP: Internet Mail Access Protocol (RFC 1730) POP3 Client (mail application) connects to TCP port 110 Three phases: 1. Identification & authentication Send user name and password 2. Transaction Mail access commands 3. Update & exit 15 16 POP3: Authentication User login commands user username pass password All commands are sent in plain text! This is not secure since internet traffic can be intercepted $ telnet pk.org 110 Trying 192.168.60.130... Connected to pk.org. +OK Dovecot ready. user paul +OK pass mypassword +OK Logged in. It is a fundamental weakness here and with other protocols (HTTP, telnet, ftp) POP3 is usually run over an encrypted session POP3: Transaction After authentication, the mail app (user agent) sends a series of commands to fetch or delete mail messages stat show the number of messages in the mailbox and total size stat +OK 3 5467 list show a list of messages with the size of each message. A line containing a period indicates end of data list +OK Mailbox scan listing follows 1 1823 2 1825 3 1819 retr retrieve a message retr 2 +OK 1823 octets --- all message headers and message message content, including headers. 17 18 Paul Krzyzanowski 3

POP3: Transaction POP3: Update & exit After authentication, the mail app (user agent) sends a series of commands to fetch or delete mail messages dele delete a specific message Dele 1 +OK Message deleted When done with the session, make changes permanent quit commit changes and exit quit +OK Goodbye rset reset the session: undo all deletes rset +OK Reset state 19 20 POP3 behavior download-and-delete behavior A mail client connects to a server Download messages into its local mailbox Delete them from the server This doesn t work when you access mail from multiple devices download-and-keep behavior A mail client client connects to a server Downloads messages but does not delete them User may delete specific messages A user can access the messages from another device But POP3 does not keep session state; it does not know if a user marked a message for deletion during a previous session IMAP With POP3 Folders, moving messages, & search are all handled at the client with client downloads of the messages IMAP was created for users who access mail from multiple clients IMAP keeps all messages on the server User can organize messages in folders State is stored on the server & available across sessions Names of folders Message ID mappings Mark for deletion Messages reside in folders Commands allow users to Create/delete folders, move messages between folders, search for specific messages, mark messages for deletion, delete messages, fetch headers only 21 22 IMAP Commands We won t cover the IMAP protocol It s a lot uglier and a lot more verbose TCP connection All commands are sent as lines of ASCII text Commands are more verbose spelled out, not abbreviated Each command is prefixed with a unique tag (unique per session) A sequence of commands can be sent without waiting for a response before sending the next one IMAP Protocol Example Login a01 login paul mypassword RESPONSE: a01 OK User logged in List folders a02 list "Mail" "* * LIST (\NoSelect) "/" Mail * LIST (\NoInferiors \Marked) "/" Mail/Trash * LIST (\NoInferiors \Marked) "/" Mail/Sent * LIST (\NoInferiors \UnMarked) "/" Mail/Drafts * LIST (\NoSelect) "/" Mail/inbox <stuff deleted> a02 OK LIST complete Fetch message 1 with full headers a03 fetch 1 full * 1 FETCH (FLAGS (\Seen) INTERNALDATE 13-Feb-2013 14:46:22-0500" RFC822.SIZE 1 553 ENVELOPE ("Wed, 13 Feb 2013 14:46:22-0400 Test Message <stuff deleted> a03 OK FETCH completed 23 24 Paul Krzyzanowski 4

The end 25 Paul Krzyzanowski 5