<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc strict="yes"?>
<?rfc symrefs="yes"?>
<?rfc linkmailto="no"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<rfc ipr="full3978" docName="draft-ietf-lemonade-msgevent-06.txt">
<front>
<title>Internet Message Store Events</title>
<?rfc include="author.rgellens"?>
<?rfc include="author.cnewman"?>
<date month="July" year="2008" />
<area>Applications</area>
<workgroup>lemonade</workgroup>	
<keyword>I-D</keyword>
<keyword>Internet-Draft</keyword>
<abstract><t>
One of the missing features in the existing Internet mail and messaging
standards is a facility for server-to-server and server-to-client event
notifications related to message store events.  As the scope of Internet
mail expands to support more diverse media (such as voice mail),
devices (such as cell phones) and to provide rich interactions with
other services (such as web portals and legal compliance systems), the
need for an interoperable notification system increases.  This document
attempts to enumerate the types of events which interest real-world
consumers of such a system.
</t></abstract>
</front>
<middle>
<section title="Introduction">
<t>
A message store is used to organize <xref target="RFC2822">Internet
Messages</xref> into one or more mailboxes, possibly hierarchical, annotate them in various ways
and provide access to these messages and associated meta-data.  Three
different standards-based protocols have been widely deployed to
remotely access a message store.  <xref target="RFC1939">Post Office
Protocol (POP)</xref> provides simple download-and-delete access to a
single mail drop (which is a subset of the functionality typically
associated with a message store).  <xref target="RFC3501">Internet
Message Access Protocol (IMAP)</xref> provides an extensible
feature-rich model for online, offline and disconnected access to a
message store with minimal constraints on any associated "fat-client"
user interface.  Finally, mail access applications built on top of <xref
target="RFC2616">Hypertext Transfer Protocol (HTTP)</xref> which run in
standards-based web browsers provide a third standards-based access
mechanism for online-only access.
</t><t>
While simple and/or ad-hoc mechanisms for notifications have sufficed to
some degree in the past (e.g., <xref target="RFC4146">Simple New Mail
Notification</xref>, <xref target="RFC2177">IMAP4 IDLE command</xref>),
as the scope and importance of message stores expands, the demand for a
more complete store notification system increases.  Some of the driving
forces behind this demand include:
<list style="symbols">
<t>Mobile devices with intermittent network connectivity that have "new
mail" or "message count" indicators</t>
<t>Unified messaging systems which include both Internet and
voice mail require support for a message waiting indicator on
phones</t>
<t>Interaction with systems for event-based or utility-computing
billing</t>
<t>Simplify the process of passing message store events to
non-Internet notification systems</t>
<t>A calendar system may wish to subscribe to MessageNew notifications
in order to support <xref target="RFC2447">iMIP</xref>.</t>
<t>Some jurisdictions have laws or regulations for information protection and auditing which require
interoperable protocols between message stores built by messaging
experts and compliance auditing systems built by compliance experts.</t>
</list>
</t>
<t>Vendors who have deployed proprietary notification systems for their
Internet message stores have seen significant demand to provide
notifications for more and more events.  As a first step towards
building a notification system, this document attempts to enumerate the
core events that real-world customers demand.</t>
<t>This document includes those events which can be generated by the use of <xref target="RFC3501">IMAP4Rev1</xref> and some existing extensions.  As new IMAP extensions are defined, or additional event types or parameters need to be added, the set specified here can be extended by means of an IANA registry with update requirements, as specified in <xref target="IANA"/>.</t>
<section title="Conventions Used in this Document">
<t>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 <xref target="RFC2119">RFC 2119</xref>  When these words appear in lower-case or with initial-capital letters, they are not RFC 2119 key words.</t>
</section>
<section title="Change History">
<t>This section to be removed if/when this draft is published as an RFC.</t>
<section title="Changes from -05 to -06">
<t><list style="symbols">
<t>Added discussion of message integrity to <xref target="Security_Considerations">Security Considerations</xref>.</t>
<t>Reviewed use of "may", "must" and "should" for conversion to "MAY", "MUST" and "SHOULD".</t>
<t>Reworded MessageNew and MessageExpire text.</t>
<t>Additional clarifying text added to <xref target="Future_Extensions">Future Extensions</xref>.</t>
<t>Added explicit prohibition on \Recent in FlagsSet to match the one in FlagsClear (\Recent was also explicitly excluded from flagNames).</t>
<t>Clarified that Logout disconnection types are suggestions only.</t>
<t>Added serverDomain and serverPort parameters, and clarified clientPort.</t>
<t>Clarified that a kilobyte is 1024 octets.</t>
<t>Clarified that FlagSet and FlagClear include one or more flags or keywords.</t>
<t>Changed "cover about 95% of the known use
   cases" to "an overwhelming majority of known use cases" in <xref target="Event_Types">Event Types</xref>.</t>
</list>
</t>
</section>
<section title="Changes from -04 to -05">
<t><list style="symbols">
<t>Reworded statement on optional versus mandatory and removed Anchor 11.</t>
<t>Included mailbox admin events in list of exceptions in Appendix A, and deleted Anchor 23.</t>
</list>
</t>
</section><section title="Changes from -03 to -04">
<t><list style="symbols">
<t>Added QuotaChange event.</t>
</list>
</t>
</section>
<section title="Changes from -02 to -03">
<t><list style="symbols">
<t>Fix typo in Login event</t>
<t>Remove UIDVALIDITY from MailboxRename event.</t>
<t>Made event names hierarchical: Changed AppendMessage to MessageAppend, ExpireMessage to MessageExpire, ExpungeMessage to MessageExpunge, NewMessage to MessageNew, OverQuota to QuotaExceed, UnderQuota to QuotaWithin, ReadMessages to MessageRead, TrashMessages to MessageTrash, SetFlags to FlagsSet, and ClearFlags to FlagsClear; deleted Editor's Note asking if this should be done.</t>
<t>Made ACL information a future extension in MailboxCreate.</t>
</list>
</t>
</section>
<section title="Changes from -01 to -02">
<t><list style="symbols">
<t>Add text indicating that mailboxes may contain Internet messages and/or child mailboxes.</t>
<t>Remove word "folder" from definition of "mailbox."</t>
<t>Add editor's note regarding optionality in this document.</t>
<t>Add editor's note regarding optional vs. mandatory events.</t>
<t>Add editor's note regarding event names.</t>
<t>Remove U.S.-centric wording regarding laws.</t>
<t>Review uses of "will" and change as appropriate.</t>
<t>Clarification of server address in login event.</t>
<t>Add MailboxCreate, MailboxDelete, MailboxRename, and MailboxSubscribe events.</t>
<t>Add mailboxName and oldMailboxName parameter.s</t>
<t>Move RFC2822 from normative to informative.</t>
<t>Add IANA Considerations and reference to RFC 2434.</t>
<t>Minor grammatical improvements.</t>
<t>Incorporate edits from Alexey Melnikov.</t>
<t>Add editor's note regarding deployment of mailbox admin events.</t>
<t>Add Acknowledgments section.</t>
<t>Fix formatting to add blank line between paragraphs in event and parameter lists.</t>
<t>Add reference to RFC 2119 and "Conventions" section.</t>
<t>Update RFC 2222 to RFC 4422.</t>
</list>
</t>
</section>
<section title="Changes from -00 to -01">
<t><list style="symbols">
<t>Add modseq event parameter.</t>
<t>Add tags event parameter.</t>
</list></t>
</section>
<section title="Changes from draft-newman-lemonade-msgevent-00.txt to draft-ietf-lemonade-msgevent-00.txt">
<t><list style="symbols">
<t>Rename draft title</t>
<t>Add Change History section.</t>
<t>Update reference to URLAUTH.</t>
<t>Add FlagsSet, FlagsClear events and flagNames parameter.  Update future events section to reflect this change.</t>
<t>Removed unnecessary normative reference to NAMESPACE.</t>
</list></t>
</section>
</section>
</section>

<?rfc needLines="6"?>
<section title="Terminology">
<t>The following terminology is used in this document:
<list style="hanging">
<t hangText="mailbox"><vspace blankLines="0"/>A container for Internet messages and/or child mailboxes.  A mailbox may or may not permit delivery of new messages via a mail delivery agent.</t>
<t hangText="mailbox identifier"><vspace blankLines="0"/>A mailbox identifier provides
sufficient information to identify a specific mailbox on a specific
server instance.  An IMAP URL can be a mailbox identifier.</t>
<t hangText="message access protocols"><vspace blankLines="0"/>Protocols which provide
clients (e.g., a mail user agent or web browser) with access to the message
store including but not limited to IMAP, POP and HTTP.</t>
<t hangText="message context"><vspace blankLines="0"/>As defined in <xref target="RFC3458"/>.</t>
<t hangText="UIDVALIDITY"><vspace blankLines="0"/>As defined in <xref
target="RFC3501">IMAP4rev1</xref>.  UIDVALIDITY is critical to the
correct operation of a caching mail client.  When it changes, the client
MUST flush its cache.  It's particularly important to include
UIDVALIDITY with event notifications related to message addition or
removal in order to keep the message data correctly synchronized.</t>
</list>
</t>
</section>

<section title="Event Model">
<t>The events that are generated by a message store depend to some
degree on the model used to represent a message store.  The model the
IETF has for a message store is implicit from IMAP4rev1 and extensions,
so that model is assumed by this document.</t>
<t>A message store event typically has an associated mailbox name and
usually has an associated user name (or authorization identity if using
the terminology from <xref target="RFC4422">SASL</xref>).  Events
referring to a specific message can use an <xref target="RFC5092">IMAP
URL</xref> to do so.  Events referring to a set of messages can use an
IMAP URL to the mailbox plus an IMAP UID set.</t>
<t>Each notification has a type and parameters.  The type determines the
type of event, while the parameters supply information about the context
of the event that may be used to adjust subscription preferences or may
simply supply data associated with the event.  The types and parameter
names in this document are restricted to US-ASCII printable characters
so these events can be easily mapped to an arbitrary notification
system.  However, this document assumes arbitrary parameter values
(including large and multi-line values) can be encoded with the
notification system.  Systems which lack that feature could only
implement a subset of these events.</t>
<t>This document does not indicate which event parameters
are mandatory or optional.  That is done in documents which specify
specific message formats or bindings to a notification system.</t> 
<t>For scalability reasons, some degree of filtering at event generation
is necessary.  At the very least, the ability to turn on and off groups
of related events and to suppress inclusion of large parameters (such as
messageContent) is needed.  A sophisticated publish/subscribe
notification system may be able to propagate cumulative subscription
information to the publisher.</t>
<t>Some of these events might be logically collapsed into a single event
type with a required parameter to distinguish between the cases (e.g.,
QuotaExceed and QuotaWithin).  However until such time that an event
subscription model is formulated, it's not practical to make such
decisions.  We thus note only the fact that some of these events may be
viewed as a single event type.</t>
</section>

<section anchor="Event_Types" title="Event Types">
<t>This section discusses the different types of events useful in a
message store event notification system.  The intention is to document
the events sufficient to cover an overwhelming majority of known use cases while
leaving less common event types for the future.  This section mentions
parameters which are important or specific to the events described here.
Event parameters likely to be included in most or all notifications are
discussed in the next section.</t>

<section title="Message Addition and Deletion">
<t>This section includes events related to message addition and deletion.
<list style="hanging">
<t hangText="MessageAppend"><vspace blankLines="0"/>A message was appended or
concatenated to a mailbox by a message access client.  For the most
part, this is identical to the MessageNew event type, except that the
SMTP envelope information is not included as a parameter, but
information about which protocol triggered the event MAY be included. 
See the MessageNew event for more information.</t>
<t hangText="MessageExpire"><vspace blankLines="0"/>One or more messages were expired
from a mailbox due to server expiration policy and are no longer
accessible by the end-user.  
<vspace blankLines="1"/>The parameters include a mailbox identifier
which MUST include UIDVALIDITY, and a UID set which describes the messages.
<vspace blankLines="1"/>Information about which server expiration policy was applied may be
included in the future.</t>
<t hangText="MessageExpunge"><vspace blankLines="0"/>One or more messages were expunged
from a mailbox by an IMAP CLOSE/EXPUNGE, POP3 DELE+QUIT, HTTP or
equivalent client action and are no longer accessible by the end-user. 
<vspace blankLines="1"/>The parameters include a mailbox identifier which MUST include
UIDVALIDITY, a UID set, and MAY also indicate which access protocol
triggered the event.</t>
<t anchor="MessageNew" hangText="MessageNew"><vspace blankLines="0"/>A new message was received into a
mailbox via a message delivery agent.  
<vspace blankLines="1"/>The parameters include a message
identifier which for IMAP-accessible
message stores MUST include UIDVALIDITY and UID.  The parameters MAY also include SMTP envelope and other arbitrary message and
mailbox meta-data.  In some cases, the entire new message
itself may be included.  The set of parameters SHOULD be adjustable
to the client's preference with limits set by server policy. An
interesting policy, for example, would be to include messages up to 2K
in size with the notification, but for larger messages to include a
<xref target="RFC4467">URLAUTH</xref> reference.</t>
<t hangText="QuotaExceed"><vspace blankLines="0"/>An operation failed (typically
MessageNew) because the user's mailbox exceeded one of the quotas (e.g.,
disk quota, message quota, quota by message context, etc).  The
parameters SHOULD include at least the relevant user and quota,
and optionally the mailbox.  Quota usage SHOULD be included if possible.
Parameters needed to extend this to support quota by context are not
presently described in this document, but could be added in the
future.</t>
<t hangText="QuotaWithin"><vspace blankLines="0"/>An operation occurred (typically
MessageExpunges or MessageExpires) which reduced the user's quota usage
under their limit.</t>
<t hangText="QuotaChange"><vspace blankLines="0"/>The user's quota was changed.</t>
</list></t>
</section>

<section title="Message Flags">
<t>This section includes events related to changes in message flags.
<list style="hanging">
<t hangText="MessageRead"><vspace blankLines="0"/>One or more messages in the mailbox
were marked as read or seen by a user.  Note that POP has no concept of
read or seen messages, so these events are only generated by IMAP or
HTTP clients (or equivalent).  
<vspace blankLines="1"/>The parameters include a mailbox
identifier and a set of message UIDs.</t>
<t hangText="MessageTrash"><vspace blankLines="0"/>One or more messages were marked
for future deletion by the user but are still accessible over protocol
(the user's client may or may not make these messages accessible through
its user interface).  
<vspace blankLines="1"/>The parameters include a mailbox identifier and a
set of message UIDs.</t>
<t hangText="FlagsSet"><vspace blankLines="0"/>One or more messages in the mailbox had one or more IMAP flags or keyword sets.  
<vspace blankLines="1"/>The parameters include a list of IMAP flag or keyword names that were set, a mailbox identifier and a set of message UIDs that were impacted.  The flagNames MUST not include \Recent.  For compatibility with simpler clients, it SHOULD be configurable whether setting the \Seen or \Deleted flags results in this event or the simpler MessageRead/MessageTrash events.  By default, the simpler message forms SHOULD be used for MessageRead and MessageTrash.</t>
<t hangText="FlagsClear"><vspace blankLines="0"/>One or more messages in the mailbox had one or more IMAP flags or keywords cleared.  
<vspace blankLines="1"/>The parameters include a list of IMAP flag or keyword names that were cleared, a mailbox identifier and a set of message UIDs that were impacted.  The flagNames parameter MUST not include \Recent.</t>
</list></t>
</section>

<section title="Access Accounting">
<t>This section lists events related to message store access accounting.
<list style="hanging">
<t hangText="Login"><vspace blankLines="0"/>A user has logged in to the system via
IMAP, HTTP, POP or some other mechanism.  
<vspace blankLines="1"/><vspace blankLines="0"/>The parameters include the
domain name and port used to access the server and the user's authorization identity. 
Additional possible parameters include the client's IP address and port,
the authentication identity (if different from the authorization
identity), the service name, the authentication mechanism, information
about any negotiated security layers, a timestamp and other
information.</t>
<t hangText="Logout"><vspace blankLines="0"/>A user has logged out or otherwise been
disconnected from the message store via IMAP, HTTP, POP or some other
mechanism.  
<vspace blankLines="1"/>The parameters include the server domain name and the user's
authorization identity.  Additional parameters MAY include any of the
information from the "Login" event as well as information about the type
of disconnect (suggested values include graceful, abort, timeout, and security layer error), the
duration of the connection or session and other information.</t>
</list></t>
</section>
<section title="Mailbox Management">
<t>This section lists events related to the management of mailboxes.
<list style="hanging">
<t hangText="MailboxCreate"><vspace blankLines="0"/>A mailbox has been created, or an access control changed on an existing mailbox so that it is now accessible by the user.  If the mailbox creation caused the creation of new mailboxes earlier in the hierarchy, separate MailboxCreate events are not generated for those as their creation is implied.  
<vspace blankLines="1"/>The parameters include the created mailbox identifier, its UIDVALIDITY for IMAP-accessible message stores, and MAY also indicate which access protocol triggered the event.  Access/permissions information (such as <xref target="RFC4314">ACL</xref> settings) require a standardized format to be included, and so are left for future extension.</t>
<t hangText="MailboxDelete"><vspace blankLines="0"/>A mailbox has been deleted, or an access control changed on an existing mailbox so that it is no longer accessible by the user.  Note that if the mailbox has child mailboxes, only the specified mailbox has been deleted, not the children.  The mailbox becomes \NOSELECT and the hierarchy remains unchanged, as per the description of the DELETE command in RFC 3501<xref target="RFC3501">IMAP4rev1</xref>.  
<vspace blankLines="1"/>The parameters include the deleted mailbox identifier, and MAY also indicate which access protocol triggered the event.</t>
<t hangText="MailboxRename"><vspace blankLines="0"/>A mailbox has been renamed.  Note that, per the description of the RENAME command in RFC 3501<xref target="RFC3501">IMAP4rev1</xref>, special semantics regarding the mailbox hierarchy apply when INBOX is renamed (child mailboxes are usually included in the rename, but are excluded when INBOX is renamed).  When a mailbox other than INBOX is renamed and its child mailboxes are also renamed as a result, separate MailboxRename events are not generated for the child mailboxes, as their renaming is implied.  If the rename caused the creation of new mailboxes earlier in the hierarchy, separate MailboxCreate events are not generated for those as their creation is implied.  When INBOX is renamed, a new INBOX is created.  A MailboxCreate event is not generated for the new INBOX, since it is implied.  
<vspace blankLines="1"/>The parameters include the old mailbox identifier, the new mailbox identifier, and MAY also indicate which access protocol
triggered the event.</t>
<t hangText="MailboxSubscribe"><vspace blankLines="0"/>A mailbox has been added to the subscription list.  
<vspace blankLines="1"/>The parameters include the user whose subscription list has been affected and the mailbox identifier, and MAY also indicate which access protocol triggered the event.</t>
<t hangText="MailboxUnSubscribe"><vspace blankLines="0"/>A mailbox has been removed from the subscription list.  
<vspace blankLines="1"/>The parameters include the user whose subscription list has been affected and the mailbox identifier, and MAY also indicate which access protocol triggered the event.</t>
</list></t>
</section>

</section>

<?rfc needLines="5"?>
<section title="Event Parameters">
<t>This section lists parameters included with
these events.
<list style="hanging">
<t hangText="admin">
<vspace blankLines="1"/>Included with all events generated by message access protocols.
<vspace blankLines="1"/>The authentication identity associated with this event, as
distinct from the authorization identity (see "user"). This is not
included when it is the same as the value of the user parameter.</t>
<t hangText="bodyStructure">
<vspace blankLines="1"/>May be included with MessageAppend and MessageNew.
<vspace blankLines="1"/>The IMAP BODYSTRUCTURE of the message.</t>
<t hangText="clientIP">
<vspace blankLines="1"/>Included with all events generated by message access protocols.
<vspace blankLines="1"/>The IP address of the message store access client which
performed the action which triggered the notification.</t>
<t hangText="clientPort">
<vspace blankLines="1"/>Included with all events generated by message access protocols.
<vspace blankLines="1"/>The port number of the message store access client which
performed an action which triggered the notification (the port from which the connection occurred).</t>
<t hangText="diskQuota">
<vspace blankLines="1"/>Included with QuotaExceed, QuotaWithin, and QuotaChange notifications relating to a user or mailbox disk quota.  May be included with other notifications.
<vspace blankLines="1"/>Disk quota limit in kilobytes (1024 octets).</t>
<t hangText="diskUsed">
<vspace blankLines="1"/>Included with QuotaExceed and QuotaWithin notifications relating to a user or mailbox disk quota.  May be included with other notifications.
<vspace blankLines="1"/>Disk space used in kilobytes (1024 octets).  Only disk space which counts against the quota is included.</t>
<t hangText="envelope">
<vspace blankLines="1"/>May be included with the MessageNew notification.
<vspace blankLines="1"/>The message transfer envelope associated with final delivery of
the message for the MessageNew notification.  This includes the MAIL
FROM and relevant RCPT TO line(s) used for final delivery with CRLF
delimiters and any ESMTP parameters.</t>
<t hangText="flagNames">
<vspace blankLines="1"/>Included with FlagsSet and FlagsClear events.  May be included with MessageAppend and MessageNew to indicate flags which were set initially by the APPEND command or delivery agent respectively.
<vspace blankLines="1"/>A space-separated list of IMAP flag or keyword names that were set or cleared.  Flag names begin with backslash while keyword names do not.  The \Recent flag is explicitly not permitted in the list.</t>
<t hangText="mailboxID">
<vspace blankLines="1"/>Included in events which affect mailboxes.  URI describing the mailbox.  In the case of MailboxRename, this refers to the new name.</t>
<t hangText="maxMessages">
<vspace blankLines="1"/>Included with QuotaExceed and QuotaWithin notifications relating to a user or mailbox message count quota.  May be included with other notifications.
<vspace blankLines="1"/>Quota limit on the number of messages
in the mailbox, for events referring to a mailbox.</t>
<t hangText="messageContent">
<vspace blankLines="1"/>May be included with MessageAppend and MessageNew.
<vspace blankLines="1"/>The entire message itself.  Size based suppression of this
SHOULD be available.</t>
<t hangText="messageSize">
<vspace blankLines="1"/>May be included with MessageAppend and MessageNew.
<vspace blankLines="1"/>Size of the RFC 2822 message itself in octets.  This value
matches the length of the IMAP literal returned in
response to an IMAP FETCH of BODY[] for the referenced message.</t>
<t hangText="messages">
<vspace blankLines="1"/>Included with QuotaExceed and QuotaWithin notifications relating to a user or mailbox message count quota.  May be included with other notifications.
<vspace blankLines="1"/>Number of messages in the mailbox.  This
is typically included with message addition and deletion events.</t>
<t hangText="modseq">
<vspace blankLines="1"/>May be included with any notification referring to one message.
<vspace blankLines="1"/>This is the 64-bit integer MODSEQ as defined in <xref target="RFC4551" />.  No assumptions about MODSEQ can be made if this is omitted.</t>
<t hangText="oldMailboxID">
<vspace blankLines="1"/>URI describing the old name of a renamed or moved mailbox.</t>
<t hangText="pid">
<vspace blankLines="1"/>May be included with any notification.
<vspace blankLines="1"/>The process ID of the process which generated
the notification.</t>
<t hangText="process">
<vspace blankLines="1"/>May be included with any notification.
<vspace blankLines="1"/>The name of the process which generated
the notification.</t>
<t hangText="serverDomain">Included in Login, and optionally in Logout or other events.  The domain name or IP address used to access the server or mailbox.</t>
<t hangText="serverPort">Included in Login, and optionally in Logout or other events.  The port number used to access the server.  This is often a well-known port.</t>
<t hangText="serverFQDN">
<vspace blankLines="1"/>May be included with any notification.
<vspace blankLines="1"/>The fully qualified domain name of the server which generated
the event.  Note that this may be different from the server name used to
access the mailbox included in the mailbox identifier.</t>
<t hangText="service">
<vspace blankLines="1"/>May be included with any notification.
<vspace blankLines="1"/>The name of the service which triggered the event.  Suggested
values include "imap", "pop", "http", and "admincli" (for an administrative client).</t>
<t hangText="tags">
<vspace blankLines="1"/>May be included with any notification.
<vspace blankLines="1"/>This is a comma-separated list of UTF-8 tags.  One or more tags
can be set at the time a notification criteria or notification
subscription is created.  Subscribers can use tags for additional
client-side filtering or dispatch of events.</t>
<t hangText="timestamp">
<vspace blankLines="1"/>May be included with any notification.
<vspace blankLines="1"/>When the notification was generated in <xref target="RFC3339" /> syntax.</t>
<t hangText="uidnext">
<vspace blankLines="1"/>May be included with any notification referring to a mailbox.
<vspace blankLines="1"/>The UID that is projected to be assigned next in the
mailbox.  This is typically included with message addition and deletion
events.  This is equivalent to the UIDNEXT status item in the IMAP
STATUS command.</t>
<t hangText="uidset">
<vspace blankLines="1"/>Included with MessageExpires, MessageExpunges, MessageRead, MessageTrash, FlagsSet and FlagsClear.
<vspace blankLines="1"/>This includes the set of IMAP UIDs referenced.</t>
<t hangText="uri">
<vspace blankLines="1"/>Included with all notifications and refers to the IMAP server,
a mailbox or a message.
<vspace blankLines="1"/>Typically an IMAP URL.  This can include the name of the server
used to access the mailbox/message, the mailbox name, the UIDVALIDITY of
the mailbox, and the UID of a specific message.</t>
<t hangText="user">
<vspace blankLines="1"/>Included with all events generated by message access protocols.
<vspace blankLines="1"/>This is the SASL authorization identifier used when the user
connected to the access protocol which triggered the event.  For events
associated with a mailbox, this may be different from the owner of the
mailbox specified in the IMAP URL.</t>
</list></t>
</section>

<?rfc needLines="5"?>
<section title="IANA Considerations" anchor="IANA">
<t>The IANA is requested to create a new registry for "Internet Message Store Events" containing two sub-registries: event names and event parameters.  For both event names and event parameters, entries which do not start with "vnd." are added by the IETF and intended for interoperable use.  Entries which start with "vnd." are intended for private use by one or more parties and are allocated to avoid collisions.</t>
<t>The initial values are contained in this document.</t>
<t>Using <xref target="RFC2434">IANA Considerations</xref> terminology, entries which do not start with "vnd." are allocated by IETF Consensus, while those starting with "vnd." are allocated First Come First Served.</t>
</section>

<?rfc needLines="5"?>
<section anchor="Security_Considerations" title="Security Considerations">
<t>Notifications can produce a large amount of traffic and expose
sensitive information.  When notification mechanisms are used to maintain
state between a different entities, the ability to corrupt or manipulate
notification messages could enable an attacker to modulate the state of 
these entities.  For example, if an attacker were able to modify 
notifications sent from a message store to an auditing server, he could
modify the "user" and "messageContent" parameters in MessageNew 
notifications to create false audit log entries.</t>
<t>A competent transfer protocol for notifications
must consider authentication, authorization, privacy, and message integrity, 
as well as
denial-of-service issues.  While the IETF has adequate tools and
experience to address these issues for mechanisms which involve only one
TCP connection, notification or publish/subscribe protocols which are
more sophisticated than a single end-to-end TCP connection will need to
pay extra attention to these issues and carefully balance requirements
to successfully deploy a system with security and privacy
considerations.</t>
</section>

<?rfc needLines="5"?>
<section title="Acknowledgments">
<t>Alexey Melnikov, Arnt Gulbrandsen, and Zoltan Ordogh have reviewed and offered improvements to this draft.  Richard Barnes did a nice review during Last Call.</t>
</section>

</middle>
<back>
<references title="Normative References">
<?rfc include="reference.RFC.2119"?> <!-- Key Words -->
<?rfc include="reference.RFC.5092"?> <!-- IMAP URL -->
<?rfc include="reference.RFC.2434"?> <!-- IANA Considerations -->
<?rfc include="reference.RFC.3501"?> <!-- IMAP4rev1 -->
</references>
<references title="Informative References">
<?rfc include="reference.RFC.4314"?> <!-- ACL -->
<?rfc include="reference.RFC.1939"?> <!-- POP3 -->
<?rfc include="reference.RFC.2177"?> <!-- IMAP4 IDLE -->
<?rfc include="reference.RFC.2447"?> <!-- iMIP -->
<?rfc include="reference.RFC.2616"?> <!-- HTTP -->
<?rfc include="reference.RFC.2822"?> <!-- Internet Message Format -->
<?rfc include="reference.RFC.3339"?> <!-- date-time -->
<?rfc include="reference.RFC.3458"?> <!-- Message Context -->
<?rfc include="reference.RFC.4146"?> <!-- Simple New Mail Notifications -->
<?rfc include="reference.RFC.4422"?> <!-- SASL -->
<?rfc include="reference.RFC.4467"?> <!-- URLAUTH -->
<?rfc include="reference.RFC.4551"?> <!-- CONDSTORE -->
</references>
<section anchor="Future_Extensions" title="Future Extensions">
<t>This document specifies core functionality based on events which are believed to be
well understood, have known use cases and are implemented by at least
one deployed real-world Internet message store.  (A few events are exceptions to the last test only: FlagsSet, FlagsClear, MailboxCreate, MailboxDelete, MailboxRename, MailboxSubscribe, and MailboxUnSubscribe.)</t>
<t>Some events have been
suggested, but are postponed to future extensions because they do not
meet this criteria.  These events include messages which have been moved
to archive storage and may require extra time to access, quota by message context, authentication failure, user mail account disabled, annotations, and mailbox ACL or metadata change.  The descriptions of several events note additional parameters which are likely candidates for future inclusion. See <xref target="IANA"/> for how the list of events and parameters can be extended.</t>
<t>In order to narrow the scope of this document to something that can
be completed, only events generated from the message store (by a message
access module, administrative module or message delivery agent) are
considered.  A complete mail system is normally linked with an identity
system which would also publish events of interest to a message store
event subscriber.  Events of interest include account
created/deleted/disabled and password changed/expired.</t>
</section>
</back>
</rfc>
