Skip to content

Commit

Permalink
Made 90-sieve a template
Browse files Browse the repository at this point in the history
  • Loading branch information
Spitfireap committed Jan 12, 2024
1 parent dbae2b2 commit bf80ad4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modoboa_installer/scripts/dovecot.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class Dovecot(base.Installer):
}
config_files = [
"dovecot.conf", "dovecot-dict-sql.conf.ext", "conf.d/10-ssl.conf",
"conf.d/10-master.conf", "conf.d/20-lmtp.conf", "conf.d/10-ssl-keys.try"]
"conf.d/10-master.conf", "conf.d/20-lmtp.conf",
"conf.d/10-ssl-keys.try", "conf.d/90-sieve.conf"]
with_user = True

def setup_user(self):
Expand All @@ -41,8 +42,7 @@ def get_config_files(self):
_config_files = self.config_files

if self.app_config["move_spam_to_junk"]:
_config_files += ["conf.d/90-sieve.conf",
"conf.d/custom_after_sieve/spam-to-junk.sieve"]
_config_files += ["conf.d/custom_after_sieve/spam-to-junk.sieve"]

return _config_files + [
"dovecot-sql-{}.conf.ext=dovecot-sql.conf.ext"
Expand Down Expand Up @@ -136,7 +136,7 @@ def post_run(self):
# See https://github.com/modoboa/modoboa/issues/2157.
if self.app_config["move_spam_to_junk"]:
# Compile sieve script
sieve_file = "/etc/dovecot/conf.d/custom_after_sieve/spam-to-junk.sieve"
sieve_file = f"{self.config_dir}/conf.d/custom_after_sieve/spam-to-junk.sieve"
utils.exec_cmd(f"/usr/bin/sievec {sieve_file}")
system.add_user_to_group(self.mailboxes_owner, 'dovecot')

Expand Down

0 comments on commit bf80ad4

Please sign in to comment.