summaryrefslogtreecommitdiffstats
path: root/doc/wiki/Plugins.NotifyStatus.txt
blob: 2fbce167857b3c7d87a4b30c871d7b5b2f6ed8c3 (plain)
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
notify_status plugin (v2.2.33+)
===============================

This plugin updates a dict every time a mailbox changes. The status can contain
total message count and unseen count. It will update key priv/status/<mailbox
name>. See <Dictionary.txt> for how to configure dict.

Configuration
-------------

---%<-------------------------------------------------------------------------
mail_plugins = $mail_plugins notify notify_status

plugin {
  notify_status_dict = <dict uri> # For example proxy:dict-async:notify_status

  # Value written to dict:
  #notify_status_value = {"messages":%%{messages},"unseen":%%{unseen}}

  # By default all mailboxes are added to dict. This can be limited with:
  #notify_status_mailbox = INBOX
  #notify_status_mailbox2 = pattern2/*
  #...
}
---%<-------------------------------------------------------------------------

If SQL dict is used, you can use this map:

---%<-------------------------------------------------------------------------
map {
  pattern = priv/status/$box
  table = mailbox_status
  value_field = status
  username_field = username

  fields {
    mailbox = $box
  }
}
---%<-------------------------------------------------------------------------

The matching SQL schema is:

---%<-------------------------------------------------------------------------
CREATE TABLE mailbox_status (
  username VARCHAR(255) NOT NULL,
  mailbox VARCHAR(255) NOT NULL,
  status VARCHAR(255),
  PRIMARY KEY (username, mailbox)
);
---%<-------------------------------------------------------------------------

Supported fields
----------------

These fields can be used as %%{variables} in notify_status_value setting:

 * username - Username (user@domain)
 * mailbox - name of mailbox
 * messages - n. of messages
 * unseen - n. unseen message
 * recent - n. recent messages (not accurate)
 * uidvalidity - current UID validity
 * uidnext - predicted next UID value
 * first_recent_uid - first recent UID
 * highest_modseq - higest modification sequence number
 * highest_pvt_modseq - highest private modification sequence number

(This file was created from the wiki on 2019-06-19 12:42)