Univention Bugzilla – Bug 38469
Default SIEVE script for Dovecot
Last modified: 2015-07-09 18:13:08 CEST
Put UCS default spam SIEVE script either into "sieve_default" or create (like currently for Cyrus) a script for each user. Depends on how the editing works: The content of the "default personal sieve script" might not be visible to users, so they cannot copy the spam-sorting-part.
Commit is in 60614. Default script is installed/modified by univention-dovecot-mkdefaultsieve.py, triggered by mail/antispam/requiredhits and mail/dovecot/folder/spam into /var/lib/dovecot/sieve/default.sieve. Upon access it will automatically be compiled into a binary when the script file is newer than the binary. Tested with Horde: users sees the default script and when editing or adding, it will be copied into their script, which will be used from that moment on - perfect. Must still be tested with OX.
Correction: In Horde the default script cannot be seen either. It's just that univention-mail-horde/conffiles/etc/horde/ingo/prefs.d/10-ucs.php installed a SIEVE script that looks exactly the same. OX ignores the default script and starts a new script from scratch. The user never sees the default script. With Cyrus and OX the same happens though, because automatic spam sorting with SIEVE is disabled: univention-mail-cyrus-ox/debian/univention-mail-cyrus-ox.postinst sets mail/cyrus/sieve/spam=no Options I see from here on: * leave as sieve_default script, leaving it up to Apps or users to deal with it, if they choose to modify their filters * install the same SIEVE script into each users sieve directory upon user creation * set the spam-sort-script as "sieve_before" script, that Dovecot will run before the users script. The user will not be able to see or to deactivate it. This is IMO what users expect. Make this a bool-UCRV for admins to deactivate it if they don't like it. They can already configure the target folder as well as the Spam-Level that will trigger sorting.
(In reply to Daniel Tröder from comment #2) > * install the same SIEVE script into each users sieve directory upon user > creation As discussed, we should stick to this variant and try to upload the script via SIEVE protocol if possible.
With r60815, the default SIEVE script will be installed into the users sieve directory upon mail-account creation. If a sieve folder exists already (user gets assigned an existing mailbox), nothing will be done.
The listener module does currently not react on mail/dovecot/sieve/spam=no. A default sieve script is always created regardless of the UCR settings. This has to be fixed.
Commit 61219 adds a UCRV mail/dovecot/sieve/spam to switch Sieve scipt generation for new users on/off.
Mail-Test found that folder "Spam" was created, but sieve tries to deliver to "INBOX/Spam". If sieve script target folder doesn't exist, mail will be delivered to INBOX.
Commit 61315 fixes the spam folder path in the default sieve script and makes sieve create it in case it doesn't exist. Dovecot would do that too, as the spam folder is also configured for autocreation in /etc/dovecot/conf.d/15-mailboxes.conf , but in the case it was reconfigured and dovecot was not yet reloaded (kind of a race condition) it'd still work.
Commit 61365 disables the "sieve_default" setting, as it was sorting spam even if disabled by mail/dovecot/sieve/spam.
(In reply to Daniel Tröder from comment #6) > Commit 61219 adds a UCRV mail/dovecot/sieve/spam to switch Sieve scipt > generation for new users on/off. Tested via 40_mail/31_sieve_script (In reply to Daniel Tröder from comment #7) > Mail-Test found that folder "Spam" was created, but sieve tries to deliver > to "INBOX/Spam". If sieve script target folder doesn't exist, mail will be > delivered to INBOX. Covered by 40_mail/31_sieve_script (In reply to Daniel Tröder from comment #8) > Commit 61315 fixes the spam folder path in the default sieve script and > makes sieve create it in case it doesn't exist. Dovecot would do that too, > as the spam folder is also configured for autocreation in > /etc/dovecot/conf.d/15-mailboxes.conf , but in the case it was reconfigured > and dovecot was not yet reloaded (kind of a race condition) it'd still work. OK (In reply to Daniel Tröder from comment #9) > Commit 61365 disables the "sieve_default" setting, as it was sorting spam > even if disabled by mail/dovecot/sieve/spam. OK VERIFIED
<http://errata.univention.de/ucs/4.0/237.html>