<s>
In	O
computing	O
,	O
the	O
Internet	B-Protocol
Message	I-Protocol
Access	I-Protocol
Protocol	I-Protocol
(	O
IMAP	B-Protocol
)	O
is	O
an	O
Internet	O
standard	O
protocol	O
used	O
by	O
email	B-Protocol
clients	I-Protocol
to	O
retrieve	O
email	O
messages	O
from	O
a	O
mail	B-Protocol
server	I-Protocol
over	O
a	O
TCP/IP	B-Protocol
connection	O
.	O
</s>
<s>
IMAP	B-Protocol
is	O
defined	O
by	O
.	O
</s>
<s>
IMAP	B-Protocol
was	O
designed	O
with	O
the	O
goal	O
of	O
permitting	O
complete	O
management	O
of	O
an	O
email	O
box	O
by	O
multiple	O
email	B-Protocol
clients	I-Protocol
,	O
therefore	O
clients	O
generally	O
leave	O
messages	O
on	O
the	O
server	O
until	O
the	O
user	O
explicitly	O
deletes	O
them	O
.	O
</s>
<s>
An	O
IMAP	B-Protocol
server	I-Protocol
typically	O
listens	O
on	O
port	B-Protocol
number	I-Protocol
143	O
.	O
</s>
<s>
IMAP	B-Protocol
over	O
SSL/TLS	B-Protocol
(	O
IMAPS	B-Protocol
)	O
is	O
assigned	O
the	O
port	B-Protocol
number	I-Protocol
993	O
.	O
</s>
<s>
Virtually	O
all	O
modern	O
e-mail	B-Application
clients	I-Application
and	O
servers	B-Application
support	O
IMAP	B-Protocol
,	O
which	O
along	O
with	O
the	O
earlier	O
POP3	B-Protocol
(	O
Post	B-Protocol
Office	I-Protocol
Protocol	I-Protocol
)	O
are	O
the	O
two	O
most	O
prevalent	O
standard	O
protocols	O
for	O
email	O
retrieval	O
.	O
</s>
<s>
Many	O
webmail	B-Protocol
service	O
providers	O
such	O
as	O
Gmail	B-Application
and	O
Outlook.com	B-Operating_System
also	O
provide	O
support	O
for	O
both	O
IMAP	B-Protocol
and	O
POP3	B-Protocol
.	O
</s>
<s>
The	O
Internet	B-Protocol
Message	I-Protocol
Access	I-Protocol
Protocol	I-Protocol
is	O
an	O
application	B-Application
layer	I-Application
Internet	O
protocol	O
that	O
allows	O
an	O
e-mail	B-Protocol
client	I-Protocol
to	O
access	O
email	O
on	O
a	O
remote	O
mail	B-Protocol
server	I-Protocol
.	O
</s>
<s>
An	O
IMAP	B-Protocol
server	I-Protocol
typically	O
listens	O
on	O
well-known	B-Protocol
port	I-Protocol
143	O
,	O
while	O
IMAP	B-Protocol
over	O
SSL/TLS	B-Protocol
(	O
IMAPS	B-Protocol
)	O
uses	O
993	O
.	O
</s>
<s>
Incoming	O
email	O
messages	O
are	O
sent	O
to	O
an	O
email	B-Protocol
server	I-Protocol
that	O
stores	O
messages	O
in	O
the	O
recipient	O
's	O
email	O
box	O
.	O
</s>
<s>
The	O
user	O
retrieves	O
the	O
messages	O
with	O
an	O
email	B-Protocol
client	I-Protocol
that	O
uses	O
one	O
of	O
a	O
number	O
of	O
email	O
retrieval	O
protocols	O
.	O
</s>
<s>
While	O
some	O
clients	O
and	O
servers	B-Application
preferentially	O
use	O
vendor-specific	O
,	O
proprietary	O
protocols	O
,	O
almost	O
all	O
support	O
POP	O
and	O
IMAP	B-Protocol
for	O
retrieving	O
email	O
–	O
allowing	O
many	O
free	O
choice	O
between	O
many	O
e-mail	B-Application
clients	I-Application
such	O
as	O
Pegasus	B-Application
Mail	I-Application
or	O
Mozilla	B-Application
Thunderbird	I-Application
to	O
access	O
these	O
servers	B-Application
,	O
and	O
allows	O
the	O
clients	O
to	O
be	O
used	O
with	O
other	B-Application
servers	I-Application
.	O
</s>
<s>
Email	B-Protocol
clients	I-Protocol
using	O
IMAP	B-Protocol
generally	O
leave	O
messages	O
on	O
the	O
server	O
until	O
the	O
user	O
explicitly	O
deletes	O
them	O
.	O
</s>
<s>
This	O
and	O
other	O
characteristics	O
of	O
IMAP	B-Protocol
operation	O
allow	O
multiple	O
clients	O
to	O
manage	O
the	O
same	O
mailbox	O
.	O
</s>
<s>
Most	O
email	B-Protocol
clients	I-Protocol
support	O
IMAP	B-Protocol
in	O
addition	O
to	O
Post	B-Protocol
Office	I-Protocol
Protocol	I-Protocol
(	O
POP	O
)	O
to	O
retrieve	O
messages	O
.	O
</s>
<s>
IMAP	B-Protocol
offers	O
access	O
to	O
the	O
mail	O
storage	O
.	O
</s>
<s>
IMAP	B-Protocol
was	O
designed	O
by	O
Mark	O
Crispin	O
in	O
1986	O
as	O
a	O
remote	O
access	O
mailbox	O
protocol	O
,	O
in	O
contrast	O
to	O
the	O
widely	O
used	O
POP	O
,	O
a	O
protocol	O
for	O
simply	O
retrieving	O
the	O
contents	O
of	O
a	O
mailbox	O
.	O
</s>
<s>
It	O
went	O
through	O
a	O
number	O
of	O
iterations	O
before	O
the	O
current	O
VERSION	O
4rev1	O
(	O
IMAP4	B-Protocol
)	O
,	O
as	O
detailed	O
below	O
:	O
</s>
<s>
The	O
original	O
Interim	O
Mail	O
Access	O
Protocol	O
was	O
implemented	O
as	O
a	O
Xerox	O
Lisp	B-Operating_System
Machine	I-Operating_System
client	O
and	O
a	O
TOPS-20	B-Operating_System
server	O
.	O
</s>
<s>
Although	O
some	O
of	O
its	O
commands	O
and	O
responses	O
were	O
similar	O
to	O
IMAP2	O
,	O
the	O
interim	O
protocol	O
lacked	O
command/response	O
tagging	O
and	O
thus	O
its	O
syntax	O
was	O
incompatible	O
with	O
all	O
other	O
versions	O
of	O
IMAP	B-Protocol
.	O
</s>
<s>
The	O
interim	O
protocol	O
was	O
quickly	O
replaced	O
by	O
the	O
Interactive	B-Protocol
Mail	I-Protocol
Access	I-Protocol
Protocol	I-Protocol
(	O
IMAP2	O
)	O
,	O
defined	O
in	O
(	O
in	O
1988	O
)	O
and	O
later	O
updated	O
by	O
(	O
in	O
1990	O
)	O
.	O
</s>
<s>
IMAP3	B-Protocol
is	O
an	O
extremely	O
rare	O
variant	O
of	O
IMAP	B-Protocol
.	O
</s>
<s>
IMAP3	B-Protocol
was	O
never	O
accepted	O
by	O
the	O
marketplace	O
.	O
</s>
<s>
The	O
IESG	O
reclassified	O
RFC1203	O
"	O
Interactive	B-Protocol
Mail	I-Protocol
Access	I-Protocol
Protocol	I-Protocol
-	O
Version	O
3	O
"	O
as	O
a	O
Historic	O
protocol	O
in	O
1993	O
.	O
</s>
<s>
The	O
IMAP	B-Protocol
Working	O
Group	O
used	O
RFC	O
1176	O
(	O
IMAP2	O
)	O
rather	O
than	O
RFC	O
1203	O
(	O
IMAP3	B-Protocol
)	O
as	O
its	O
starting	O
point	O
.	O
</s>
<s>
With	O
the	O
advent	O
of	O
MIME	B-Protocol
,	O
IMAP2	O
was	O
extended	O
to	O
support	O
MIME	B-Protocol
body	O
structures	O
and	O
add	O
mailbox	O
management	O
functionality	O
(	O
create	O
,	O
delete	O
,	O
rename	O
,	O
message	O
upload	O
)	O
that	O
was	O
absent	O
from	O
IMAP2	O
.	O
</s>
<s>
An	O
internet	O
draft	O
of	O
IMAP2bis	O
was	O
published	O
by	O
the	O
IETF	O
IMAP	B-Protocol
Working	O
Group	O
in	O
October	O
1993	O
.	O
</s>
<s>
Early	O
versions	O
of	O
Pine	B-Operating_System
were	O
widely	O
distributed	O
with	O
IMAP2bis	O
support	O
(	O
Pine	B-Operating_System
4.00	O
and	O
later	O
supports	O
IMAP4rev1	O
)	O
.	O
</s>
<s>
An	O
IMAP	B-Protocol
Working	O
Group	O
formed	O
in	O
the	O
IETF	O
in	O
the	O
early	O
1990s	O
took	O
over	O
responsibility	O
for	O
the	O
IMAP2bis	O
design	O
.	O
</s>
<s>
The	O
IMAP	B-Protocol
WG	O
decided	O
to	O
rename	O
IMAP2bis	O
to	O
IMAP4	B-Protocol
to	O
avoid	O
confusion	O
.	O
</s>
<s>
When	O
using	O
POP	O
,	O
clients	O
typically	O
connect	O
to	O
the	O
e-mail	B-Protocol
server	I-Protocol
briefly	O
,	O
only	O
as	O
long	O
as	O
it	O
takes	O
to	O
download	O
new	O
messages	O
.	O
</s>
<s>
When	O
using	O
IMAP4	B-Protocol
,	O
clients	O
often	O
stay	O
connected	O
as	O
long	O
as	O
the	O
user	O
interface	O
is	O
active	O
and	O
download	O
message	O
content	O
on	O
demand	O
.	O
</s>
<s>
For	O
users	O
with	O
many	O
or	O
large	O
messages	O
,	O
this	O
IMAP4	B-Protocol
usage	O
pattern	O
can	O
result	O
in	O
faster	O
response	O
times	O
.	O
</s>
<s>
In	O
contrast	O
,	O
the	O
IMAP	B-Protocol
protocol	O
provides	O
an	O
dynamic	O
view	O
,	O
and	O
requires	O
that	O
external	O
changes	O
in	O
state	O
,	O
including	O
newly	O
arrived	O
messages	O
,	O
as	O
well	O
as	O
changes	O
made	O
to	O
the	O
mailbox	O
by	O
other	O
concurrently	O
connected	O
clients	O
,	O
are	O
detected	O
and	O
appropriate	O
responses	O
are	O
sent	O
between	O
commands	O
as	O
well	O
as	O
during	O
an	O
IDLE	B-Protocol
command	O
,	O
as	O
described	O
in	O
.	O
</s>
<s>
Usually	O
all	O
Internet	O
e-mail	O
is	O
transmitted	O
in	O
MIME	B-Protocol
format	O
,	O
allowing	O
messages	O
to	O
have	O
a	O
tree	B-Data_Structure
structure	I-Data_Structure
where	O
the	O
leaf	O
nodes	O
are	O
any	O
of	O
a	O
variety	O
of	O
single	O
part	O
content	O
types	O
and	O
the	O
non-leaf	O
nodes	O
are	O
any	O
of	O
a	O
variety	O
of	O
multipart	O
types	O
.	O
</s>
<s>
The	O
IMAP4	B-Protocol
protocol	O
allows	O
clients	O
to	O
retrieve	O
any	O
of	O
the	O
individual	O
MIME	B-Protocol
parts	O
separately	O
and	O
also	O
to	O
retrieve	O
portions	O
of	O
either	O
individual	O
parts	O
or	O
the	O
entire	O
message	O
.	O
</s>
<s>
Through	O
the	O
use	O
of	O
flags	O
defined	O
in	O
the	O
IMAP4	B-Protocol
protocol	O
,	O
clients	O
can	O
keep	O
track	O
of	O
message	O
state	O
:	O
for	O
example	O
,	O
whether	O
or	O
not	O
the	O
message	O
has	O
been	O
read	O
,	O
replied	O
to	O
,	O
or	O
deleted	O
.	O
</s>
<s>
The	O
IMAP4	B-Protocol
protocol	O
supports	O
both	O
predefined	O
system	O
flags	O
and	O
client-defined	O
keywords	O
.	O
</s>
<s>
Keywords	O
,	O
which	O
are	O
not	O
supported	O
by	O
all	O
IMAP	B-Protocol
servers	I-Protocol
,	O
allow	O
messages	O
to	O
be	O
given	O
one	O
or	O
more	O
tags	B-General_Concept
whose	O
meaning	O
is	O
up	O
to	O
the	O
client	O
.	O
</s>
<s>
IMAP	B-Protocol
keywords	O
should	O
not	O
be	O
confused	O
with	O
proprietary	O
labels	O
of	O
web-based	B-Protocol
e-mail	I-Protocol
services	O
which	O
are	O
sometimes	O
translated	O
into	O
IMAP	B-Protocol
folders	O
by	O
the	O
corresponding	O
proprietary	O
servers	B-Application
.	O
</s>
<s>
IMAP4	B-Protocol
clients	O
can	O
create	O
,	O
rename	O
,	O
and	O
delete	O
mailboxes	O
(	O
usually	O
presented	O
to	O
the	O
user	O
as	O
folders	O
)	O
on	O
the	O
server	O
,	O
and	O
copy	O
messages	O
between	O
mailboxes	O
.	O
</s>
<s>
Multiple	O
mailbox	O
support	O
also	O
allows	O
servers	B-Application
to	O
provide	O
access	O
to	O
shared	O
and	O
public	O
folders	O
.	O
</s>
<s>
The	O
IMAP4	B-Protocol
Access	O
Control	O
List	O
(	O
ACL	O
)	O
Extension	B-Application
(	O
)	O
may	O
be	O
used	O
to	O
regulate	O
access	O
rights	O
.	O
</s>
<s>
IMAP4	B-Protocol
provides	O
a	O
mechanism	O
for	O
a	O
client	O
to	O
ask	O
the	O
server	O
to	O
search	O
for	O
messages	O
meeting	O
a	O
variety	O
of	O
criteria	O
.	O
</s>
<s>
Reflecting	O
the	O
experience	O
of	O
earlier	O
Internet	B-Protocol
protocols	I-Protocol
,	O
IMAP4	B-Protocol
defines	O
an	O
explicit	O
mechanism	O
by	O
which	O
it	O
may	O
be	O
extended	O
.	O
</s>
<s>
Many	O
IMAP4	B-Protocol
extensions	O
to	O
the	O
base	O
protocol	O
have	O
been	O
proposed	O
and	O
are	O
in	O
common	O
use	O
.	O
</s>
<s>
IMAP2bis	O
did	O
not	O
have	O
an	O
extension	B-Application
mechanism	O
,	O
and	O
POP	O
now	O
has	O
one	O
defined	O
by	O
.	O
</s>
<s>
IMAP	B-Protocol
IDLE	I-Protocol
provides	O
a	O
way	O
for	O
the	O
mail	B-Protocol
server	I-Protocol
to	O
notify	O
connected	O
clients	O
that	O
there	O
were	O
changes	O
to	O
a	O
mailbox	O
,	O
for	O
example	O
because	O
a	O
new	O
mail	O
has	O
arrived	O
.	O
</s>
<s>
POP	O
provides	O
no	O
comparable	O
feature	O
,	O
and	O
email	B-Protocol
clients	I-Protocol
need	O
to	O
periodically	O
connect	O
to	O
the	O
POP	B-Protocol
server	I-Protocol
to	O
check	O
for	O
new	O
mail	O
.	O
</s>
<s>
While	O
IMAP	B-Protocol
remedies	O
many	O
of	O
the	O
shortcomings	O
of	O
POP	O
,	O
this	O
inherently	O
introduces	O
additional	O
complexity	O
.	O
</s>
<s>
Much	O
of	O
this	O
complexity	O
(	O
e.g.	O
,	O
multiple	O
clients	O
accessing	O
the	O
same	O
mailbox	O
at	O
the	O
same	O
time	O
)	O
is	O
compensated	O
for	O
by	O
server-side	B-Application
workarounds	O
such	O
as	O
Maildir	O
or	O
database	O
backends	O
.	O
</s>
<s>
The	O
IMAP	B-Protocol
specification	O
has	O
been	O
criticised	O
for	O
being	O
insufficiently	O
strict	O
and	O
allowing	O
behaviours	O
that	O
effectively	O
negate	O
its	O
usefulness	O
.	O
</s>
<s>
From	O
an	O
administrative	O
and	O
resource	O
point	O
of	O
view	O
,	O
the	O
IMAP	B-Protocol
protocol	O
can	O
be	O
viewed	O
as	O
an	O
early	O
implementation	O
of	O
cloud	B-Architecture
computing	I-Architecture
,	O
as	O
the	O
intent	O
and	O
purpose	O
of	O
IMAP	B-Protocol
is	O
to	O
maintain	O
your	O
mailbox	O
structure	O
(	O
content	O
,	O
folder	O
structure	O
,	O
individual	O
message	O
state	O
,	O
etc	O
)	O
on	O
the	O
mail	B-Protocol
server	I-Protocol
,	O
whereas	O
with	O
POP	O
,	O
this	O
is	O
all	O
maintained	O
on	O
the	O
user	O
's	O
local	O
device	O
.	O
</s>
<s>
Thus	O
,	O
IMAP	B-Protocol
requires	O
far	O
more	O
server	B-Application
side	I-Application
resources	O
,	O
incurring	O
a	O
significantly	O
higher	O
cost	O
per	O
mailbox	O
.	O
</s>
<s>
IMAP4	B-Protocol
clients	O
need	O
to	O
maintain	O
a	O
TCP/IP	B-Protocol
connection	O
to	O
the	O
IMAP	B-Protocol
server	I-Protocol
in	O
order	O
to	O
be	O
notified	O
of	O
the	O
arrival	O
of	O
new	O
mail	O
.	O
</s>
<s>
Notification	O
of	O
mail	O
arrival	O
is	O
done	O
through	O
in-band	O
signaling	O
,	O
which	O
contributes	O
to	O
the	O
complexity	O
of	O
client-side	O
IMAP	B-Protocol
protocol	O
handling	O
somewhat	O
.	O
</s>
<s>
A	O
private	O
proposal	O
,	O
push	B-Protocol
IMAP	I-Protocol
,	O
would	O
extend	O
IMAP	B-Protocol
to	O
implement	O
push	B-General_Concept
e-mail	I-General_Concept
by	O
sending	O
the	O
entire	O
message	O
instead	O
of	O
just	O
a	O
notification	O
.	O
</s>
<s>
However	O
,	O
push	B-Protocol
IMAP	I-Protocol
has	O
not	O
been	O
generally	O
accepted	O
and	O
current	O
IETF	O
work	O
has	O
addressed	O
the	O
problem	O
in	O
other	O
ways	O
(	O
see	O
the	O
Lemonade	B-Protocol
Profile	I-Protocol
for	O
more	O
information	O
)	O
.	O
</s>
<s>
Unlike	O
some	O
proprietary	O
protocols	O
which	O
combine	O
sending	O
and	O
retrieval	O
operations	O
,	O
sending	O
a	O
message	O
and	O
saving	O
a	O
copy	O
in	O
a	O
server-side	B-Application
folder	O
with	O
a	O
base-level	O
IMAP	B-Protocol
client	O
requires	O
transmitting	O
the	O
message	O
content	O
twice	O
,	O
once	O
to	O
SMTP	B-Protocol
for	O
delivery	O
and	O
a	O
second	O
time	O
to	O
IMAP	B-Protocol
to	O
store	O
in	O
a	O
sent	O
mail	O
folder	O
.	O
</s>
<s>
This	O
is	O
addressed	O
by	O
a	O
set	O
of	O
extensions	O
defined	O
by	O
the	O
IETF	O
Lemonade	B-Protocol
Profile	I-Protocol
for	O
mobile	O
devices	O
:	O
URLAUTH	O
(	O
)	O
and	O
CATENATE	O
(	O
)	O
in	O
IMAP	B-Protocol
,	O
and	O
BURL	O
(	O
)	O
in	O
SMTP-SUBMISSION	O
.	O
</s>
<s>
In	O
addition	O
to	O
this	O
,	O
Courier	B-Protocol
Mail	I-Protocol
Server	I-Protocol
offers	O
a	O
non-standard	O
method	O
of	O
sending	O
using	O
IMAP	B-Protocol
by	O
copying	O
an	O
outgoing	O
message	O
to	O
a	O
dedicated	O
outbox	O
folder	O
.	O
</s>
<s>
To	O
cryptographically	O
protect	O
IMAP	B-Protocol
connections	O
between	O
the	O
client	O
and	O
server	O
,	O
IMAPS	B-Protocol
on	O
TCP	B-Protocol
port	I-Protocol
993	O
can	O
be	O
used	O
,	O
which	O
utilizes	O
SSL/TLS	B-Protocol
.	O
</s>
<s>
Alternatively	O
,	O
STARTTLS	B-Protocol
can	O
be	O
used	O
to	O
encrypt	O
the	O
connection	O
when	O
connecting	O
to	O
port	B-Protocol
143	I-Protocol
after	O
initially	O
communicating	O
over	O
plaintext	O
.	O
</s>
<s>
This	O
is	O
an	O
example	O
IMAP	B-Protocol
connection	O
as	O
taken	O
from	O
:	O
</s>
