File: event-notifications.rst.txt

package info (click to toggle)
cyrus-imapd 3.6.1-4%2Bdeb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 80,688 kB
  • sloc: ansic: 255,928; perl: 97,730; javascript: 9,266; sh: 5,537; yacc: 2,651; cpp: 2,128; makefile: 2,099; lex: 660; xml: 621; python: 388; awk: 303; asm: 262
file content (380 lines) | stat: -rw-r--r-- 10,736 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
.. _imap-features-event-notifications:

===================
Event Notifications
===================

:rfc:`5423` standardizes the emission of message store event
notifications, and :rfc:`5465` outlines the IMAP NOTIFY extensions.

.. versionadded:: 2.5.0

Available Event Notifications
=============================

* Message Events
    *   :ref:`imap-features-event-notifications-messageappend`
    *   :ref:`imap-features-event-notifications-messagecopy`
    *   :ref:`imap-features-event-notifications-messageexpire`
    *   :ref:`imap-features-event-notifications-messageexpunge`
    *   :ref:`imap-features-event-notifications-messagemove`
    *   :ref:`imap-features-event-notifications-messagenew`
* Flag Events
    *   :ref:`imap-features-event-notifications-flagsclear`
    *   :ref:`imap-features-event-notifications-flagsset`
    *   :ref:`imap-features-event-notifications-messageread`
    *   :ref:`imap-features-event-notifications-messagetrash`
* Mailbox Events
    *   :ref:`imap-features-event-notifications-aclchange`
    *   :ref:`imap-features-event-notifications-mailboxcreate`
    *   :ref:`imap-features-event-notifications-mailboxdelete`
    *   :ref:`imap-features-event-notifications-mailboxrename`
* Subscription Events
    *   :ref:`imap-features-event-notifications-mailboxsubscribe`
    *   :ref:`imap-features-event-notifications-mailboxunsubscribe`
* Quota Events
    *   :ref:`imap-features-event-notifications-quotaexceed`
    *   :ref:`imap-features-event-notifications-quotawithin`
    *   :ref:`imap-features-event-notifications-quotachange`
* Calendar Events
    *   :ref:`imap-features-event-notifications-calendaralarm`
* Access Accounting
    *   :ref:`imap-features-event-notifications-login`
    *   :ref:`imap-features-event-notifications-logout`
* Apple Push
    *   :ref:`imap-features-event-notifications-applepushservice`


Example Event Notifications
===========================

.. _imap-features-event-notifications-aclchange:

AclChange
---------

The ACL Change notification is emitted when a command ``SETACL`` is
issued.

.. NOTE::

    This event notification is added to Cyrus IMAP outside of any RFC.

.. literalinclude:: ../../../_static/event_notifications/AclChange.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-flagsclear:

FlagsClear
----------

The FlagsClear notification is emitted when all flags are removed from a
message.

This includes ``\Deleted``, ``\Seen`` and ``\Flagged``, and as such are,
in part, the counter-parts to
:ref:`imap-features-event-notifications-messagetrash`,
:ref:`imap-features-event-notifications-messageread`, and
:ref:`imap-features-event-notifications-flagsset`.

.. TODO::

    *   Include an example event notification emitted for multiple
        messages being cleared the flags of.

    *   Include an example event notification emitted for multiple flags
        being cleared.

.. literalinclude:: ../../../_static/event_notifications/FlagsClear.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-flagsset:

FlagsSet
--------

The FlagsSet notification is emitted when flags are set on a message,
but not including the ``\Deleted`` and ``\Seen`` flags, which emit
:ref:`imap-features-event-notifications-messagetrash` and
:ref:`imap-features-event-notifications-messageread` event notifications
respectively.

.. TODO::

    *   Include an example event notification emitted for multiple
        messages being set flags on.

    *   Include an example event notification emitted for multiple flags
        being set.

.. literalinclude:: ../../../_static/event_notifications/FlagsSet.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-login:

Login
-----

.. literalinclude:: ../../../_static/event_notifications/Login.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-logout:

Logout
------

.. literalinclude:: ../../../_static/event_notifications/Logout.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-mailboxcreate:

MailboxCreate
-------------

.. literalinclude:: ../../../_static/event_notifications/MailboxCreate.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-mailboxdelete:

MailboxDelete
-------------

.. NOTE::

    A mailbox deletion event notification is issued once for each top-
    level mailbox in a hierarchy being deleted.

..
    Mar 10 13:59:36 kolab notifyd[18204]: EVENT, , , ,  "{"event":"MailboxDelete","timestamp":"2015-03-10T13:59:36.279+01:00","service":"imaps","mailboxID":"imap://jane.doe@example.org@kolab.example.org/INBOX;UIDVALIDITY=1425991710","uri":"imap://jane.doe@example.org@kolab.example.org/INBOX;UIDVALIDITY=1425991710","pid":18210,"user":"cyrus-admin","vnd.cmu.sessionId":"kolab.example.org-18210-1425992375-1-10616182148387168471"}"

.. literalinclude:: ../../../_static/event_notifications/MailboxDelete.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-mailboxrename:

MailboxRename
-------------

.. literalinclude:: ../../../_static/event_notifications/MailboxRename.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-mailboxsubscribe:

MailboxSubscribe
----------------

.. literalinclude:: ../../../_static/event_notifications/MailboxSubscribe.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-mailboxunsubscribe:

MailboxUnSubscribe
------------------

.. literalinclude:: ../../../_static/event_notifications/MailboxUnSubscribe.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-messageappend:

MessageAppend
-------------

.. literalinclude:: ../../../_static/event_notifications/MessageAppend.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-messagecopy:

MessageCopy
-----------

.. literalinclude:: ../../../_static/event_notifications/MessageCopy.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-messageexpire:

MessageExpire
-------------

.. _imap-features-event-notifications-messageexpunge:

MessageExpunge
--------------

.. literalinclude:: ../../../_static/event_notifications/MessageExpunge.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-messagemove:

MessageMove
-----------

.. IMPORTANT::

    The ``MessageMove`` event is an event type not documented in an RFC.

.. literalinclude:: ../../../_static/event_notifications/MessageMove.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-messagenew:

MessageNew
----------

.. literalinclude:: ../../../_static/event_notifications/MessageNew.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-messageread:

MessageRead
-----------

.. literalinclude:: ../../../_static/event_notifications/MessageRead.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-messagetrash:

MessageTrash
------------

.. literalinclude:: ../../../_static/event_notifications/MessageTrash.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-quotachange:

QuotaChange
-----------

.. NOTE::

    This event may be followed by a
    :ref:`imap-features-event-notifications-quotawithin` event
    notification, if the quota change leads the quota root to allow more
    resources than currently in use.

.. literalinclude:: ../../../_static/event_notifications/QuotaChange.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-quotaexceed:

QuotaExceed
-----------

The ``user`` parameter in the event notification is the user to whom the
quota applies, that is being exceeded, otherwise known as the owner of
the :ref:`imap-features-namespaces-personal`.

.. NOTE::

    Quota being exceeded on shared folders cannot include an "owner" for
    the quota root.

.. literalinclude:: ../../../_static/event_notifications/QuotaExceed.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-quotawithin:

QuotaWithin
-----------

The ``QuotaWithin`` event typically follows a
:ref:`imap-features-event-notifications-mailboxdelete` [#]_,
:ref:`imap-features-event-notifications-messageexpunge` [#]_,
:ref:`imap-features-event-notifications-messagemove` [#]_, or
:ref:`imap-features-event-notifications-quotachange` [#]_.

.. literalinclude:: ../../../_static/event_notifications/QuotaWithin.json
    :language: json
    :linenos:

.. rubric:: Footnotes for QuotaWithin

.. [#]

    A ``QuotaWithin`` event follows a ``MailboxDelete`` event if the
    mailbox deleted resides inside a quota root, and lowers the
    resources used to below the existing quota thresholds.

.. [#]

    A ``QuotaWithin`` event follows a ``MessageExpunge`` event if the
    messages purged reside inside a quota root, and amount to a number
    or size that lowers the amount of resources used to below the
    existing quota thresholds.

.. [#]

    A ``QuotaWithin`` event follows a ``MessageMove`` event if the
    source folder of the messages moved resides inside a quota root, and
    the target folder to which the messages have been moved does not
    reside within the same quota root, and the number or size of the
    messages moves lowers the amount of resources used in the quota root
    for the source folder of the messages to below the existing
    quota thresholds.

.. [#]

    A ``QuotaWithin`` event follows a ``QuotaChange`` event if the quota
    change raised the threshold on the amount of resources used within
    the quota root to a level higher than the existing amount of
    resources used.

.. _imap-features-event-notifications-calendaralarm:

CalendarAlarm
-------------

The ``CalendarAlarm`` event occurs when a calendar event triggers an
alarm.

.. literalinclude:: ../../../_static/event_notifications/CalendarAlarm.json
    :language: json
    :linenos:

.. _imap-features-event-notifications-applepushservice:

ApplePushService
----------------

While Cyrus supports the Apple Push Service, Apple has only licensed Apple Push
for mail to a couple of large mail providers: Fastmail and Yahoo. If you own an
OS X Server license, you also get a key for personal use. But it's not
a supported option for third party developers at this time.

The ``ApplePushService`` event occurs when

.. literalinclude:: ../../../_static/event_notifications/ApplePushService.json
    :language: json
    :linenos:

apsVersion
    Version of the Apple Push Service this message is compliant with.

apsAccountId
    Service Provider's accountID with the Apple Push Service.

apsDeviceToken
    Unique identifier for the user's device registered with Apple.

apsSubtopic
    TODO: describe this

Back to :ref:`imap-features`