diff --git a/modoboa_installer/scripts/dovecot.py b/modoboa_installer/scripts/dovecot.py index 02fece5..ca2f9cb 100644 --- a/modoboa_installer/scripts/dovecot.py +++ b/modoboa_installer/scripts/dovecot.py @@ -78,7 +78,7 @@ class Dovecot(base.Installer): def get_template_context(self): """Additional variables.""" - context = super(Dovecot, self).get_template_context() + context = super().get_template_context() pw_mailbox = pwd.getpwnam(self.mailboxes_owner) dovecot_package = {"deb": "dovecot-core", "rpm": "dovecot"} ssl_protocol_parameter = "ssl_protocols" @@ -120,7 +120,8 @@ class Dovecot(base.Installer): "ssl_protocols": ssl_protocols, "ssl_protocol_parameter": ssl_protocol_parameter, "modoboa_2_2_or_greater": "" if self.modoboa_2_2_or_greater else "#", - "not_modoboa_2_2_or_greater": "" if not self.modoboa_2_2_or_greater else "#" + "not_modoboa_2_2_or_greater": "" if not self.modoboa_2_2_or_greater else "#", + "do_move_spam_to_junk": "" if self.app_config["move_spam_to_junk"] else "#" }) return context diff --git a/modoboa_installer/scripts/files/dovecot/conf.d/90-sieve.conf.tpl b/modoboa_installer/scripts/files/dovecot/conf.d/90-sieve.conf.tpl index dd76330..480d2c2 100644 --- a/modoboa_installer/scripts/files/dovecot/conf.d/90-sieve.conf.tpl +++ b/modoboa_installer/scripts/files/dovecot/conf.d/90-sieve.conf.tpl @@ -38,7 +38,7 @@ plugin { # Identical to sieve_before, only the specified scripts are executed after the # user's script (only when keep is still in effect!). Multiple script file or # directory paths can be specified by appending an increasing number. - {%dovecot_enabled}sieve_after = /etc/dovecot/conf.d/custom_after_sieve + %{do_move_spam_to_junk}sieve_after = /etc/dovecot/conf.d/custom_after_sieve #sieve_after2 = #sieve_after2 = (etc...)