draft-ietf-lemonade-imap-notify-07.txt   rfc5465.txt 
Network Working Group Alexey Melnikov Network Working Group A. Gulbrandsen
Internet-Draft Isode Ltd. Request for Comments: 5465 Oryx Mail Systems GmbH
Intended Status: Proposed Standard Arnt Gulbrandsen Updates: 5267 C. King
Oryx Mail Systems GmbH Category: Standards Track A. Melnikov
Curtis King
Isode Ltd. Isode Ltd.
August 18, 2008 February 2009
The IMAP NOTIFY Extension The IMAP NOTIFY Extension
draft-ietf-lemonade-imap-notify-07.txt
Status of this Memo
By submitting this Internet-Draft, each author represents that any Status of This Memo
applicable patent or other IPR claims of which he or she is aware
have been or will be disclosed, and any of which he or she becomes
aware will be disclosed, in accordance with Section 6 of BCP 79.
Internet-Drafts are working documents of the Internet Engineering This document specifies an Internet standards track protocol for the
Task Force (IETF), its areas, and its working groups. Note that Internet community, and requests discussion and suggestions for
other groups may also distribute working documents as Internet- improvements. Please refer to the current edition of the "Internet
Drafts. Official Protocol Standards" (STD 1) for the standardization state
and status of this protocol. Distribution of this memo is unlimited.
Internet-Drafts are draft documents valid for a maximum of six Copyright Notice
months and may be updated, replaced, or obsoleted by other documents
at any time. It is inappropriate to use Internet-Drafts as
reference material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at Copyright (c) 2009 IETF Trust and the persons identified as the
http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet- document authors. All rights reserved.
Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html.
This Internet-Draft expires in February 2009. This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents (http://trustee.ietf.org/
license-info) in effect on the date of publication of this document.
Please review these documents carefully, as they describe your rights
and restrictions with respect to this document.
Abstract Abstract
This document defines an IMAP extension which allows a client to This document defines an IMAP extension that allows a client to
request specific kinds of unsolicited notifications for specified request specific kinds of unsolicited notifications for specified
mailboxes, such as messages being added to or deleted from mailboxes, such as messages being added to or deleted from such
mailboxes. mailboxes.
[[Add Updates: RFC-CONTEXT to the headers]]
Internet-draft August 2008
Table of Contents Table of Contents
1. Conventions Used in This Document . . . . . . . . . . . . . . 3 1. Overview and Rationale ..........................................3
2. Overview and rationale . . . . . . . . . . . . . . . . . . . . 3 2. Conventions Used in This Document ...............................4
3. The NOTIFY extension . . . . . . . . . . . . . . . . . . . . . 4 3. The NOTIFY Extension ............................................4
3.1. The NOTIFY Command . . . . . . . . . . . . . . . . . . . . 4 3.1. The NOTIFY Command .........................................4
4. Interaction with the IDLE Command . . . . . . . . . . . . . . 8 4. Interaction with the IDLE Command ...............................8
5. Event Types . . . . . . . . . . . . . . . . . . . . . . . . . 8 5. Event Types .....................................................8
5.1. FlagChange and AnnotationChange . . . . . . . . . . . . . . 9 5.1. FlagChange and AnnotationChange ............................9
5.2. MessageNew . . . . . . . . . . . . . . . . . . . . . . . . 9 5.2. MessageNew .................................................9
5.3. MessageExpunge . . . . . . . . . . . . . . . . . . . . . . 11 5.3. MessageExpunge ............................................10
5.4. MailboxName . . . . . . . . . . . . . . . . . . . . . . . . 11 5.4. MailboxName ...............................................11
5.5. SubscriptionChange . . . . . . . . . . . . . . . . . . . . 12 5.5. SubscriptionChange ........................................12
5.6. MailboxMetadataChange . . . . . . . . . . . . . . . . . . . 12 5.6. MailboxMetadataChange .....................................12
5.7. ServerMetadataChange . . . . . . . . . . . . . . . . . . . 13 5.7. ServerMetadataChange ......................................13
5.8. Notification Overflow . . . . . . . . . . . . . . . . . . . 13 5.8. Notification Overflow .....................................13
5.9. ACL Changes . . . . . . . . . . . . . . . . . . . . . . . . 13 5.9. ACL (Access Control List) Changes .........................13
6. Mailbox Specification . . . . . . . . . . . . . . . . . . . . 14 6. Mailbox Specification ..........................................14
6.1. Mailbox specifiers affecting the currently selected mailbox 14 6.1. Mailbox Specifiers Affecting the Currently
6.2. Personal . . . . . . . . . . . . . . . . . . . . . . . . . 15 Selected Mailbox ..........................................14
6.3. Inboxes . . . . . . . . . . . . . . . . . . . . . . . . . . 15 6.2. Personal ..................................................15
6.4. Subscribed . . . . . . . . . . . . . . . . . . . . . . . . 15 6.3. Inboxes ...................................................15
6.5. Subtree . . . . . . . . . . . . . . . . . . . . . . . . . . 15 6.4. Subscribed ................................................15
6.6. Mailboxes . . . . . . . . . . . . . . . . . . . . . . . . . 16 6.5. Subtree ...................................................15
7. Extension to SEARCH and SORT commands . . . . . . . . . . . . 16 6.6. Mailboxes .................................................16
8. Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 16 7. Extension to SEARCH and SORT Commands ..........................16
9. Security considerations . . . . . . . . . . . . . . . . . . . 19 8. Formal Syntax ..................................................16
10. IANA considerations . . . . . . . . . . . . . . . . . . . . . 19 9. Security Considerations ........................................19
10.1. Initial LIST-EXTENDED extended data item registrations . 19 10. IANA Considerations ...........................................19
11. Acknowedgements . . . . . . . . . . . . . . . . . . . . . . . 20 10.1. Initial LIST-EXTENDED Extended Data Item Registrations ...19
12. Normative References . . . . . . . . . . . . . . . . . . . . . 20 11. Acknowledgements ..............................................20
13. Informative References . . . . . . . . . . . . . . . . . . . . 21 12. Normative References ..........................................20
14. Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 22 13. Informative References ........................................21
Intellectual Property and Copyright Statements . . . . . . . . . . 23
Internet-draft August 2008
1. Conventions Used in This Document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119].
Formal syntax is defined by [RFC5234] as extended by [RFC3501] and
[RFC4466].
The acronym MSN stands for Message Sequence Numbers (see Section
2.3.1.2 of [RFC3501]).
Example lines prefaced by "C:" are sent by the client and ones
prefaced by "S:" by the server. "[...]" means elision.
2. Overview and rationale 1. Overview and Rationale
The IDLE command (defined in [RFC2177]) provides a way for the The IDLE command (defined in [RFC2177]) provides a way for the client
client to go into a mode where the IMAP server pushes to go into a mode where the IMAP server pushes it notifications about
notifications about IMAP mailstore events for the selected IMAP mailstore events for the selected mailbox. However, the IDLE
mailbox. However, the IDLE extension doesn't restrict or extension doesn't restrict or control which server events can be
control which server events can be sent, or what information sent, or what information the server sends in response to each event.
the server sends in response to each event. Also, IDLE only applies to the selected mailbox, thus requiring an
Also, IDLE only applies to the selected mailbox, thus requiring additional TCP connection per mailbox.
an additional TCP connection per mailbox.
This document defines an IMAP extension that allows clients to This document defines an IMAP extension that allows clients to
express their preferences about unsolicited events generated by express their preferences about unsolicited events generated by the
the server. The extension allows clients to only receive events server. The extension allows clients to only receive events that
they are interested in, while servers know that they don't need they are interested in, while servers know that they don't need to go
to go into effort of generating certain types of untagged responses. to the effort of generating certain types of untagged responses.
Without the NOTIFY command defined in this document, an IMAP server Without the NOTIFY command defined in this document, an IMAP server
will only send information about mailstore changes to the client in will only send information about mailstore changes to the client in
the following cases: the following cases:
- as the result of a client command (e.g. FETCH responses to
a FETCH or STORE command), - as the result of a client command (e.g., FETCH responses to a
- unsolicited responses sent just before the end of a command FETCH or STORE command),
(e.g. EXISTS or EXPUNGE) as the result of changes in other - as unsolicited responses sent just before the end of a command
(e.g., EXISTS or EXPUNGE) as the result of changes in other
sessions, and sessions, and
- during an IDLE command. - during an IDLE command.
The NOTIFY command extends what information may be returned in those The NOTIFY command extends what information may be returned in those
last two cases, and also permits and requires the server to send last two cases, and also permits and requires the server to send
information about updates between command. The NOTIFY command also information about updates between commands. The NOTIFY command also
allows for the client to extend what information is sent unsolicited allows for the client to extend what information is sent unsolicited
about the selected mailbox, and to request some update information about the selected mailbox and to request some update information to
be sent regarding other mailboxes.
Internet-draft August 2008
to be sent regarding other mailboxes. The interaction between IDLE and NOTIFY commands is described in
Section 4.
For the new messages delivered to or appended to the selected For the new messages delivered to or appended to the selected
mailbox, the NOTIFY command can be used to request that a set of mailbox, the NOTIFY command can be used to request that a set of
attributes be sent to the client in an unsolicited FETCH response. attributes be sent to the client in an unsolicited FETCH response.
This allows a client to be passive recipient of events and new mail, This allows a client to be a passive recipient of events and new mail
and be able to maintain full synchronisation without having to issue and to be able to maintain full synchronisation without having to
any subsequent commands except to modify the state of the mailbox on issue any subsequent commands except to modify the state of the
the server. mailbox on the server.
Some mobile clients, however, may want mail "pushed" only for mail Some mobile clients, however, may want mail "pushed" only for mail
that matches a SEARCH pattern. To meet that need [CONTEXT] is that matches a SEARCH pattern. To meet that need, [RFC5267] is
augmented by this document to extend the UPDATE return option to augmented by this document to extend the UPDATE return option to
specify a list of fetch-atts to be returned when a new message is specify a list of fetch-atts to be returned when a new message is
delivered or appended in another session. delivered or appended in another session.
[[RFC-Editor: Please delete the following before publication: 2. Conventions Used in This Document
Comments regarding this draft may be sent either to the
lemonade@ietf.org mailing list or to the authors.]]
3. The NOTIFY extension The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119].
IMAP servers which support this extension advertise the X-DRAFT- The acronym MSN stands for Message Sequence Numbers (see Section
W06-NOTIFY capability. This extension adds the NOTIFY command as 2.3.1.2 of [RFC3501]).
defined in Section 5.1.
Example lines prefaced by "C:" are sent by the client and ones
prefaced by "S:", by the server. "[...]" means elision.
3. The NOTIFY Extension
IMAP servers that support this extension advertise the NOTIFY
capability. This extension adds the NOTIFY command as defined in
Section 5.1.
A server implementing this extension is not required to implement A server implementing this extension is not required to implement
LIST-EXTENDED [LISTEXT], even though a NOTIFY compliant server must LIST-EXTENDED [RFC5258], even though a NOTIFY-compliant server must
be able to return extended LIST responses defined in [LISTEXT]. be able to return extended LIST responses, defined in [RFC5258].
3.1. The NOTIFY Command 3.1. The NOTIFY Command
Arguments: "SET" Arguments: "SET"
optional STATUS indicator Optional STATUS indicator
Mailboxes to be watched Mailboxes to be watched
Events about which to notify the client Events about which to notify the client
Or Or
Arguments: "NONE" Arguments: "NONE"
Responses: Possibly untagged STATUS responses (for SET) Responses: Possibly untagged STATUS responses (for SET)
Result: OK - The server will notify the client as requested. Result: OK - The server will notify the client as requested.
NO - Unsupported NOTIFY event, NOTIFY too complex or
Internet-draft August 2008
NO - Unsupported notify event, NOTIFY too complex or
expensive, etc. expensive, etc.
BAD - Command unknown, invalid, unsupported or unknown BAD - Command unknown, invalid, unsupported, or has
arguments. unknown arguments.
The NOTIFY command informs the server that the client listens for The NOTIFY command informs the server that the client listens for
event notifications all the time (even when no command is in event notifications all the time (even when no command is in
progress) and requests the server to notify it about the specified progress), and requests the server to notify it about the specified
set of events. The NOTIFY command has two forms. NOTIFY NONE set of events. The NOTIFY command has two forms. NOTIFY NONE
specifies that the client is not interested in any kind of event specifies that the client is not interested in any kind of event
happening on the server. NOTIFY SET replaces the current list of happening on the server. NOTIFY SET replaces the current list of
interesting events with a new list of events. interesting events with a new list of events.
Until the NOTIFY command is used for the first time, the server only Until the NOTIFY command is used for the first time, the server only
sends notifications while a command is being processed, and notifies sends notifications while a command is being processed, and notifies
the client about these events on the selected mailbox: (see section the client about these events on the selected mailbox (see Section 5
5 for definitions): MessageNew, MessageExpunge, FlagChange. It does for definitions): MessageNew, MessageExpunge, or FlagChange. It does
not notify the client about any events on other mailboxes. not notify the client about any events on other mailboxes.
The effect of a successful NOTIFY command lasts until the next The effect of a successful NOTIFY command lasts until the next NOTIFY
NOTIFY command, or until the IMAP connection is closed. command or until the IMAP connection is closed.
A successful NOTIFY SET command MUST cause the server to immediately A successful NOTIFY SET command MUST cause the server to immediately
return any accumulated changes to the currently selected mailbox (if return any accumulated changes to the currently selected mailbox (if
any), such as flag changes, new or expunged messages. This is any), such as flag changes and new or expunged messages. Thus, a
equivalent to NOOP command being issued by the client just before successful NOTIFY SET command implies an implicit NOOP command.
the NOTIFY SET command.
The NOTIFY SET command can request notifications of message related The NOTIFY SET command can request notifications of message-related
changes to the selected mailbox, whatever it may be at the time the changes to the selected mailbox, whatever that may be at the time the
message notifications are being generated. This is done by message notifications are being generated. This is done by
specifying either the SELECTED or the SELECTED-DELAYED mailbox specifying either the SELECTED or the SELECTED-DELAYED mailbox
selector (see Section 6.1) in the NOTIFY SET command. If the selector (see Section 6.1) in the NOTIFY SET command. If the
SELECTED/SELECTED-DELAYED mailbox selector is not specified in the SELECTED/SELECTED-DELAYED mailbox selector is not specified in the
NOTIFY SET command, this means that the client doesn't want to NOTIFY SET command, this means that the client doesn't want to
receive any <message-event>s for the currently selected mailbox. receive any <message-event>s for the currently selected mailbox.
This is the same as specifying SELECTED NONE. This is the same as specifying SELECTED NONE.
The client can also request notifications on other mailboxes by name The client can also request notifications on other mailboxes by name
or by a limited mailbox pattern match. Message related or by a limited mailbox pattern match. Message-related notifications
notifications returned for the currently selected mailbox will be returned for the currently selected mailbox will be those specified
those specified by the SELECTED/SELECTED-DELAYED mailbox specifier, by the SELECTED/SELECTED-DELAYED mailbox specifier, even if the
even if the selected mailbox also appears by name (or matches a selected mailbox also appears by name (or matches a pattern) in the
pattern) in the command. Non message related notifications are command. Non-message-related notifications are controlled by mailbox
controlled by mailbox specifiers other than SELECTED/SELECTED- specifiers other than SELECTED/SELECTED-DELAYED.
DELAYED.
If the NOTIFY command enables MessageNew, MessageExpunge, If the NOTIFY command enables MessageNew, MessageExpunge,
AnnotationChange, or FlagChange notifications for a mailbox other
Internet-draft August 2008 than the currently selected mailbox, and the client has specified the
AnnotationChange or FlagChange notification for a mailbox other than
the currently selected mailbox, and the client has specified the
STATUS indicator parameter, then the server MUST send a STATUS STATUS indicator parameter, then the server MUST send a STATUS
response for that mailbox before NOTIFY's tagged OK. If MessageNew response for that mailbox before NOTIFY's tagged OK. If MessageNew
is enabled, the STATUS response MUST contain MESSAGES, UIDNEXT and is enabled, the STATUS response MUST contain MESSAGES, UIDNEXT, and
UIDVALIDITY. If MessageExpunge is enabled, the STATUS response MUST UIDVALIDITY. If MessageExpunge is enabled, the STATUS response MUST
contain MESSAGES. If either AnnotationChange or FlagChange are contain MESSAGES. If either AnnotationChange or FlagChange are
included and the server also supports CONDSTORE [RFC4551] and/or included and the server also supports the CONDSTORE [RFC4551] and/or
QRESYNC [QRESYNC] extension, the STATUS response MUST contain QRESYNC [RFC5162] extensions, the STATUS response MUST contain
UIDVALIDITY and HIGHESTMODSEQ. Absence of the STATUS indicator UIDVALIDITY and HIGHESTMODSEQ. Absence of the STATUS indicator
parameter allows the client to avoid the additional STATUS parameter allows the client to avoid the additional STATUS responses.
responses. This might be useful if the client has already retrieved This might be useful if the client already retrieved this information
this information before issuing the NOTIFY command. before issuing the NOTIFY command.
Clients are advised to limit the number of mailboxes used with Clients are advised to limit the number of mailboxes used with
NOTIFY. Particularly, if a client asks for events for all accessible NOTIFY. Particularly, if a client asks for events for all accessible
mailboxes, the server may swamp the client with updates about shared mailboxes, the server may swamp the client with updates about shared
mailboxes. This may reduce client's battery life. Also this wastes mailboxes. This may reduce the client's battery life. Also, this
both server and network resources. For each mailbox wastes both server and network resources.
specified, the server verifies that the client has access using the
following test: For each mailbox specified, the server verifies that the client has
access using the following test:
- If the name does not refer to an existing mailbox, the server MUST - If the name does not refer to an existing mailbox, the server MUST
ignore it. ignore it.
- If the name refers to a mailbox which the client can't LIST, the - If the name refers to a mailbox that the client can't LIST, the
server MUST ignore it. For a server that implements [RFC4314] this server MUST ignore it. For a server that implements [RFC4314],
means that if the client that doesn't have the 'l' (lookup) right this means that if the client doesn't have the 'l' (lookup) right
for the name, then the server MUST ignore the mailbox. This for the name, then the server MUST ignore the mailbox. This
behavior prevents dislosure on potentially confidential behavior prevents disclosure of potentially confidential
information to clients which don't have rights to know it. information to clients who don't have rights to know it.
- If the name refers to a mailbox which the client can LIST (e.g. it - If the name refers to a mailbox that the client can LIST (e.g., it
has the 'l' right from [RFC4314]), but doesn't have another right has the 'l' right from [RFC4314]), but the client doesn't have
required for processing of the specified event(s), then the server another right required for processing of the specified event(s),
MUST respond with an untagged extended LIST response containing then the server MUST respond with an untagged extended LIST
the \NoAccess name attribute. response containing the \NoAccess name attribute.
The server SHOULD return the tagged OK response if the client has The server SHOULD return the tagged OK response if the client has
access to at least one of the mailboxes specified in the current access to at least one of the mailboxes specified in the current list
list of interesting events. The server MAY return the tagged NO of interesting events. The server MAY return the tagged NO response
response if the client has no access to any of the specified if the client has no access to any of the specified mailboxes and no
mailboxes and no access can ever be granted in the future (e.g. the access can ever be granted in the future (e.g., the client specified
client specified an event for 'Subtree Bar/Foo', 'Bar/Foo' doesn't an event for 'Subtree Bar/Foo', 'Bar/Foo' doesn't exist, and LIST
exist and LIST returns \Noinferiors for the parent 'Bar'). returns \Noinferiors for the parent 'Bar').
If the notification would be prohibitively expensive for the server If the notification would be prohibitively expensive for the server
(e.g. "notify me of all flag changes in all mailboxes"), the server (e.g., "notify me of all flag changes in all mailboxes"), the server
Internet-draft August 2008
MAY refuse the command with a tagged NO [NOTIFICATIONOVERFLOW] MAY refuse the command with a tagged NO [NOTIFICATIONOVERFLOW]
response. response.
If the client requests information for events of an unsupported If the client requests information for events of an unsupported type,
type, the server MUST refuse the command with a tagged NO response the server MUST refuse the command with a tagged NO response (not a
(not a BAD). This response SHOULD contain the BADEVENT response BAD). This response SHOULD contain the BADEVENT response code, which
code, which MUST list names of all events supported by the server. MUST list names of all events supported by the server.
Here's an example: Here's an example:
S: * OK [CAPABILITY IMAP4REV1 NOTIFY] S: * OK [CAPABILITY IMAP4REV1 NOTIFY]
C: a login bob alice C: a login bob alice
S: a OK Password matched S: a OK Password matched
C: b notify set status (selected MessageNew (uid C: b notify set status (selected MessageNew (uid
body.peek[header.fields (from to subject)]) MessageExpunge) body.peek[header.fields (from to subject)]) MessageExpunge)
(subtree Lists MessageNew) (subtree Lists MessageNew)
S: * STATUS Lists/Lemonade (UIDVALIDITY 4 UIDNEXT 9999 MESSAGES S: * STATUS Lists/Lemonade (UIDVALIDITY 4 UIDNEXT 9999 MESSAGES
skipping to change at page 7, line 44 skipping to change at page 7, line 39
MESSAGES 501) MESSAGES 501)
(Time passes. A new message is delivered to inbox.) (Time passes. A new message is delivered to inbox.)
S: * 127 FETCH (UID 127001 BODY[HEADER.FIELDS (From To S: * 127 FETCH (UID 127001 BODY[HEADER.FIELDS (From To
Subject)] {75} Subject)] {75}
S: Subject: Re: good morning S: Subject: Re: good morning
S: From: alice@example.org S: From: alice@example.org
S: To: bob@example.org S: To: bob@example.org
S: S:
S: ) S: )
(Time passes. The client decides it wants to know about (Time passes. The client decides it wants to know about
one more mailbox. As the client already knows one more mailbox. As the client already knows necessary
necessary STATUS information for all mailboxes below STATUS information for all mailboxes below the Lists
the Lists mailbox and because "notify set status" would mailbox, and because "notify set status" would cause
cause STATUS responses for *all* mailboxes specified in STATUS responses for *all* mailboxes specified in the
the NOTIFY command, including the ones for which the NOTIFY command, including the ones for which the client
client already knows STATUS information, the client already knows STATUS information, the client issues an
issues explicit STATUS request for the mailbox to be explicit STATUS request for the mailbox to be added to
added to the watch list, followed by the NOTIFY SET the watch list, followed by the NOTIFY SET without the
without the STATUS parameter.) STATUS parameter.)
C: d STATUS misc (UIDVALIDITY UIDNEXT MESSAGES) C: d STATUS misc (UIDVALIDITY UIDNEXT MESSAGES)
S: * STATUS misc (UIDVALIDITY 1 UIDNEXT 999) S: * STATUS misc (UIDVALIDITY 1 UIDNEXT 999)
Internet-draft August 2008
S: d STATUS completed S: d STATUS completed
C: e notify set (selected MessageNew (uid C: e notify set (selected MessageNew (uid
body.peek[header.fields (from to subject)]) MessageExpunge) body.peek[header.fields (from to subject)]) MessageExpunge)
(subtree Lists MessageNew) (mailboxes misc MessageNew) (subtree Lists MessageNew) (mailboxes misc MessageNew)
S: e OK done S: e OK done
4. Interaction with the IDLE Command 4. Interaction with the IDLE Command
If IDLE (as well as this extension) is supported, while processing If IDLE [RFC2177] (as well as this extension) is supported, then
IDLE the server MUST send the same events as instructed by the while processing any IDLE command, the server MUST send exactly the
client using the NOTIFY command. same events as instructed by the client using the NOTIFY command.
NOTIFY makes IDLE unnecessary for some clients. If a client does not NOTIFY makes IDLE unnecessary for some clients. If a client does not
use MSNs and '*' in commands, it can request MessageExpunge and use MSNs and '*' in commands, it can request MessageExpunge and
MessageNew for the selected mailbox using the NOTIFY command instead MessageNew for the selected mailbox by using the NOTIFY command
of entering the IDLE mode. instead of entering the IDLE mode.
A client that uses MSNs and '*' in commands can still use the NOTIFY A client that uses MSNs and '*' in commands can still use the NOTIFY
command if it specifies the SELECTED-DELAYED mailbox specifier in command if it specifies the SELECTED-DELAYED mailbox specifier in the
the NOTIFY command. NOTIFY command.
5. Event Types 5. Event Types
Only some of the events in [MSGEVENT] can be expressed in IMAP, and Only some of the events in [RFC5423] can be expressed in IMAP, and
for some of them there are several possible ways to express the for some of them there are several possible ways to express the
event. event.
This section specifies the events which an IMAP server can notify an This section specifies the events of which an IMAP server can notify
IMAP client, and how. an IMAP client, and how.
The server SHOULD omit notifying the client if the event is caused The server SHOULD omit notifying the client if the event is caused by
by this client. For example, if the client issues CREATE and has this client. For example, if the client issues CREATE and has
requested MailboxName event that would cover the newly created requested a MailboxName event that would cover the newly created
mailbox, the server SHOULD NOT notify the client of the MailboxName mailbox, the server SHOULD NOT notify the client of the MailboxName
change. change.
All event types described in this document require the 'l' and 'r' All event types described in this document require the 'l' and 'r'
rights (see [RFC4314]) on all observed mailboxes. Servers that rights (see [RFC4314]) on all observed mailboxes. Servers that don't
don't implement [RFC4314] should map the above rights to their implement [RFC4314] should map the above rights to their access-
access control model. control model.
If FlagChange and/or AnnotationChange event is specified, MessageNew
and MessageExpunge MUST also be specified by the client. Otherwise
the server MUST respond with the tagged BAD response.
If one of MessageNew or MessageExpunge is specified, the both events
Internet-draft August 2008 If the FlagChange and/or AnnotationChange events are specified,
MessageNew and MessageExpunge MUST also be specified by the client.
Otherwise, the server MUST respond with the tagged BAD response.
MUST be specified. Otherwise the server MUST respond with the If one of MessageNew or MessageExpunge is specified, then both events
MUST be specified. Otherwise, the server MUST respond with the
tagged BAD response. tagged BAD response.
The client can instruct the server not to send an event by omitting The client can instruct the server not to send an event by omitting
the necessary event from the list of events specified in NOTIFY SET, the necessary event from the list of events specified in NOTIFY SET,
by using NONE event specifier in the NOTIFY SET or by using NOTIFY by using the NONE event specifier in the NOTIFY SET, or by using
NONE. In particular NOTIFY SET ... NONE can be used as a snapshot NOTIFY NONE. In particular, NOTIFY SET ... NONE can be used as a
facility by clients. snapshot facility by clients.
5.1. FlagChange and AnnotationChange 5.1. FlagChange and AnnotationChange
If the flag and/or message annotation change happens in the selected If the flag and/or message annotation change happens in the selected
mailbox, the server MUST notify the client by sending an unsolicited mailbox, the server MUST notify the client by sending an unsolicited
FETCH response, which MUST include UID and FLAGS/ANNOTATION FETCH FETCH response, which MUST include UID and FLAGS/ANNOTATION FETCH
data items. It MAY also send new FLAGS and/or OK [PERMANENTFLAGS data items. It MAY also send new FLAGS and/or OK [PERMANENTFLAGS
...] responses. ...] responses.
If a search context is in effect as specified in [CONTEXT], an If a search context is in effect as specified in [RFC5267], an
ESEARCH ADDTO or ESEARCH REMOVEFROM will also be generated, if ESEARCH ADDTO or ESEARCH REMOVEFROM will also be generated, if
appropriate. In this case, the FETCH response MUST precede the appropriate. In this case, the FETCH response MUST precede the
ESEARCH response. ESEARCH response.
If the change happens in another mailbox, then the server responds If the change happens in another mailbox, then the server responds
with a STATUS response. The exact content of the STATUS response with a STATUS response. The exact content of the STATUS response
depends on various factors. If CONDSTORE [RFC4551] and/or QRESYNC depends on various factors. If CONDSTORE [RFC4551] and/or QRESYNC
[QRESYNC] is enabled by the client, then the server sends a STATUS [RFC5162] are enabled by the client, then the server sends a STATUS
response that includes at least HIGHESTMODSEQ and UIDVALIDITY status response that includes at least HIGHESTMODSEQ and UIDVALIDITY status
data items. If the number of messages with the \Seen flag changes, data items. If the number of messages with the \Seen flag changes,
the server MAY also include the UNSEEN data item in the STATUS the server MAY also include the UNSEEN data item in the STATUS
response. If CONDSTORE/QRESYNC is not enabled by the client and the response. If CONDSTORE/QRESYNC is not enabled by the client and the
server choses not to include the UNSEEN, the server does not notify server chooses not to include the UNSEEN data item, the server does
the client. When this event is requested the server MUST notify the not notify the client. When this event is requested, the server MUST
client about mailbox UIDVALIDITY changes. This is done by sending a notify the client about mailbox UIDVALIDITY changes. This is done by
STATUS response that includes UIDVALIDITY. sending a STATUS response that includes UIDVALIDITY.
FlagChange covers the MessageRead, MessageTrash, FlagsSet and FlagChange covers the MessageRead, MessageTrash, FlagsSet, and
FlagsClear events in [MSGEVENT]. FlagsClear events in [RFC5423].
Example in the selected mailbox: Example in the selected mailbox:
S: * 99 FETCH (UID 9999 FLAGS ($Junk)) S: * 99 FETCH (UID 9999 FLAGS ($Junk))
And in another mailbox, with CONDSTORE in use: And in another mailbox, with CONDSTORE in use:
S: * STATUS Lists/Lemonade (HIGHESTMODSEQ 65666665 UIDVALIDITY S: * STATUS Lists/Lemonade (HIGHESTMODSEQ 65666665 UIDVALIDITY
101) 101)
5.2. MessageNew 5.2. MessageNew
Internet-draft August 2008 This covers both MessageNew and MessageAppend in [RFC5423].
This covers both MessageNew and MessageAppend in [MSGEVENT].
If the new/appended message is in the selected mailbox, the server If the new/appended message is in the selected mailbox, the server
notifies the client by sending an unsolicited EXISTS response, notifies the client by sending an unsolicited EXISTS response,
followed by an unsolicited FETCH response containing the information followed by an unsolicited FETCH response containing the information
requested by the client. A FETCH response SHOULD NOT be generated requested by the client. A FETCH response SHOULD NOT be generated
for a new message created by the client on this particular for a new message created by the client on this particular
connection, for instance as the result of an APPEND or COPY command connection, for instance, as the result of an APPEND or COPY command
to the selected mailbox performed by the client itself. The server to the selected mailbox performed by the client itself. The server
MAY also send a RECENT response, if the server marks the message as MAY also send a RECENT response, if the server marks the message as
\Recent. \Recent.
Note that a single EXISTS response can be returned for multiple Note that a single EXISTS response can be returned for multiple
MessageAppend/MessageNew events. MessageAppend/MessageNew events.
If a search context is in effect as specified in [CONTEXT], an If a search context is in effect as specified in [RFC5267], an
ESEARCH ADDTO will also be generated, if appropriate. In this case, ESEARCH ADDTO will also be generated, if appropriate. In this case,
the EXISTS response MUST precede the ESEARCH response. Both the the EXISTS response MUST precede the ESEARCH response. Both the
NOTIFY command and the SEARCH and SORT commands (see Section 7) can NOTIFY command and the SEARCH and SORT commands (see Section 7) can
specify attributes to be returned for new messages. These specify attributes to be returned for new messages. These attributes
attributes SHOULD be combined into a single FETCH response. The SHOULD be combined into a single FETCH response. The server SHOULD
server SHOULD avoid sending duplicate data. The FETCH response(s) avoid sending duplicate data. The FETCH response(s) MUST follow any
MUST follow any ESEARCH ADDTO responses. ESEARCH ADDTO responses.
If the new/appended message is in another mailbox, the server sends If the new/appended message is in another mailbox, the server sends
an unsolicited STATUS (UIDNEXT MESSAGES) response for the relevant an unsolicited STATUS (UIDNEXT MESSAGES) response for the relevant
mailbox. If the CONDSTORE extension [RFC4551] and/or the QRESYNC mailbox. If the CONDSTORE extension [RFC4551] and/or the QRESYNC
extension [QRESYNC] is enabled, the HIGHESTMODSEQ status data item extension [RFC5162] is enabled, the HIGHESTMODSEQ status data item
MUST be included in the STATUS response. MUST be included in the STATUS response.
The client SHOULD NOT use FETCH attributes that implicitly set the The client SHOULD NOT use FETCH attributes that implicitly set the
\seen flag, or that presuppose the existence of a given bodypart. \seen flag, or that presuppose the existence of a given bodypart.
UID, MODSEQ, FLAGS, ENVELOPE, BODY.PEEK[HEADER.FIELDS... and UID, MODSEQ, FLAGS, ENVELOPE, BODY.PEEK[HEADER.FIELDS... and
BODY/BODYSTRUCTURE may be the most useful attributes. BODY/BODYSTRUCTURE may be the most useful attributes.
Note that if a client asks to be notified of MessageNew events with Note that if a client asks to be notified of MessageNew events with
the SELECTED mailbox specifier, the number of messages can increase the SELECTED mailbox specifier, the number of messages can increase
at any time, and therefore the client cannot refer to a specific at any time, and therefore the client cannot refer to a specific
message using the MSN/UID '*'. message using the MSN/UID '*'.
Example in the selected mailbox: Example in the selected mailbox:
S: * 444 EXISTS S: * 444 EXISTS
S: * 444 FETCH (UID 9999) S: * 444 FETCH (UID 9999)
And in another mailbox, without CONDSTORE enabled: And in another mailbox, without CONDSTORE enabled:
S: * STATUS Lists/Lemonade (UIDNEXT 10002 MESSAGES 503) S: * STATUS Lists/Lemonade (UIDNEXT 10002 MESSAGES 503)
Internet-draft August 2008
5.3. MessageExpunge 5.3. MessageExpunge
If the expunged message(s) is/are in the selected mailbox, the If the expunged message or messages are in the selected mailbox, the
server notifies the client using EXPUNGE (or VANISHED, if [QRESYNC] server notifies the client using EXPUNGE (or VANISHED, if [RFC5162]
is supported by the server and enabled by the client). is supported by the server and enabled by the client).
If a search context is in effect as specified in [CONTEXT], an If a search context is in effect, as specified in [RFC5267], an
ESEARCH REMOVEFROM will also be generated, if appropriate. ESEARCH REMOVEFROM will also be generated, if appropriate.
If the expunged message(s) is/are in another mailbox, the server If the expunged message or messages are in another mailbox, the
sends an unsolicited STATUS (UIDNEXT MESSAGES) response for the server sends an unsolicited STATUS (UIDNEXT MESSAGES) response for
relevant mailbox. If the QRESYNC [QRESYNC] extension is enabled, the the relevant mailbox. If the QRESYNC [RFC5162] extension is enabled,
HIGHESTMODSEQ data item MUST be included in the STATUS response as the HIGHESTMODSEQ data item MUST be included in the STATUS response
well. as well.
Note that if a client requests MessageExpunge with the SELECTED Note that if a client requests MessageExpunge with the SELECTED
mailbox specifier, the meaning of a MSN can change at any time, so mailbox specifier, the meaning of an MSN can change at any time, so
the client cannot use MSNs in commands anymore. For example, such a the client cannot use MSNs in commands anymore. For example, such a
client cannot use FETCH, but it has to use UID FETCH. The meaning of client cannot use FETCH, but has to use UID FETCH. The meaning of
'*' can also change when messages are added or expunged. A client '*' can also change when messages are added or expunged. A client
wishing to keep using MSNs can either use the SELECTED-DELAYED wishing to keep using MSNs can either use the SELECTED-DELAYED
mailbox specifier, or can avoid using the MessageExpunge event mailbox specifier or can avoid using the MessageExpunge event
entirely. entirely.
The MessageExpunge notification covers both MessageExpunge and The MessageExpunge notification covers both MessageExpunge and
MessageExpire events from [MSGEVENT]. MessageExpire events from [RFC5423].
Example in the selected mailbox, without QRESYNC: Example in the selected mailbox, without QRESYNC:
S: * 444 EXPUNGE S: * 444 EXPUNGE
The same example in the selected mailbox, with QRESYNC: The same example in the selected mailbox, with QRESYNC:
S: * VANISHED 5444 S: * VANISHED 5444
And in another mailbox, when QRESYNC is not enabled: And in another mailbox, when QRESYNC is not enabled:
S: * STATUS misc (UIDNEXT 999 MESSAGES 554) S: * STATUS misc (UIDNEXT 999 MESSAGES 554)
5.4. MailboxName 5.4. MailboxName
These notifications are sent if an affected mailbox name was created These notifications are sent if an affected mailbox name was created
(with CREATE), deleted (with DELETE) or renamed (with RENAME). For (with CREATE), deleted (with DELETE), or renamed (with RENAME). For
a server that implements [RFC4314] granting or revocation of the 'l' a server that implements [RFC4314], granting or revocation of the 'l'
right to the current user on the affected mailbox MUST be considered right to the current user on the affected mailbox MUST be considered
mailbox creation/deletion respectively. If a mailbox is created or mailbox creation or deletion, respectively. If a mailbox is created
deleted, the mailbox itself and its direct parent (whether it is an or deleted, the mailbox itself and its direct parent (whether it is
existing mailbox or not) are considered to be affected. an existing mailbox or not) are considered to be affected.
The server notifies the client by sending an unsolicited LIST The server notifies the client by sending an unsolicited LIST
response for each affected mailbox name. If, after the event, the response for each affected mailbox name. If, after the event, the
mailbox name does not refer to a mailbox accessible to the client, mailbox name does not refer to a mailbox accessible to the client,
Internet-draft August 2008
the \Nonexistent flag MUST be included. the \Nonexistent flag MUST be included.
For each LISTable mailbox renamed, the server sends an extended LIST For each LISTable mailbox renamed, the server sends an extended LIST
response [LISTEXT] for the new mailbox name, containing the OLDNAME response [RFC5258] for the new mailbox name, containing the OLDNAME
extended data item with the old mailbox name. When a mailbox is extended data item with the old mailbox name. When a mailbox is
renamed, its children are renamed too. No additional MailboxName renamed, its children are renamed too. No additional MailboxName
events are sent for children in this case. When INBOX is renamed, a events are sent for children in this case. When INBOX is renamed, a
new INBOX is assumed to be created. No MailboxName event is sent new INBOX is assumed to be created. No MailboxName event is sent for
for INBOX in this case. INBOX in this case.
If the server automatically subscribes a mailbox when it is created If the server automatically subscribes a mailbox when it is created
or renamed, then the unsolicited LIST response for each affected or renamed, then the unsolicited LIST response for each affected
subscribed mailbox name MUST include the \Subscribed attribute (see subscribed mailbox name MUST include the \Subscribed attribute (see
[LISTEXT]). The server SHOULD also include [RFC5258]). The server SHOULD also include \HasChildren or
\HasChildren/\HasNoChildren attributes [LISTEXT] as appropriate. \HasNoChildren attributes [RFC5258] as appropriate.
Example of a newly created mailbox (or granting of the 'l' right on Example of a newly created mailbox (or granting of the 'l' right on
the mailbox): the mailbox):
S: * LIST () "/" "NewMailbox" S: * LIST () "/" "NewMailbox"
And a deleted mailbox (or revocation of the 'l' right on the And a deleted mailbox (or revocation of the 'l' right on the
mailbox): mailbox):
S: * LIST (\NonExistent) "." "INBOX.DeletedMailbox" S: * LIST (\NonExistent) "." "INBOX.DeletedMailbox"
Example of a renamed mailbox: Example of a renamed mailbox:
S: * LIST () "/" "NewMailbox" ("OLDNAME" ("OldMailbox")) S: * LIST () "/" "NewMailbox" ("OLDNAME" ("OldMailbox"))
5.5. SubscriptionChange 5.5. SubscriptionChange
The server notifies the client by sending an unsolicited LIST The server notifies the client by sending an unsolicited LIST
responses for each affected mailbox name. If and only if the mailbox response for each affected mailbox name. If and only if the mailbox
is subscribed after the event, the \Subscribed attribute (see is subscribed after the event, the \Subscribed attribute (see
[LISTEXT]) is included. Note that in the LIST response, all mailbox [RFC5258]) is included. Note that in the LIST response, all mailbox
attributes MUST be accurately computed (this differs from the attributes MUST be accurately computed (this differs from the
behavior of the LSUB command). behavior of the LSUB command).
Example: Example:
S: * LIST (\Subscribed) "/" "SubscribedMailbox" S: * LIST (\Subscribed) "/" "SubscribedMailbox"
5.6. MailboxMetadataChange 5.6. MailboxMetadataChange
Support for this event type is OPTIONAL, unless the METADATA Support for this event type is OPTIONAL unless the METADATA extension
extension [METADATA] is also supported by the server, in which case [RFC5464] is also supported by the server, in which case support for
support for this event type is REQUIRED. this event type is REQUIRED.
The server sends an unsolicited METADATA response (as per Section
Internet-draft August 2008 A client willing to receive unsolicited METADATA responses as a
result of using the MailboxMetadataChange event in the NOTIFY command
doesn't have to issue ENABLE METADATA.
4.4.2 of [METADATA]). If possible, only the changed metadata SHOULD The server sends an unsolicited METADATA response (as per Section
4.4.2 of [RFC5464]). If possible, only the changed metadata SHOULD
be included, but if the server can't detect a change to a single be included, but if the server can't detect a change to a single
metadata item, it MAY include all metadata items set on the mailbox. metadata item, it MAY include all metadata items set on the mailbox.
If a metadata item is deleted (set to NIL), it MUST always be
included in the METADATA response.
Example: Example:
S: * METADATA "INBOX" /public/comment S: * METADATA "INBOX" /shared/comment
5.7. ServerMetadataChange 5.7. ServerMetadataChange
Support for this event type is OPTIONAL, unless the METADATA or the Support for this event type is OPTIONAL unless the METADATA or the
METADATA-SERVER extension [METADATA] is also supported by the METADATA-SERVER extension [RFC5464] is also supported by the server,
server, in which case support for this event type is REQUIRED. in which case support for this event type is REQUIRED.
A client willing to receive unsolicited METADATA responses as a
result of using the ServerMetadataChange event in the NOTIFY command
doesn't have to issue ENABLE METADATA or ENABLE METADATA-SERVER.
The server sends an unsolicited METADATA response (as per Section The server sends an unsolicited METADATA response (as per Section
4.4.2 of [METADATA]). Only the names of changed metadata entries 4.4.2 of [RFC5464]). Only the names of changed metadata entries
SHOULD be returned in such METADATA responses. SHOULD be returned in such METADATA responses. If a metadata item is
deleted (set to NIL), it MUST always be included in the METADATA
response.
Example: Example:
S: * METADATA "" /public/comment S: * METADATA "" /shared/comment
5.8. Notification Overflow 5.8. Notification Overflow
If the server is unable or unwilling to deliver as many If the server is unable or unwilling to deliver as many notifications
notifications as it is being asked to, it may disable notifications as it is being asked to, it may disable notifications for some or all
for some or all clients. It MUST notify these clients by sending an clients. It MUST notify these clients by sending an untagged "OK
untagged "OK [NOTIFICATIONOVERFLOW]" response and behave as if a [NOTIFICATIONOVERFLOW]" response and behave as if a NOTIFY NONE
NOTIFY NONE command had just been received. command had just been received.
Example: Example:
S: * OK [NOTIFICATIONOVERFLOW] ...A comment can go here... S: * OK [NOTIFICATIONOVERFLOW] ...A comment can go here...
5.9. ACL Changes 5.9. ACL (Access Control List) Changes
Even if NOTIFY succeeds, it is still possible to lose access to the Even if NOTIFY succeeds, it is still possible to lose access to the
mailboxes monitoried at a later time. If this happens, the server mailboxes being monitored at a later time. If this happens, the
MUST stop monitoring these mailboxes. If access is later granted, server MUST stop monitoring these mailboxes. If access is later
the server MUST restart event monitoring. granted, the server MUST restart event monitoring.
The server SHOULD return the LIST response with the \NoAccess name The server SHOULD return the LIST response with the \NoAccess name
attribute if and when the mailbox loses the 'l' right. Simalarly, attribute if and when the mailbox loses the 'l' right. Similarly,
the server SHOULD return the LIST response with no \NoAccess name the server SHOULD return the LIST response with no \NoAccess name
attribute, if the mailbox was previously reported as having attribute if the mailbox was previously reported as having \NoAccess
\NoAccess, and later on the 'l' right is granted. and the 'l' right is later granted.
Internet-draft August 2008
6. Mailbox Specification 6. Mailbox Specification
Mailboxes to be monitored can be specified in several different Mailboxes to be monitored can be specified in several different ways.
ways.
Only 'SELECTED' and 'SELECTED-DELAYED' (section 6.1) match the Only 'SELECTED' and 'SELECTED-DELAYED' (Section 6.1) match the
currently selected mailbox. All other mailbox specifications affect currently selected mailbox. All other mailbox specifications affect
other (non-selected) mailboxes. other (non-selected) mailboxes.
Note that multiple <event-group>s can apply to the same mailbox. Note that multiple <event-group>s can apply to the same mailbox. The
The following example demonstrates this. In this example, following example demonstrates this. In this example, MessageNew and
MessageNew and MessageExpunge events are reported for INBOX due to MessageExpunge events are reported for INBOX, due to the first
the first <event-group>. SubscriptionChange event will also be <event-group>. A SubscriptionChange event will also be reported for
reported for INBOX due to the second <event-group>. INBOX, due to the second <event-group>.
C: a notify set (mailboxes INBOX (Messagenew messageExpunge)) C: a notify set (mailboxes INBOX (Messagenew messageExpunge))
(personal (SubscriptionChange)) (personal (SubscriptionChange))
A typical client that supports the NOTIFY extension would ask for A typical client that supports the NOTIFY extension would ask for
events on the selected mailbox and some named mailboxes. events on the selected mailbox and some named mailboxes.
In the next example the client asks for FlagChange events for all In the next example, the client asks for FlagChange events for all
personal mailboxes except the currently selected mailbox. This is personal mailboxes except the currently selected mailbox. This is
different from the previous example, because SELECTED overrides all different from the previous example because SELECTED overrides all
other message event definitions for the currently selected mailbox other message event definitions for the currently selected mailbox
(see Section 3.1). (see Section 3.1).
C: a notify set (selected (Messagenew (uid flags) C: a notify set (selected (Messagenew (uid flags) messageExpunge))
messageExpunge)) (personal (MessageNew FlagChange (personal (MessageNew FlagChange MessageExpunge))
MessageExpunge))
6.1. Mailbox specifiers affecting the currently selected mailbox 6.1. Mailbox Specifiers Affecting the Currently Selected Mailbox
Only one of the mailbox specifiers affecting the currently selected Only one of the mailbox specifiers affecting the currently selected
mailbox can be specified in any NOTIFY command. The two such mailbox mailbox can be specified in any NOTIFY command. The two such mailbox
specifiers (SELECTED and SELECTED-DELAYED) are described below. specifiers (SELECTED and SELECTED-DELAYED) are described below.
Both refer to the mailbox selected using either SELECT or EXAMINE Both refer to the mailbox that was selected using either SELECT or
(see [RFC3501] section 6.3.1 and 6.3.2). When the IMAP connection is EXAMINE (see [RFC3501], Sections 6.3.1 and 6.3.2). When the IMAP
not in the selected state, such mailbox specifiers don't refer to connection is not in the selected state, such mailbox specifiers
any mailbox. don't refer to any mailbox.
The mailbox specifiers only apply to <message-event>s. It is an The mailbox specifiers only apply to <message-event>s. It is an
error to specify other types of events with either the SELECTED or error to specify other types of events with either the SELECTED or
the SELECTED-DELAYED selector. the SELECTED-DELAYED selector.
Internet-draft August 2008
6.1.1. Selected 6.1.1. Selected
The SELECTED mailbox specifier requires the server to send immediate The SELECTED mailbox specifier requires the server to send immediate
notifications for the currently selected mailbox about all specified notifications for the currently selected mailbox about all specified
<message-event>s. <message-event>s.
6.1.2 Selected-delayed 6.1.2. Selected-Delayed
The SELECTED-DELAYED mailbox specifier requires the server to delay The SELECTED-DELAYED mailbox specifier requires the server to delay a
MessageExpunge event until the client issues a command that allows MessageExpunge event until the client issues a command that allows
returning information about expunged messages (see Section 7.4.1 of returning information about expunged messages (see Section 7.4.1 of
[RFC3501] for more details), for example till a NOOP or an IDLE [RFC3501] for more details), for example, till a NOOP or an IDLE
command. When SELECTED-DELAYED is specified the server MAY also command has been issued. When SELECTED-DELAYED is specified, the
delay returning other <message-event>s until the client issues a server MAY also delay returning other <message-event>s until the
command specified above, or it MAY return them immediately. client issues one of the commands specified above, or it MAY return
them immediately.
6.2. Personal 6.2. Personal
Personal refers to all selectable mailboxes in the user's personal Personal refers to all selectable mailboxes in the user's personal
namespace(s), as defined in [NAMESPACE]. namespace(s), as defined in [RFC2342].
6.3. Inboxes 6.3. Inboxes
Inboxes refers to all selectable mailboxes in the user's personal Inboxes refers to all selectable mailboxes in the user's personal
namespace(s) to which messages may be delivered by an MDA (see namespace(s) to which messages may be delivered by a Message Delivery
[EMAIL-ARCH], particularly section 4.3.3). Agent (MDA) (see [EMAIL-ARCH], particularly Section 4.3.3).
If the IMAP server cannot easily compute this set, it MUST treat If the IMAP server cannot easily compute this set, it MUST treat
"inboxes" as equivalent to "personal". "inboxes" as equivalent to "personal".
6.4 Subscribed 6.4. Subscribed
Subscribed refers to all mailboxes subscribed by the user. Subscribed refers to all mailboxes subscribed to by the user.
If the subscription list changes, the server MUST reevaluate the If the subscription list changes, the server MUST reevaluate the
list. list.
6.5 Subtree 6.5. Subtree
Subtree is followed by a mailbox name or list of mailbox names. A Subtree is followed by a mailbox name or list of mailbox names. A
subtree refers to all selectable mailboxes which are subordinate to subtree refers to all selectable mailboxes that are subordinate to
the specified mailbox plus the mailbox itself. the specified mailbox plus the specified mailbox itself.
Internet-draft August 2008
6.6 Mailboxes 6.6. Mailboxes
Mailboxes is followed by a mailbox name or a list of mailbox names. Mailboxes is followed by a mailbox name or a list of mailbox names.
The server MUST NOT do wildcard expansion. This means there is no The server MUST NOT do a wildcard expansion. This means there is no
special treatment for the LIST wildcard characters ('*' and '%') if special treatment for the LIST wildcard characters ('*' and '%') if
they are present in mailbox names. they are present in mailbox names.
7. Extension to SEARCH and SORT commands 7. Extension to SEARCH and SORT Commands
If the server that support the NOTIFY extension also supports If the server that supports the NOTIFY extension also supports
CONTEXT=SEARCH and/or CONTEXT=SORT as defined in [CONTEXT], the CONTEXT=SEARCH and/or CONTEXT=SORT as defined in [RFC5267], the
UPDATE return option is extended so that a client can request that UPDATE return option is extended so that a client can request that
FETCH attributes be returned when a new message is added to the FETCH attributes be returned when a new message is added to the
context result set. context result set.
For example: For example:
C: a00 SEARCH RETURN (COUNT UPDATE (UID BODY[HEADER.FIELDS (TO C: a00 SEARCH RETURN (COUNT UPDATE (UID BODY[HEADER.FIELDS (TO
FROM SUBJECT)])) FROM "boss" FROM SUBJECT)])) FROM "boss"
S: * ESEARCH (TAG "a00") (COUNT 17) S: * ESEARCH (TAG "a00") (COUNT 17)
S: a00 OK S: a00 OK
[...a new message is delivered...] [...a new message is delivered...]
S: * EXISTS 93 S: * EXISTS 93
S: * 93 FETCH (UID 127001 BODY[HEADER.FIELDS (FROM TO S: * 93 FETCH (UID 127001 BODY[HEADER.FIELDS (FROM TO SUBJECT)]
SUBJECT)] {76} {76}
S: Subject: Re: good morning S: Subject: Re: good morning
S: From: myboss@example.org S: From: myboss@example.org
S: To: bob@example.org S: To: bob@example.org
S: S:
S: ) S: )
S: * ESEARCH (TAG "a00") ADDTO (0 93) S: * ESEARCH (TAG "a00") ADDTO (0 93)
Note that the EXISTS response MUST precede any FETCH responses, and Note that the EXISTS response MUST precede any FETCH responses, and
together they MUST precede the ESEARCH response. together they MUST precede the ESEARCH response.
No untagged FETCH response SHOULD be returned if a message becomes a No untagged FETCH response SHOULD be returned if a message becomes a
member of UPDATE SEARCH due to flag or annotation changes. member of UPDATE SEARCH due to flag or annotation changes.
8. Formal Syntax 8. Formal Syntax
The following syntax specification uses the Augmented Backus-Naur The following syntax specification uses the Augmented Backus-Naur
Form (ABNF) notation as specified in [RFC5234]. [RFC3501] defines Form (ABNF) notation as specified in [RFC5234]. [RFC3501] defines
the non-terminals "capability", "command-auth", "mailbox", "mailbox- the non-terminals "capability", "command-auth", "mailbox", "mailbox-
data", "resp-text-code" and "search-key". The "modifier-update" non- data", "resp-text-code", and "search-key". The "modifier-update"
terminal is defined in [CONTEXT]. "mbx-list-oflag" is defined in non-terminal is defined in [RFC5267]. "mbx-list-oflag" is defined in
[RFC3501] and updated by [LISTEXT]. [RFC3501] and updated by [RFC5258].
Internet-draft August 2008
Except as noted otherwise, all alphabetic characters are case- Except as noted otherwise, all alphabetic characters are case-
insensitive. The use of upper or lower case characters to define insensitive. The use of upper or lower case characters to define
token strings is for editorial clarity only. Implementations MUST token strings is for editorial clarity only. Implementations MUST
accept these strings in a case-insensitive fashion. For example accept these strings in a case-insensitive fashion. For example, the
<filter-mailboxes-selected> non-terminal value "SELECTED" must be <filter-mailboxes-selected> non-terminal value "SELECTED" must be
treated in the same way as "Selected" or "selected". treated in the same way as "Selected" or "selected".
capability =/ "X-DRAFT-W06-NOTIFY" capability =/ "NOTIFY"
;; [[Note to RFC Editor: change the capability
;; name before publication]]
command-auth =/ notify command-auth =/ notify
notify = "NOTIFY" SP notify = "NOTIFY" SP
(notify-set / notify-none) (notify-set / notify-none)
notify-set = "SET" [status-indicator] SP event-groups notify-set = "SET" [status-indicator] SP event-groups
; Replace registered notification events ; Replace registered notification events
; with the specified list of events ; with the specified list of events
skipping to change at page 17, line 46 skipping to change at page 18, line 4
many-mailboxes = "(" mailbox *(SP mailbox) ")" many-mailboxes = "(" mailbox *(SP mailbox) ")"
event-groups = event-group *(SP event-group) event-groups = event-group *(SP event-group)
event-group = "(" filter-mailboxes SP events ")" event-group = "(" filter-mailboxes SP events ")"
;; Only <message-event>s are allowed in <events> ;; Only <message-event>s are allowed in <events>
;; when <filter-mailboxes-selected> is used. ;; when <filter-mailboxes-selected> is used.
filter-mailboxes = filter-mailboxes-selected / filter-mailboxes = filter-mailboxes-selected /
filter-mailboxes-other filter-mailboxes-other
filter-mailboxes-other = "inboxes" / "personal" / "subscribed" / filter-mailboxes-other = "inboxes" / "personal" / "subscribed" /
( "subtree" SP one-or-more-mailbox ) / ( "subtree" SP one-or-more-mailbox ) /
( "mailboxes" SP one-or-more-mailbox ) ( "mailboxes" SP one-or-more-mailbox )
filter-mailboxes-selected = "selected" / "selected-delayed" filter-mailboxes-selected = "selected" / "selected-delayed"
;; Apply to the currently selected mailbox only. ;; Apply to the currently selected mailbox only.
;; Only one of them can be specified in a NOTIFY ;; Only one of them can be specified in a NOTIFY
;; command. ;; command.
Internet-draft August 2008
events = ( "(" event *(SP event) ")" ) / "NONE" events = ( "(" event *(SP event) ")" ) / "NONE"
;; As in [MSGEVENT]. ;; As in [MSGEVENT].
;; "NONE" means that the client does not wish ;; "NONE" means that the client does not wish
;; to receive any events for the specified ;; to receive any events for the specified
;; mailboxes. ;; mailboxes.
event = message-event / event = message-event /
mailbox-event / user-event / event-ext mailbox-event / user-event / event-ext
message-event = ( "MessageNew" [SP message-event = ( "MessageNew" [SP
skipping to change at page 18, line 45 skipping to change at page 19, line 4
"SubscriptionChange" / "MailboxMetadataChange" "SubscriptionChange" / "MailboxMetadataChange"
; "SubscriptionChange" includes ; "SubscriptionChange" includes
; MailboxSubscribe and MailboxUnSubscribe. ; MailboxSubscribe and MailboxUnSubscribe.
; "MailboxName" includes MailboxCreate, ; "MailboxName" includes MailboxCreate,
; "MailboxDelete" and "MailboxRename". ; "MailboxDelete" and "MailboxRename".
user-event = "ServerMetadataChange" user-event = "ServerMetadataChange"
event-ext = atom event-ext = atom
;; For future extensions ;; For future extensions
oldname-extended-item = "OLDNAME" SP "(" mailbox ")" oldname-extended-item = "OLDNAME" SP "(" mailbox ")"
;; Extended data item (mbox-list-extended-item) ;; Extended data item (mbox-list-extended-item)
;; returned in a LIST response when a mailbox is ;; returned in a LIST response when a mailbox is
;; renamed. ;; renamed.
;; Note 1: the OLDNAME tag can be returned ;; Note 1: the OLDNAME tag can be returned
;; with and without surrounding quotes, as per ;; with or without surrounding quotes, as per
;; mbox-list-extended-item-tag production. ;; mbox-list-extended-item-tag production.
resp-text-code =/ "NOTIFICATIONOVERFLOW" / resp-text-code =/ "NOTIFICATIONOVERFLOW" /
Internet-draft August 2008
unsupported-events-code unsupported-events-code
message-event-name = "MessageNew" / message-event-name = "MessageNew" /
"MessageExpunge" / "FlagChange" / "MessageExpunge" / "FlagChange" /
"AnnotationChange" "AnnotationChange"
event-name = message-event-name / mailbox-event / event-name = message-event-name / mailbox-event /
user-event user-event
unsupported-events-code = "BADEVENT" unsupported-events-code = "BADEVENT"
SP "(" event-name *(SP event-name) ")" SP "(" event-name *(SP event-name) ")"
modifier-update = "UPDATE" modifier-update = "UPDATE"
[ "(" fetch-att *(SP fetch-att) ")" ] [ "(" fetch-att *(SP fetch-att) ")" ]
mbx-list-oflag =/ "\NoAccess" mbx-list-oflag =/ "\NoAccess"
9. Security considerations 9. Security Considerations
It is very easy for a client to deny itself service using NOTIFY: It is very easy for a client to deny itself service using NOTIFY.
Asking for all events on all mailboxes may work on a small server, Asking for all events on all mailboxes may work on a small server,
but with a big server can swamp the client's network connection or but with a big server, can swamp the client's network connection or
processing capability. In the worst case, the server's processing processing capability. In the worst case, the server's processing
could also degrade the service it offers to other clients. could also degrade the service it offers to other clients.
Server authors should be aware that if a client issues requests and Server authors should be aware that if a client issues requests and
does not listen to the resulting responses, the TCP window can does not listen to the resulting responses, the TCP window can easily
easily fill up, and a careless server might block. This problem fill up, and a careless server might block. This problem also exists
exists in plain IMAP, however this extension magnifies the problem. in plain IMAP; however, this extension magnifies the problem.
This extensions makes it possible to retrieve messages immediately This extension makes it possible to retrieve messages immediately
when they are added to the mailbox. This makes it wholly impractical when they are added to the mailbox. This makes it wholly impractical
to delete sensitive messages using programs like imapfilter. Using to delete sensitive messages using programs like imapfilter. Using
[SIEVE] or similar is much better. SIEVE [RFC5228] or similar is much better.
10. IANA considerations
The IANA is requested to add NOTIFY to the list of IMAP extensions, 10. IANA Considerations
http://www.iana.org/assignments/imap4-capabilities.
10.1. Initial LIST-EXTENDED extended data item registrations The IANA has added NOTIFY to the list of IMAP extensions.
It is requested that the following entry be added to the IMAP4 List 10.1. Initial LIST-EXTENDED Extended Data Item Registrations
Extended registry [LISTEXT]:
Internet-draft August 2008 The following entry has been added to the LIST-EXTENDED response
registry [RFC5258]:
To: iana@iana.org Subject: Registration of OLDNAME LIST-EXTENDED To: iana@iana.org
extended data item Subject: Registration of OLDNAME LIST-EXTENDED extended data item
LIST-EXTENDED extended data item tag: OLDNAME LIST-EXTENDED extended data item tag: OLDNAME
LIST-EXTENDED extended data item description: The OLDNAME extended LIST-EXTENDED extended data item description: The OLDNAME extended
data item describes the old mailbox name for the mailbox identified data item describes the old mailbox name for the mailbox
by the LIST response. identified by the LIST response.
Which LIST-EXTENDED option(s) (and their types) causes this extended Which LIST-EXTENDED option(s) (and their types) causes this extended
data item to be returned (if any): none data item to be returned (if any): none
Published specification : RFC XXXX, Section 5.4. Published specification : RFC 5465, Section 5.4.
Security considerations: none Security considerations: none
Intended usage: COMMON Intended usage: COMMON
Person and email address to contact for further information: Person and email address to contact for further information: Alexey
Alexey Melnikov <Alexey.Melnikov@isode.com> Melnikov <Alexey.Melnikov@isode.com>
Owner/Change controller: iesg@ietf.org Owner/Change controller: iesg@ietf.org
11. Acknowedgements 11. Acknowledgments
The authors gratefully acknowledge the help of Peter Coates, Dave The authors gratefully acknowledge the help of Peter Coates, Dave
Cridland, Mark Crispin, Cyrus Daboo, Abhijit Menon-Sen, Timo Cridland, Mark Crispin, Cyrus Daboo, Abhijit Menon-Sen, Timo
Sirainen and Eric Burger. In particular, Peter Coates contributed Sirainen, and Eric Burger. In particular, Peter Coates contributed
lots of text and useful suggestions to this document. lots of text and useful suggestions to this document.
Various examples are copied from other RFCs. Various examples are copied from other RFCs.
This document builds on one published and two unpublished drafts by This document builds on one published and two unpublished drafts by
the same authors. the same authors.
12. Normative References 12. Normative References
[RFC2119] Bradner, "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", RFC 2119, Harvard University, March Requirement Levels", BCP 14, RFC 2119, March 1997.
1997.
[RFC2177] Leiba, "IMAP4 IDLE Command", RFC 2177, IBM, June 1997.
[RFC3501] Crispin, "Internet Message Access Protocol - Version [RFC2177] Leiba, B., "IMAP4 IDLE command", RFC 2177, June 1997.
4rev1", RFC 3501, University of Washington, June 2003.
Internet-draft August 2008 [RFC2342] Gahrns, M. and C. Newman, "IMAP4 Namespace", RFC 2342,
May 1998.
[RFC5234] Crocker, Overell, "Augmented BNF for Syntax [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION
Specifications: ABNF", RFC 5234, Brandenburg 4rev1", RFC 3501, March 2003.
Internetworking, THUS plc, January 2008.
[RFC4314] Melnikov, "IMAP4 Access Control List (ACL) Extension", [RFC4314] Melnikov, A., "IMAP4 Access Control List (ACL)
RFC 4314, December 2005. Extension", RFC 4314, December 2005.
[RFC4466] Melnikov, Daboo, "Collected Extensions to IMAP4 ABNF", [RFC4466] Melnikov, A. and C. Daboo, "Collected Extensions to
RFC 4466, Isode Ltd., April 2006. IMAP4 ABNF", RFC 4466, April 2006.
[RFC4551] Melnikov, Hole, "IMAP Extension for Conditional STORE [RFC4551] Melnikov, A. and S. Hole, "IMAP Extension for
Operation or Quick Flag Changes Resynchronization", RFC Conditional STORE Operation or Quick Flag Changes
4551, Isode Ltd., June 2006. Resynchronization", RFC 4551, June 2006.
[QRESYNC] Melnikov, A., Cridland, D. and C. Wilson, "IMAP4 [RFC5162] Melnikov, A., Cridland, D., and C. Wilson, "IMAP4
Extensions for Quick Mailbox Resynchronization", RFC Extensions for Quick Mailbox Resynchronization", RFC
5162, March 2008. 5162, March 2008.
[LISTEXT] Leiba, Melnikov, "IMAP4 List Command Extensions", RFC [RFC5234] Crocker, D., Ed., and P. Overell, "Augmented BNF for
5258, June 2008. Syntax Specifications: ABNF", STD 68, RFC 5234, January
2008.
[METADATA] Daboo, "IMAP METADATA Extension", draft-daboo-imap- [RFC5258] Leiba, B. and A. Melnikov, "Internet Message Access
annotatemore-14 (work in progress), Apple Computer, Inc., Protocol version 4 - LIST Command Extensions", RFC 5258,
July 2008. June 2008.
[MSGEVENT] Newman, C. and R. Gellens, "Internet Message Store [RFC5267] Cridland, D. and C. King, "Contexts for IMAP4", RFC
Events", draft-ietf-lemonade-msgevent-06.txt (work in 5267, July 2008.
progress), July 2008.
[CONTEXT] Cridland, D. and C. King, "Contexts for IMAP4", RFC 5267, [RFC5423] Newman, C. and R. Gellens, "Internet Message Store
July 2008. Events", RFC 5423, Month 2009.
[NAMESPACE] Gahrns, M. and C. Newman, "IMAP4 Namespace", RFC 2342, [RFC5464] Daboo, C., "The IMAP METADATA Extension", RFC 5464,
May 1998. February 2009.
13. Informative References 13. Informative References
[SIEVE] Guenther, P. and T. Showalter, "Sieve: A Mail Filtering [RFC5228] Guenther, P., Ed., and T. Showalter, Ed., "Sieve: An
Language", RFC 5228, January 2008. Email Filtering Language", RFC 5228, January 2008.
[EMAIL-ARCH] Crocker, "Internet Mail Architecture", draft-crocker- [EMAIL-ARCH] Crocker, D., "Internet Mail Architecture", Work in
email-arch-10 (work in progress), February 2008. Progress, October 2008.
Internet-draft August 2008 Authors' Addresses
14. Authors' Addresses Arnt Gulbrandsen
Oryx Mail Systems GmbH
Schweppermannstr. 8
D-81671 Muenchen
Germany
EMail: arnt@oryx.com
Curtis King Curtis King
Isode Ltd Isode Ltd
5 Castle Business Village 5 Castle Business Village
36 Station Road 36 Station Road
Hampton, Middlesex TW12 2BX Hampton, Middlesex TW12 2BX
UK UK
Email: Curtis.King@isode.com EMail: Curtis.King@isode.com
Alexey Melnikov Alexey Melnikov
Isode Ltd Isode Ltd
5 Castle Business Village 5 Castle Business Village
36 Station Road 36 Station Road
Hampton, Middlesex TW12 2BX Hampton, Middlesex TW12 2BX
UK UK
Email: Alexey.Melnikov@isode.com EMail: Alexey.Melnikov@isode.com
Arnt Gulbrandsen
Oryx Mail Systems GmbH
Schweppermannstr. 8
D-81671 Muenchen
Germany
Email: arnt@oryx.com
Internet-draft August 2008
Intellectual Property Statement
The IETF takes no position regarding the validity or scope of any
Intellectual Property Rights or other rights that might be claimed
to pertain to the implementation or use of the technology described
in this document or the extent to which any license under such
rights might or might not be available; nor does it represent that
it has made any independent effort to identify any such rights.
Information on the procedures with respect to rights in RFC
documents can be found in BCP 78 and BCP 79.
Copies of IPR disclosures made to the IETF Secretariat and any
assurances of licenses to be made available, or the result of an
attempt made to obtain a general license or permission for the use
of such proprietary rights by implementers or users of this
specification can be obtained from the IETF on-line IPR repository
at http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights that may cover technology that may be required to implement
this standard. Please address the information to the IETF at
ietf-ipr@ietf.org.
Full Copyright Statement
Copyright (C) The IETF Trust (2008). This document is subject to
the rights, licenses and restrictions contained in BCP 78, and
except as set forth therein, the authors retain all their rights.
This document and the information contained herein are provided on
an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE
REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE
IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE
ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS
FOR A PARTICULAR PURPOSE.
Acknowledgment
Funding for the RFC Editor function is currently provided by the
Internet Society.
 End of changes. 164 change blocks. 
417 lines changed or deleted 366 lines changed or added

This html diff was produced by rfcdiff 1.35. The latest version is available from http://tools.ietf.org/tools/rfcdiff/