Search K
Appearance
Appearance
sieve-zimbra-compat
) Plugin Note
The sieve-zimbra-compat plugin is not distributed as part of the base Dovecot Pro package. This plugin requires separate licensing to use. Contact Open-Xchange Support for further information.
Sieve (RFC 5228) is a highly extensible machine language specifically tailored for internet message filtering.
This package extends Dovecot's Sieve support for the vendor-specific Sieve language extensions as used by the Zimbra implementation of Sieve.
The goal of this plugin is to provide sufficient compatibility to be able to run typical Sieve scripts originally written for Zimbra deployments.
Support for the following extensions is added by this plugin:
The following extensions are not fully implemented and will cause runtime errors when the associated tests are evaluated while executing the Sieve script:
A warning is produced at compile time to indicate that this may happen.
sieve_zimbra_addressbook_dict
Default | [None] |
---|---|
Value | string |
The URI for the dict lookup. This should normally point to the dict proxy, so that asynchronous batch lookups are possible.
sieve_zimbra_bare_extensions
Default | [None] |
---|---|
Value | string |
A space-separated list of all the Zimbra extensions that are made available without the prefix.
Note that this hides any standard extension with the same name as one of Zimbra extensions; e.g., the "date" extension will become the Zimbra version once the "date" extension is listed in this setting.
sieve_zimbra_notify_as_redirect
Default | no |
---|---|
Value | boolean |
If enabled, executes the "vnd.zimbra.notify" action as a "redirect" action.
sieve_zimbra_notify_envelope_from
Default | sieve_notify_mailto_envelope_from or postmaster |
---|---|
Value | string |
Specifies what envelope sender address is used for notification emails. The following values are supported for this setting:
Value | Description |
---|---|
sender |
The sender address is used. |
recipient |
The final recipient address is used. |
orig_recipient |
The original recipient is used. |
user_email |
The user's primary address is used. This is configured with sieve_user_email . If that setting is not configured, user_mail is equal to recipient . |
postmaster |
The postmaster_address configured for the LDA. |
<user@domain> |
Notifications are always sent from user@domain. The angle brackets are mandatory. The null ("<>") address is also supported. |
The "From" header is based on this setting as well. When the envelope sender of the processed message is the null address "<>", the envelope sender of the notification is also always "<>", irrespective of what is configured for this setting.
The Zimbra extensions are not enabled by default and thus need to be enabled explicitly, which means that these extensions need to be added to sieve_extensions
.
The Zimbra Sieve implementation is based on jSieve. For jSieve, the use of the "require" command is entirely optional. You will likely encounter scripts created by Zimbra that omit some of the extensions in the require line. Therefore, it is recommended to put all used Zimbra extensions in sieve_implicit_extensions
, rather than sieve_extensions
, so that the "require" command does not need to be used for those extensions.
The "vnd.zimbra." prefix of these extension names is a Dovecot addition. This prevents these extensions from interfering with some of the standard extensions that have the same name. Unfortunately, Sieve scripts that were written for/by Zimbra use these extensions without the "vnd.zimbra." prefix. To be able to use such scripts, you need to use the sieve_zimbra_bare_extensions
setting.
The "vnd.zimbra.addressbook" extension needs additional configuration.
This test yields "true" when any of the addresses contained in the indicated headers is in the user's addressbook. This means that this test needs access to that addressbook. This access is provided by means of a Dovecot dict lookup. See sieve_zimbra_addressbook_dict
.
Example Configuration:
dict {
# Sieve Zimbra addressbook in mysql
addressbook = mysql:/etc/dovecot/sieve-zimbra-addressbook.conf.ext
}
plugin {
sieve_zimbra_addressbook_dict = proxy::addressbook
}
# The mysql database connection params
connect = host=localhost dbname=contacts user=sieve password=frop
# The name mapping that yields the ID of the Sieve script
map {
pattern = priv/sieve/zimbra/addressbook/$sender
table = user_contacts
username_field = username
value_field = id
fields {
sender = $sender
}
}
CREATE DATABASE contacts;
USE contacts;
CREATE TABLE user_contacts (
username VARCHAR(1024),
sender VARCHAR(1024),
id INTEGER PRIMARY KEY AUTO_INCREMENT,
contactid INTEGER,
UNIQUE KEY (username(767), sender(767))
);
The "vnd.zimbra.notify" extension has additional configuration.
This action sends a notification email to the indicated recipient. See sieve_zimbra_notify_envelope_from
for configuration details.
Example:
plugin {
sieve_zimbra_notify_envelope_from = recipient
}
The "vnd.zimbra.notify" extension can be configured such that the "notify" action is executed as a "redirect" when the full message is used as the notification.
The purpose of this is having the ability to forward a complex multipart message as a means of notification. This is not a standard Zimbra feature.
This feature is only enabled when sieve_zimbra_notify_as_redirect = yes
. Furthermore, the following conditions need to be met for a "notify" action to be executed as a "redirect":
Example:
plugin {
sieve_zimbra_notify_as_redirect = yes
}
require "vnd.zimbra.notify";
# If the message has an "X-Redirect" or and "X-Notify-Forward" header and
# no "X-Notify-No-Forward", the message is redirected to frop@example.com.
# Otherwise, a normal notification message is sent.
notify "frop@example.com" "Frop!" "BODY: ${BODY}";
Note
This plugin requires the sieve plugin to be active.
plugin {
sieve = ~/.dovecot.sieve
sieve_plugins = sieve_zimbra_compat
sieve_implicit_extensions = +vnd.zimbra.body +vnd.zimbra.bulk \
+vnd.zimbra.date +vnd.zimbra.flag +vnd.zimbra.invite +vnd.zimbra.me \
+vnd.zimbra.tag
sieve_zimbra_bare_extensions = body bulk date flag invite me tag
}