Transcript Slide 1

IMAP
internet message access protocol
05/19/2003
Christiane Schmidt
1
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

05/19/2003
Internet message access protocol
2
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)
05/19/2003
Internet message access protocol
3
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
05/19/2003
Internet message access protocol
4
Procedure of the imap protocol [2]

communication procedure:
Connection initialization
 Welcome of the server
 Interaction between client and server
 Connection closed

05/19/2003
Internet message access protocol
5
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
05/19/2003
Internet message access protocol
6
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
05/19/2003
Internet message access protocol
7
State diagram
Initialization
Connect
Non-Authenticated
Login
Authenticated
Select
Close
Selected
05/19/2003
Internet message access protocol
Logout
Logout
Logout
Logout, Close
Preauth
Reject con.
8
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 ‘\’
05/19/2003
Internet message access protocol
9
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)
05/19/2003
Internet message access protocol
10
commands









LOGIN username password
SELECT mailbox-name
CREATE new-mailbox-name
DELETE mailbox-name
RENAME old-name new-name
AUTHENTICATE
CLOSE
SEARCH
COPY
05/19/2003
Internet message access protocol
11
imap session
S:
C:
S:
C:
S:
S:
S:
S:
* OK IMAP4rev1 Service Ready
a001 login TIM timmy
a001 OK LOGIN completed
a002 select inbox
* 18 EXISTS
* FLAGS(\Answered\Flagged\Deleted\Seen\Draft)
* 2 RECENT
* OK [UNSEEN 17] Message 17 is the first unseen
message
S: * OK [UIDVALIDITY 3857529045] UIDs valid
S: a002 OK [READ-WRITE] SELECT completed
C: 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
05/19/2003
Internet message access protocol
12
imap session [2]
S:
S:
S:
S:
S:
S:
S:
S:
C:
S:
S:
C:
S:
S:
To: steffen <[email protected]>
cc: steffen <[email protected]>
Message-Id: <[email protected]>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
)
a003 OK FETCH completed
a004 store 12 +flags \deleted
* 12 FETCH (FLAGS (\Seen \Deleted))
a004 OK +FLAGS completed
a005 logout
* BYE IMAP4rev1 server terminating connection
a005 OK LOGOUT completed
05/19/2003
Internet message access protocol
13
[eom]
Thank you for your attention!
05/19/2003
Christiane Schmidt
14
references
Tanenbaum “Computernetzwerke”
 IMAP4rev1 Protocol Specification
 Links:




www.imap.org
www.informatik.unihamburg.de/RZ/netz/mail/imap.shtml
courses.iicm.edu/~hkrott/docs/nwaws2002/vortraege-20030124.pdf
05/19/2003
Internet message access protocol
15