Howto: Disallow Sieve Script Creation by UCS

Howto

By default, UCS creates sieve scripts for users. Additionally OX creates it’s own sieve script when the user logs in to OX the first time.

This might cause confusions.

Solution

To disallow UCS to create sieve scripts use the ucr variable:

ucr set mail/dovecot/sieve/spam=no
systemctl restart univention-directory-listener

Note: To let OX create default scripts a bug is pending.

Workaround helps, to create the sieve/Open-Xchange.sieve if OX been using, 
the dovecot.py will be under on UCS 5.0-x

/usr/lib/python3/dist-packages/univention/mail/dovecot.py


def upload_activate_sieve_script(self, email, file): 
               try: 
                       master_name, master_pw = self.get_masteruser_credentials() 
                       ca_file = self.listener.configRegistry.get("mail/dovecot/sieve/client/cafile", "/etc/univention/ssl/ucsCA/CAcert.pem") 
                       fqdn = "%s.%s" % (self.listener.configRegistry['hostname'], self.listener.configRegistry['domainname']) 
                       fqdn = self.listener.configRegistry.get("mail/dovecot/sieve/client/server", fqdn) 
                       _cmd = [ 
                               "sieve-connect", "--user", "%s*%s" % (email, master_name), 
                               "--server", fqdn, 
                               "--noclearauth", "--noclearchan", 
                               "--tlscafile", ca_file, 
-                               "--remotesieve", "default"]
+                               "--remotesieve", "Open-Xchange"]

After the dovecot.py is modifed, restart the service

systemctl restart univention-directory-listener.service
1 Like
Mastodon