RFC 5551
Lemonade Notifications Architecture
RFC 5551: Lemonade Notifications Architecture ๐ฌ
Network Working Group ๐ธ Editor: R. Gellens, Ed. (Qualcomm) Category: Informational โจ Date: August 2009 ๐ Obsoletes / Updates: this RFC's header doesn't list anything it obsoletes or updates ๐
Abstract
okay so notifications and filtering are literally how email gets to feel good on phones and other tiny devices ๐ฑ (we're talking small screens, not much memory, slow data, the whole constrained-device struggle ๐ญ). Notifications tell the client when something big happens, like new mail landing, so it can react, say by grabbing the interesting stuff right away ๐. Filtering trims the visible mail down to the messages that meet some criteria for "interesting" ๐ . All of this is part of the goals of the Lemonade working group (Enhancements to Internet email to Support Diverse Service Environments) ๐
This doc also talks about server-to-server notifications and how they fit into an architecture that gives server-to-client notifications ๐ซถ
Status of This Memo
This memo gives info for the Internet community ๐ It does not specify an Internet standard of any kind, so don't go treating it as one ๐ Distribution of this memo is unlimited ๐
Copyright Notice
Copyright (c) 2009 IETF Trust and the persons identified as the document authors. All rights reserved. ๐ฅ
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents in effect on the date of publication of this document (http://trustee.ietf.org/license-info). Please review these documents carefully, because they spell out your rights and restrictions with respect to this document ๐
This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English ๐ฆ
Table of Contents
1. Introduction ....................................................2
1.1. Conventions Used in This Document ..........................2
2. Notifications Logical Architecture and LEMONADE Profile .........2
3. Event-Based Synchronization .....................................4
4. Push Email ......................................................5
5. Server-to-Server Notifications Rationale ........................5
5.1. Notifications Discussion ...................................6
5.2. Server to Server Notifications Scope .......................7
5.3. Basic Operation ............................................8
5.4. Event Order ...............................................10
5.5. Reliability ...............................................10
6. Security Considerations ........................................10
7. References .....................................................11
7.1. Normative References ......................................11
7.2. Informative References ....................................11
8. Contributors ...................................................12
1. Introduction โจ
The Lemonade work [LEMONADE-PROFILE] identified a need to provide notification and filtering mechanisms for use with IMAP [IMAP]. It's giving "we need this, like, yesterday" ๐
In addition, external groups that make use of IETF work also expressed such requirements (see, for example, [OMA-LEMONADE-ARCH]; Open Mobile Alliance (OMA) requirements for within-IMAP ("inband") and out-of-IMAP ("outband") server to client notifications are listed in [OMA-ME-RD]). So other groups were asking for this too ๐
1.1. Conventions Used in This Document ๐
Within this document, the terms "Lemonade Profile" and "Lemonade" generally refer to the revised Lemonade Profile document, RFC 5550 [LEMONADE-PROFILE]. Lemonade = the Lemonade Profile, basically ๐ง
2. Notifications Logical Architecture and LEMONADE Profile ๐ธ
The target logical architecture for the LEMONADE Profile is described in the revised Lemonade Profile document [LEMONADE-PROFILE]. Go read that one for the full picture ๐ฅ
Figure 1 illustrates how notification and filtering fit in the context of Lemonade. Here's the diagram, bestie ๐
+--------------+
| |....
+=========| Notification |.NF.
! | Server |....
! | |^ ^ NOTE:
! +--------------+! ! NF is either in
Notif-! ! ! Notification
ications! Filter Protocol ! ! Server or IMAP
Protocol! !======================! ! Store, not both
! ! !
! ! Filter Protocol ....
! !=====================>. . +---------+
! ! +-----------.NF.---+ | |
V ! | .... | | MTA |
+-----+ IMAP |.... | LMTP/ |.... |<==SMTP
| | <======> |.VF. IMAP ....| SMTP |.AF. |
| MUA |\ ME-2a |.... Store .DF.|<=======|.... |
| | \ | ....| | |
+-----+ \ +------------------+ +---------+
\ !
\ !URLAUTH
SUBMIT\ !
\ +----v-----+
\ | | +-----+
\ | LEMONADE | SMTP | |==>SMTP
===>| Submit |===============>| MTA |
ME-2b | Server | | |
| | +-----+
+----------+
Figure 1: Filtering Mechanism Defined in
Lemonade Profile Architecture
In Figure 1, four categories of filters are defined ๐ซถ
- AF: Administrative Filters: Created and maintained by mail administration. AF are typically not configured by the user and are used to apply policies, content filtering, virus protection, spam filtering, etc. (the admin's department ๐ฎโโ๏ธ)
- DF: Deposit Filters: Executed on deposit of new mail. Can be defined as Sieve filters [SIEVE]. (they run the moment mail shows up ๐ฅ)
- VF: View Filters: Define which messages are important to a client. May be implemented as pseudo-virtual mailboxes [CONTEXT]. Clients may use this to restrict which messages they synchronize. (the "only the good stuff" filter ๐)
- NF: Notification Filters: Determine when out-of-IMAP ("outband") notifications are sent to the client. These filters can be implemented either in the message store or in a separate notifications engine. (the "ping me when" filter ๐)
Note that when implementing DF or NF using Sieve, the 'enotify' [SIEVE-NOTIFY] and likely the 'variables' [SIEVE-VARIABLES] Sieve extensions might be needed. Heads up, these extensions might be needed for it to work ๐
The filters are manageable by the client as follows:
- NF and DF: When internal to the mail store, these are typically implemented using Sieve; hence, a Sieve management protocol is used for client modifications. See [MANAGE-SIEVE] for more information. Per-mailbox notifications might be implemented using a combination of a primary Sieve script for notifications on delivery into a mailbox (e.g., FILEINTO) and a per-mailbox Sieve script such as [IMAP-SIEVE] for transfers into a mailbox. When the NF is within a notification server, it is out of scope of Lemonade. ๐ ๏ธ
- VF: via pseudo-virtual mailboxes as defined in [CONTEXT]. ๐
In Figure 1, the NF are shown both as part of the mail store (for example, using Sieve) and as an external notification server. Either approach can be used. Pick your fighter ๐ฅ
3. Event-Based Synchronization ๐ฆ
+----------------+ +---------------+ +------------+
| COMPLETE | (VF) | VIEW | (NF) | PUSH |
| REPOSITORY | View | REPOSITORY |Notification| REPOSITORY |
| |Filters| | Filters | |
| all email | | email to be | | important |
| in the account |=======|synched by the |=====<?>====| email / |
| | | mobile client | | | events |
| | | (CONTEXT) | | | |
+----------------+ +---------------+ | +------------+
| |
IDLE / |
NOTIFY Out-of-IMAP
| Notifications
| |
V V
Figure 2: Filters and Repositories
For in-IMAP ("inband") notifications, the Mail User Agent (MUA) (client) issues IDLE [IDLE], or the successor extension command NOTIFY [NOTIFY]; the LEMONADE IMAP server sends notifications as unsolicited responses to the client. So the client basically says "tell me when stuff happens" and the server shouts back ๐ฃ
Out-of-IMAP ("outband") notifications are messages sent to the user or client not through IMAP. When directed at the user, they are human-consumable and intended to alert the user. When directed at the client, they are machine-consumable and may be acted upon by the receiver in various ways, for example, fetching data from the mail store or resynchronizing one or more mailboxes, updating internal state information, and alerting the user. Machine pings are giving robot-bestie energy ๐ค๐
4. Push Email ๐
A good user experience of "push email" requires that when "interesting" events occur in the mail store, the client is informed so that it can connect and resynchronize. Nobody wants to refresh their inbox manually in 2009 or any year ๐ The Lemonade Profile [LEMONADE-PROFILE] contains more information, especially in Section 5.4.2, titled "External Notifications". Go check that section if you want the deep dive ๐ฅ
5.1. Notifications Discussion
okay so POP3 and IMAP4 are the protocols mail clients use to access and manage email on mail systems ๐ฌ but here's the tea: by design and scope, neither one gives you an off-line way to tell an end user when their mailbox changes ๐ญ and neither one lets you combine the status of all the user's different mailboxes into one view ๐
the want for this is obvious tbh. even back in the early days of email, people were using notification stuff like login shell checks and little hacks like [BIFF] ๐ฆ
so to give an end user unified notifications and one centralized Message-Waiting Indicator (MWI), you need notification mechanisms that aggregate the info from every event happening across the user's different messaging systems โจ
server-to-server notifications are how the messaging system sends state change events to the notification system whenever something happens in or to an end user's mailbox ๐
notification systems fall into three big architectures: external smart clients, intrinsic notification, and separate notification mechanisms ๐ธ
external smart clients are agents that sit outside the mail system and periodically check mailbox state (or get notified, for example through IMAP IDLE) and then tell the user or the user's mail client. loads of these have existed over the years, like login shells that check the user's mail spool and laptop/desktop tiny clients that poll the user's mail servers every so often, etc. ๐ป
intrinsic notification is any facility inside a mail system that generates notifications. the server component of [BIFF] is one example, and for more modern systems there are the recent Sieve extensions for notifications [SIEVE-NOTIFY] ๐ฅ
separate notification systems are giving decoupled energy ๐ they split the state change event notification from the end user or client notification. the mail system handles the first part, and specialized systems (like the ones that handle presence) handle the second. this is architecturally cleaner because the mail system only needs to support one extra protocol (for talking to the notification system) instead of a bunch of notification delivery protocols, and it doesn't have to keep track of which clients and which users care about which events ๐ง it also means notifications can be made for any service, not just email โจ the tradeoff is that it needs a new service (the notification system), and the mail system has to support an additional protocol (to communicate with that notification system) ๐
on top of any external notification mechanisms, Sieve can also be used for notifications [SIEVE-NOTIFY] ๐ since a lot of mail systems already support Sieve, this can be a pretty easy, quick deployment option for a useful form of notifications ๐ซถ
5.2. Server-to-Server Notifications Scope
for the Lemonade work, server-to-server notifications are scoped to communication between the mail system and the notification system (the third architectural type from Section 5.1) ๐ฆ talking between the notification system and the end user or devices (which might use SMS, WAP Push, instant messaging, etc.) is out of scope ๐ โโ๏ธ the scope also generally assumes a security relationship between the mail system and the notification system. so then the security relationship becomes the notification system's responsibility ๐ however, the specifics of security, trust relationships, and related issues depend on the specifics of both server-to-server notifications and the notification systems themselves ๐
Figure 3 shows the context of server-to-server notifications. only the left side is in scope for Lemonade ๐
+--------+ +--------+
New | |_ | SMS |
Message | Mail | \ |Gateway |
-------> |Server 1| \ __| |
+--------+ \ / +--------+
^ \ /
| \ / ^
| \ +--------------+ / | +--------+
+--------+ | \ | | / | | MWI |
Read | Voice | | -| Notification |/ | |Gateway |
Message | Mail |-------->| Server |------->| |
-------> | Server | | ^ __| |\ ^ | +--------+
+--------+ | | / |(out of scope)| \ | |
| |/ | | \| |
| / ^ +--------------+ ^ \ |
|/| | \ | |\|
+--------+ / | | \ | | \ +--------+
Mailbox | | /| | | \| | |\ | WAP |
Full | Mail |/ | | | ^ \ | | \| Push |
-------> |Server 2| | | | | |\| | |Gateway |
+--------+ | | | | | \ | +--------+
| | | | | |\|
| | | | | | \
| | | | | | |\ +--------+
| | | | | | | \| IM |
| | | | | | | |Gateway |
| | | | | | | | |
| | | | | | | +--------+
| | | | | | |
| | | | | | |
Server-to- OTHER
Server PROTOCOLS
Notifications (out of scope)
(in scope)
Figure 3: Scope of Server-to-Server Notifications
5.3. Basic Operation
the mail system sends state change event notifications to the notification system (which in turn might notify a client or end user) for events that happen in the end user's mailboxes โจ each one of these notifications, which refers to a single mailbox event, is called a state change event ๐
the state change event carries data about the mailbox event that happened. it describes the change, but it normally doesn't say how or whether the end user or client gets notified. this lets the end user's and client's notification preferences live only inside the notification server ๐
from the Lemonade viewpoint, out-of-IMAP (outband) notifications are usually only wanted when the client is not connected to the IMAP server (since inband notifications are used when there's an IMAP connection) ๐ง so it's helpful for the mail system to be able to tell the notification system when the user logs in or out, and which client they're using (when that info is available) ๐
when Sieve is used, the Sieve engine might have access to this info too ๐
a message is generated by the message store as a result of a state change event. this message may get delivered to the end user, to a client, or to an external notification server that might deliver an equivalent message to the user or a client ๐
within the Lemonade Profile (Figure 1), the event gets filtered by NF. so the Notification Filters logically decide which state change events cause a notification to the user or client ๐ฅ
notifications give a rich end user experience ๐ธ this might include conveying mailbox status, new message attributes, etc., to the user or client, even when the client isn't connected to the mail store โจ
notifications also allow for different Message Waiting Indicator (MWI) behaviors. for example, turning MWI indication off once all the messages in all the end user's mailboxes have been read (should such an unlikely thing occur in the real world) ๐
the payload of a notification might include a URL that refers to the message that caused the event, possibly using URLAUTH [URLAUTH] ๐
as state change events happen in the mail store, they get filtered, which means they're matched against client or user preferences. so a notification may or may not be generated for delivery to the user or client ๐
in the most general case, the mail system sends bulk state change events to an external notification server, and the notification server is the one that filters the events by matching them against the user's or client's preferences ๐ฆ
in the most mail-specific case, the mail system does the filtering itself, for example using Sieve ๐ซถ
5.4. Event Order
for the Lemonade Profile, event order is generally not important ๐ by including info like the modification sequence identifier (called a modseq or mod-sequence) [CONDSTORE] in notifications, the receiving client can quickly and easily figure out whether it has already processed the triggering event (for example, if a notification arrives out of order, or if the client has resynchronized since the event was generated) ๐ง โจ
for generic server-to-server notifications, order is likely to matter, and the mail system needs to provide notifications to the notification system in the order they occur ๐
5.5. Reliability
for the Lemonade Profile, lost or delayed notifications to the client are tolerated ๐คทโโ๏ธ a client can resynchronize its state (including the state reported by any missing events) when it next connects to the server ๐
for generic server-to-server notifications, it's assumed that the data in a state change event is important, so a high level of reliability is needed between the mail system and any external notification systems ๐
6. Security Considerations โจ
notification content (payload) needs to be protected against eavesdropping and alteration when it contains specific info from messages, such as the sender ๐จ this is serious, bestie ๐ญ
even when the content is trivial and doesn't contain privacy-sensitive info, guarding against denial-of-service attacks may still require authentication or verification of the notification sender ๐ก๏ธ
protocols that manipulate filters need mechanisms to protect against modification by unauthorized entities, and against disclosure to them too ๐ for example, a malicious entity might try to delete notifications the user wants, or try to flood the target device with notifications to rack up usage charges, or prevent normal use altogether ๐ค on top of that, the filters themselves might contain sensitive info or reveal interpersonal or inter-organizational relationships, as well as email addresses ๐
7. References โจ
7.1. Normative References
- [IMAP] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1", RFC 3501, March 2003. ๐
- [LEMONADE-PROFILE] Cridland, D., Ed., Melnikov, A., Ed., and S. Maes, Ed., "The Internet Email to Support Diverse Service Environments (Lemonade) Profile", RFC 5550, August 2009. ๐
7.2. Informative References ๐โจ
Okay, these are the background reads ๐๐ They're the context behind the whole spec, not the rules themselves, so here they are:
[BIFF] Gellens, R., "Simple New Mail Notification", RFC 4146,
August 2005.
[CONTEXT] Cridland, D. and C. King, "Contexts for IMAP4", RFC
5267, July 2008.
[CONDSTORE] Melnikov, A. and S. Hole, "IMAP Extension for
Conditional STORE Operation or Quick Flag Changes
Resynchronization", RFC 4551, June 2006.
[IMAP-SIEVE] Leiba, B., "Support for Sieve in Internet Message
Access Protocol (IMAP4)", Work in Progress, February
2008.
[MANAGE-SIEVE] Melnikov, A., Ed., and T. Martin, "A Protocol for
Remotely Managing Sieve Scripts", Work in Progress,
September 2008.
[MSGEVENT] Gellens, R. and C. Newman, "Internet Message Store
Events", RFC 5423, March 2009.
[IDLE] Leiba, B., "IMAP4 IDLE command", RFC 2177, June 1997.
[NOTIFY] Gulbrandsen, A., King, C., and A. Melnikov, "The IMAP
NOTIFY Extension", RFC 5465, February 2009.
[OMA-LEMONADE-ARCH]
Burger, E. and G. Parsons, "LEMONADE Architecture -
Supporting Open Mobile Alliance (OMA) Mobile Email
(MEM) Using Internet Mail", RFC 5442, March 2009.
[OMA-ME-RD] Open Mobile Alliance Mobile Email Requirement
Document, (Work in progress).
http://www.openmobilealliance.org/
[SIEVE] Guenther, P., Ed., and T. Showalter, Ed., "Sieve: An
Email Filtering Language", RFC 5228, January 2008.
[SIEVE-NOTIFY] Melnikov, A., Ed., Leiba, B., Ed., Segmuller, W., and
T. Martin, "Sieve Email Filtering: Extension for
Notifications", RFC 5435, January 2009.
[SIEVE-VARIABLES]
Homme, K., "Sieve Email Filtering: Variables
Extension", RFC 5229, January 2008.
[URLAUTH] Crispin, M., "Internet Message Access Protocol (IMAP)
- URLAUTH Extension", RFC 4467, May 2006.
8. Contributors ๐ซถ๐ธ
Okay, the credit where it's due moment ๐ซถ The original version of this doc (longer and more detailed, iykyk) was written by Stephane H. Maes and Ray Cromwell of Oracle Corporation. ๐
The current and original authors also want to thank everyone who brought key insight into notifications and filtering, plus everyone whose specs or docs got used here. The community is literally the best ๐ฅนโจ
The current and original authors want to thank the authors of the original "Server To Server Notification Protocol Requirements" work too. Some of their material made it into this doc, especially from Gev Decktor ๐๐
Author's Address ๐
Randall Gellens, Editor
QUALCOMM Incorporated
5775 Morehouse Drive
San Diego, CA 92121
USA
EMail: rg+ietf@qualcomm.com
๐ฆ where this page comes from
- ietf: rfc5551 2009-08
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms