This documentation is for Dovecot v2.x, see wiki1 for v1.x documentation.
Differences between revisions 10 and 11
Revision 10 as of 2017-09-20 13:14:58
Size: 1291
Editor: TimoSirainen
Comment:
Revision 11 as of 2017-09-20 13:26:14
Size: 1387
Editor: TimoSirainen
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
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>. 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]] for how to configure dict.
Line 10: Line 10:
dict {
  notify_status = driver:args
}
plugin {
  notify_status_dict = <dict uri> # For example proxy::notify_status
Line 14: Line 13:
# optional
service dict {
  unix_listener dict {
     #group = vmail
     # or
     #mode = 0777
  }
}
  # Value written to dict:
  #notify_status_value = {"messages":%%{messages},"unseen":%%{unseen}}
Line 23: Line 16:
plugin {
 notify_status_dict = proxy::notify_status
 # if you want some other syntax, available keys are username, mailbox, messages and unseen
 #notify_status_value = {"messages":%%{messages},"unseen":%%{unseen}}
 # limit mailboxes that are updated, most common is probably setting this to INBOX
 #notify_status_mailbox = pattern1
 # you can specify additional patterns
 #notify_status_mailbox2 = pattern2/*
 #...
  # By default all mailboxes are added to dict. This can be limited with:
  #notify_status_mailbox = INBOX
  #notify_status_mailbox2 = pattern2/*
  #...
Line 35: Line 23:
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
  }
}
}}}
Line 37: Line 39:

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

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 for how to configure dict.

Configuration

mail_plugins = $mail_plugins notify notify_status

plugin {
  notify_status_dict = <dict uri> # For example proxy::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
  }
}

Supported fields

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

  • 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

None: Plugins/NotifyStatus (last edited 2019-05-08 11:22:46 by TimoSirainen)