pop3 and imap protocol

12,751 views

Published on

ppt about pop3 and imap

Published in: Technology
  • Be the first to comment

pop3 and imap protocol

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

×