POP3 & IMAP
By:
Kusum Lata
Vikas Srivastava
Sandeep Goutele
Rohit Mishra
110/08/2010
POP3 & IMAP
POP3 Post Office Protocol
(Version 3 )
210/08/2010POP3 & IMAP
Introduction
What is POP ?
Why POP3 came into picture?
How it works?
10/08/2010 3POP3 & IMAP
Terminology used…
User Agent: end-user mail program Message Transfer Agent: responsible
for communicating with remote hosts and transmitting/receiving email (both a client and server).
Mail Exchanger: host that takes care of email for a domain.
10/08/2010 4POP3 & IMAP
5
POP3
protocol for receiving e-mail client/server protocol achieves transparent connection between
email server and e-mail client store-and-forward service listens on well-known port 110
10/08/2010POP3 & IMAP
POP3 contd………….
Similar to SMTP command/reply lockstep protocol.
Used to retrieve mail for a single userrequires authentication
Commands and replies are ASCII lines.Replies start with “+OK” or “-ERR”.Replies may contain multiple lines.
10/08/2010 6POP3 & IMAP
POP3 – Post Office Protocol
10/08/2010 7POP3 & IMAP
to establish a TCP connection
810/08/2010 8POP3 & IMAP
Contd………..
10/08/2010 9POP3 & IMAP
Contd……
10/08/2010 10POP3 & IMAP
POP-3 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
10/08/2010 POP3 & IMAP 11
More POP-3 Commands
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.
10/08/2010 POP3 & IMAP 12
Optional Commands
TOP - send header lines from messages.
APOP - alternative authenticationmessage digest based on opening
greeting sent from POP server.Requires shared secret!No cleartext password on the network.Does not authenticate the server!!!!
10/08/2010 POP3 & IMAP 13
14
A Pop3 Exchange
> telnet monte pop3Trying 128.213.8.110...Connected to monte.cs.rpi.edu (128.213.8.110).Escape character is '^]'.+OK POP3 monte.cs.rpi.edu v7.59 server readyuser joe+OK User name accepted, password pleasepass joepw+OK Mailbox open, 1 messagesstat+OK 1 412list+OK Mailbox scan listing follows1 412.
14
POP3 Proxy Platform for E-mail Filtering
What is spam? Spam filtering methods
access control method authentication method content based filtering method
05/19/2003 Internet message access protocol 15
PEMF
PEMF achieves three design goals.
Universality Transparency High efficiency and stability
05/19/2003 Internet message access protocol 16
Work flow of PEMF
05/19/2003 Internet message access protocol 17
Advantages of POP3:
You can read your mail without being logged onto the Internet.
You may compose new messages to send to others without being logged onto the Internet.
Opening attachments is a quick and painless. There is not a maximum size on your mailbox. There is no advertising when you read your email All messages are stored on your hard drive
10/08/2010 POP3 & IMAP 18
Disadvantages of POP3:
Opening attachments is a quick and painless process, unless the attachment has a virus payload in it.
If you have JavaScript enabled in your email reader, you might be target of rogue JavaScript embedded in an email.
All messages are stored on your hard drive eating up what is sometimes very valuable space..
10/08/2010 POP3 & IMAP 19
Disadvantages contd………
Since all attachments are stored (downloaded) on your PC there is a potential danger of virus attack if they are not properly scanned by virus scanners.
Email folders can become corrupted and sometimes lost forever. Recovering is often a painful exercise.
10/08/2010 20POP3 & IMAP
IMAP
Internet message access Protocol
2110/08/2010POP3 & IMAP
10/08/2010 POP3 & IMAP 22
About IMAP
Internet message access protocol 1986, Stanford University Stands for accessing electronic mail that
are kept on a server access messages from more than one
computer More than one user Imap protocol based on a TCP connection
(port 143) No functionality to send messages (realized
with SMTP)
POP V/s IMAP
05/19/2003 POP3 & IMAP 23
Advantages over POP
Built in extension mechanism Multiple clients connected
simultaneous to the same mailbox Access to MIME Message State Information Multiple mailbox on the server Server Aid searches
05/19/2003 POP3 & IMAP 24
10/08/2010 POP3 & IMAP 25
Procedure of the imap protocol
All emails are kept on a mail server Functionality:
Treat as local directory work directly on server copy delete different folders
download message headers and later on the full messages
10/08/2010 POP3 & IMAP 26
Procedure of the imap protocol [2]
communication procedure:Connection initializationWelcome of the serverInteraction between client and serverConnection closed
10/08/2010 POP3 & IMAP 27
Interaction between client and server
Client sends data - server receives: client-command begins with alphanumeric string
(‘tag’) e.g. A001 which is created for every new command
then the command with corresponding arguments follows
Server sends data – client receives Server receives and works with the command Returns the same tag with a state (OK/NO/BAD) Additional information begin with ‘*’ (untagged) Untagged in formation can be sent at every time
10/08/2010 POP3 & IMAP 28
Different states of an imap session
Most commands are only valid in special states (otherwise: protocol error)
4 states (initialization is not an own state) Non-Authenticated Authenticated Selected Logout, Closed
10/08/2010 POP3 & IMAP 29
State diagram
Reject con.
Initialization
Non-Authenticated
Authenticated
Selected
Logout,
Clo
se
Logout
Logout
Logout
Preauth
Select Close
Login
Connect
10/08/2010 POP3 & IMAP 30
Flags message attributes
List of token associated with the message that is sent by the server
A flag can be permanent or session-only types:
System flag:• flag name that is pre-defined in the imap
specification • All system flags begin with ‘\’
Keywords:• A keyword is defined by the server implementation• Keywords do not begin with ‘\’
10/08/2010 POP3 & IMAP 31
Flags Message Attributes [2]
\Seen (Message has been read) \Answered (Message has been answered) \Flagged (Message is "flagged" for
urgent/special attention) \Deleted (Message is "deleted" for removal by
later EXPUNGE) \Draft (Message has not completed
composition (marked as a draft)) \Recent (Message is "recently" arrived in this
mailbox. This session is the first session to have been notified about this message)
10/08/2010 POP3 & IMAP 32
Commands
LOGIN username password SELECT mailbox-name CREATE new-mailbox-name DELETE mailbox-name RENAME old-name new-name AUTHENTICATE CLOSE SEARCH COPY
10/08/2010 POP3 & IMAP 33
Imap sessionS: * OK IMAP4rev1 Service ReadyC: a001 login rohit zealousS: a001 OK LOGIN completedC: a002 select inboxS: * 18 EXISTSS: * FLAGS(\Answered\Flagged\Deleted\Seen\Draft)S: * 2 RECENTS: * OK [UNSEEN 17] Message 17 is the first unseen
messageS: * OK [UIDVALIDITY 3857529045] UIDs validS: a002 OK [READ-WRITE] SELECT completedC: a003 fetch 12 body[header]S: * 12 FETCH (BODY[HEADER] {350}S: Date: Wed, 11 August 2010 02:23:25 -0700 (PDT)S: From: rohit <[email protected]>S: Subject: weekend planning
10/08/2010 POP3 & IMAP 34
Imap session [2]
S: To: rahul <[email protected]>S: cc: bharat <[email protected]>S: Message-Id: <[email protected]>S: MIME-Version: 1.0S: Content-Type: TEXT/PLAIN; CHARSET=US-ASCIIS:S: )S: a003 OK FETCH completedC: a004 store 12 +flags \deletedS: * 12 FETCH (FLAGS (\Seen \Deleted))S: a004 OK +FLAGS completedC: a005 logoutS: * BYE IMAP4rev1 server terminating connectionS: a005 OK LOGOUT completed
10/08/2010 POP3 & IMAP 35
Thank you for your attention!
Top Related