05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.

15
05/19/200 3 Christiane Schmidt 1 IMAP internet message access protocol

Transcript of 05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.

Page 1: 05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.

05/19/2003 Christiane Schmidt 1

IMAP

internet message access protocol

Page 2: 05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.

05/19/2003 Internet message access protocol 2

content

about imap procedure of the imap protocol interaction between client and server flags message attributes different states of an imap session

state diagram commands example of an imap session

Page 3: 05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.

05/19/2003 Internet message access protocol 3

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)

Page 4: 05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.

05/19/2003 Internet message access protocol 4

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

Page 5: 05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.

05/19/2003 Internet message access protocol 5

Procedure of the imap protocol [2]

communication procedure:Connection initializationWelcome of the serverInteraction between client and serverConnection closed

Page 6: 05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.

05/19/2003 Internet message access protocol 6

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

Page 7: 05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.

05/19/2003 Internet message access protocol 7

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

Page 8: 05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.

05/19/2003 Internet message access protocol 8

State diagram

Reject con.

Initialization

Non-Authenticated

Authenticated

Selected

Logout,

Clo

se

Logout

Logout

Logout

Preauth

Select Close

Login

Connect

Page 9: 05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.

05/19/2003 Internet message access protocol 9

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 ‘\’

Page 10: 05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.

05/19/2003 Internet message access protocol 10

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)

Page 11: 05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.

05/19/2003 Internet message access protocol 11

commands

LOGIN username password SELECT mailbox-name CREATE new-mailbox-name DELETE mailbox-name RENAME old-name new-name AUTHENTICATE CLOSE SEARCH COPY

Page 12: 05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.

05/19/2003 Internet message access protocol 12

imap sessionS: * OK IMAP4rev1 Service ReadyC: a001 login TIM timmyS: 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, 19 May 2003 02:23:25 -0700 (PDT)S: From: christiane <[email protected]>S: Subject: weekend planning

Page 13: 05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.

05/19/2003 Internet message access protocol 13

imap session [2]

S: To: steffen <[email protected]>S: cc: steffen <[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

Page 14: 05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.

05/19/2003 Christiane Schmidt 14

[eom]

Thank you for your attention!

Page 15: 05/19/2003 Christiane Schmidt 1 IMAP internet message access protocol.

05/19/2003 Internet message access protocol 15

references

Tanenbaum “Computernetzwerke” IMAP4rev1 Protocol Specification Links:

www.imap.org www.informatik.uni-hamburg.de/RZ/netz/

mail/imap.shtml courses.iicm.edu/~hkrott/docs/nwa-ws2002/

vortraege-20030124.pdf