ColdFusion Foundations: POP3 Mosh Teitelbaum evoch, LLC.

Slides:



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

Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of information between to hosts –when a dignitary visits a.
By: E. Susheel Chandar M. Guna Sekaran Intranet Mail Server.
INTRANET MAIL SERVER (DESIGN OF SMTP and POP3)
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,
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
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.
SIMPLE MAIL TRANSFER PROTOCOL SECURITY Guided By Prof : Richard Sinn Bhavesh Jadav Mayur Mulani.
» Explain the way that electronic mail ( ) works » Configure an client » Identify message components » Create and send messages.
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)
Implementing POP3 and IMAP4 Using Dovecot
SMTP, POP3, IMAP.
1 Application Layer Lecture 5 Imran Ahmed University of Management & Technology.
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.
( Post Office Protocol - Version 3 ) POP3 RFC 1939 報告學生 : 駱正哲.
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.
Telecooperation Technische Universität Darmstadt Copyrighted material; for TUD student use only Internet Standards: Julian Schröder-Bernhardi, Dirk.
Sending and Receiving Mails
FTP (File Transfer Protocol) & Telnet
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
Simple Mail Transfer Protocol (SMTP)
1 Using Messages sent from machine to machine and stored for later reading. You will use a client to read –Type mail or pine in UNIX to read.
What is and How Does it Work?  Electronic mail ( ) is the most popular use of the Internet. It is a fast and inexpensive way of sending messages.
File Transfer Protocol (FTP)
05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.
Krerk Piromsopa. Application Protocols & System Services. 1 Krerk Piromsopa. Department of Computer Engineering. Chulalongkorn University.
POP3
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.
Web Client-Server Server Client Hypertext link TCP port 80.
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.
TFTP: Trivial file transfer protocol
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.
P.O.P. A presentation brought to you by Thomas. Topics Introduction General Information Area of use Functionality The alternative way POP3 vs. IMAP Conclusion.
SMTP - Simple Mail Transfer Protocol RFC 821
CITA 310 Section 6 Providing Services (Textbook Chapter 8)
Post Office Protocol.
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
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
@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
Securing Bruce Maggs.
Client / Session Identification Cookies
ColdFusion Foundations: POP3
Chapter 2: Application layer
Internet and Intranet Protocols and Applications
Presentation transcript:

ColdFusion Foundations: POP3 Mosh Teitelbaum evoch, LLC

POP3: Post Office Protocol – Version 3 Purpose To allow a workstation to retrieve mail - RFC 1939 What is POP3? A protocol that defines how clients communicate with servers to retrieve messages. What does POP3 do? It allows messages to be retrieved from the server. It does not support transmission of messages by clients.

POP3 Involves Clients and Servers POP3 Client POP3 Server Internet File System Database Server Message Store

POP3 Communication Process 1.Session Initiation - Client establishes 2-way connection to server (port 110) which responds with welcome message 2.AUTHORIZATION State - Client sends identification and server responds with another message, acquires access to the user’s mail store and enters the TRANSACTION state. 3.TRANSACTION State – Client initiates one or more transactions. 4.UPDATE State - Client initiates termination of connection and server updates mail store, sends a farewell message and terminates the connection.

POP3 Commands and Responses All client-server communication involves: Commands Clients send commands to provide information and instructions to the server Commands are usually 3-4 characters and are case-insensitive Responses Servers respond with a status indicator and a keyword possibly followed by more information. Status indicators are “ +OK ” (positive) or “ –ERR ” (negative) Single line responses end with a single CRLF Multiple line responses end with a line consisting solely of a period and a CRLF

POP3 Commands CommandDescription QUITInitiates session termination STATRequests a “drop listing” indicating number of messages and size of the mail store LIST [msg]Requests a “scan listing” for specified or all message(s) indicating message number and size of the message RETR msgRetrieves specified message DELE msgMarks specified message as deleted NOOPNo operation RSETResets initial state by unmarking deleted messages TOP msg nRetrieves specified message’s headers and top n lines of body UIDL [msg]Requests a “unique-id listing” for specified or all message(s) indicating message number and unique ID of the message USER nameSpecifies username for USER/PASS authentication PASS passwordSpecifies password for USER/PASS authentication APOP name digestSpecifies MD5-based authentication credentials

POP3 Authorization State The Authorization state begins upon transmission of the 1-line welcome message: Client must identify and authenticate itself: USER/PASS – Plaintext authentication APOP – MD5 digest “encryption” AUTH – Alternate authentication mechanism (RFC 1734) If authentication fails, client can try again or may terminate the session via the QUIT command If authentication is successful, server enters Transaction state +OK POP3 server ready

USER/PASS Authentication Plaintext authentication via username and password Simplest form of authentication but also the least secure +OK POP3 server ready USER +OK PASS cfugDemo123 +OK 0 messages 0 octets +OK POP3 server ready USER +OK PASS hack -ERR Unknown user or incorrect password

APOP Authentication Authentication via username and MD5 hashed password Server indicates APOP support by sending timestamp in welcome message +OK POP3 server ready Wed, 18 Aug :37:44 –0400 +OK POP3 server ready Wed, 18 Aug :05: APOP 786b5c12203b391c9a903b515ce65a12 +OK 0 messages 0 octets Digest is the password appended to the timestamp (including angle brackets) which is then run through the MD5 algorithm

AUTH Authentication Specified in RFC 1734, “POP3 AUTHentication Command,” to allow use of IMAP4 authentication mechanisms in POP3 Client-specified authentication mechanism allowing for much more secure means of authentication +OK POP3 server ready AUTH KERBEROS_V4 + AmFYig== BAcAQU5EUkVXLkNNVS5FRFUAOCAsho84kLN3/IJmrMG+25a4DT +nZImJjnTNHJUtxAA+o0KPKfHEcAFs9a3CL5Oebe/ydHJUwYFd WwuQ1MWiy6IesKvjL5rL9WjXUb9MwT9bpObYLGOKi1Qh + or//EoAADZI= DiAF5A4gA+oOIALuBkAAmw== +OK Kerberos V4 authentication successful

POP3 Transaction State The Transaction state begins when the client successfully authenticates and the server gains exclusive access to the mail store After gaining access, server assigns a message-number to each message which is good for the duration of the session Client may repeatedly issue any number of commands Each client command is followed by a server response After client issues the QUIT command, server enters UPDATE state.

STAT Command The STAT command requests a “drop listing” of the server indicating number of messages and the size of the mail store Drop listings consist of a positive response code, a space, the number of messages, a space and the size of the maildrop STAT +OK

LIST Command The LIST command requests a “scan listing” indicating message number and size of specified or all message(s) Drop listings consist of the message number, a space and the size of the message LIST +OK 2 messages 2068 octets LIST 2 +OK

RETR Command The RETR command retrieves the specified message RETR 1 +OK 1015 octets From: "Mosh Teitelbaum" To: Subject: Test Message #1 Date: Wed, 18 Aug :58:32 –0400 [... more headers...] RETR 3 -ERR No such message

DELE Command The DELE command marks the specified message for deletion The message is “deleted” from the current client session but is not actually removed from the message store until the UPDATE state Messages marked as deleted can be undeleted via RSET DELE 1 +OK Message deleted

NOOP Command The NOOP command doesn’t change anything Usually used to maintain an idle state without having the server terminate the connection from lack of activity NOOP +OK

RSET Command The RSET command resets the session (i.e, undeletes all messages marked for deletion) RSET +OK

QUIT Command The QUIT command terminates the session If issued in the Authorization state, server does not enter UPDATE state. If issued in the Transaction state, server enters UPDATE state. QUIT +OK POP3 server closing connection

TOP Command The optional TOP command retrieves the headers and first n lines of the specified message TOP 2 3 +OK 1053 octets From: "Mosh Teitelbaum" To: Subject: Test Message #1 Date: Wed, 18 Aug :58:32 –0400 [... more headers...] 1st line 2nd line 3rd line.

UIDL Command The optional UIDL command requests a “unique-id listing” indicating current message number and permanent unique ID Unique-id listings consist of the message number, a space and the unique ID of the message UIDL +OK E5E E640. UIDL 2 +OK E640

POP3 Update State The Update state begins when the client issues the QUIT command from within the Transaction state In the Update state, the server deletes marked messages from the mail store, releases its exclusive access to the mail store, sends a farewell message to the client and terminates the connection

Retrieves and/or deletes messages from a POP mail server. Retrieved messages are placed in specified query. Most common attributes are below: AttributeDescription Server, PortOptional. Specifies server and port to connect to. Username, Password Optional. Specifies username and password to use for authentication ActionOptional. getHeaderOnly (default) | getAll | delete NameRequired for getHeaderOnly and getAll. Name of the query object that contains the retrieved message info messageNumberComma-delimited list of message numbers. Ignored if uid is specified. uidComma-delimited list of Unique Ids. New in CFMX. attachmentPathOptional. Directory in which attachments should be saved

Query Columns For actions getHeaderOnly and getAll, the query specified via the NAME attribute has the following columns: ColumnDescription Date, From, ReplyTo, Subject, CC, To Standard header values MessageNumberThe message’s MessageID UIDThe message’s UniqueID Body, TextBody, HtmlBody First, text/plain, and text/html message parts, respectively. getAll only. headerThe message’s header part. getAll only. Attachments, AttachmentFiles Tab delimited lists of the attachment names and locations (full path). getAll only.

Date Format Date values returned via are in UTC/GMT format Thu, 19 Aug :22: To convert to a standard ColdFusion date value in local time use: function getTimeStamp(httpTimeString) { // Build Time Stamp var tsParts = ListToArray(httpTimeString, " "); var timeStamp = "{ts '" & tsParts[4] & "-" & DateFormat("#tsParts[3]#/1/1970", "mm") & "-" & tsParts[2] & " " & tsParts[5] & "'}"; // Convert to local time timeStamp = DateConvert("utc2Local", timeStamp); // Return timeStamp return timeStamp; }

Example: Get Message Headers <CFPOP ACTION="getHeaderOnly" NAME="getHeaders" SERVER="server" PORT="port" USER="username" PASSWORD="password">

Example: Get Message <CFPOP ACTION="getAll" NAME="getMessage" SERVER="server" PORT="port" USER="username" PASSWORD="password" UID=" E640" ATTACHMENTPATH="C:\Attachments\">

Example: Delete Message <CFPOP ACTION="delete" SERVER="server" PORT="port" USER="username" PASSWORD="password" UID=" E640">

POP Resources RFCs from rfc1939.txt – “Post Office Protocol - Version 3” rfc2384.txt – “POP URL Scheme” rfc2449.txt – “POP3 Extension Mechanism” rfc1734.txt – “POP3 AUTHentication command” rfc2195.txt – “IMAP/POP AUTHorize Extension for Simple Challenge/Response” rfc3206.txt – “The SYS and AUTH POP Response Codes” rfc2595.txt – “Using TLS with IMAP, POP3 and ACAP” rfc1321.txt – “MD5 Algorithm” rfc1521.txt – “MIME (Multipurpose Internet Mail Extensions) Part One: Mechanisms for Specifying and Describing the Format of Internet Message Bodies” rfc2045.txt - “Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies”

Closing Questions? Contact Info Mosh Teitelbaum evoch, LLC