From 5102bbd24db669a01fa060f05794b9aa609dd670 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 5 May 2022 19:18:05 +0200 Subject: ... --- hosts/surtr/email/default.nix | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'hosts/surtr') diff --git a/hosts/surtr/email/default.nix b/hosts/surtr/email/default.nix index eb403b0d..7c7bc7ff 100644 --- a/hosts/surtr/email/default.nix +++ b/hosts/surtr/email/default.nix @@ -344,17 +344,19 @@ in { plugin { sieve_redirect_envelope_from = orig_recipient - sieve_before = ${compileSieve "tag-junk.sieve" '' - require ["imap4flags"]; - - if header :contains "X-Spam-Flag" "YES" { - addflag ["\\Junk"]; - } - ''} + sieve_before = /etc/dovecot/sieve_before.d } ''; }; + environment.etc."dovecot/sieve_before.d/tag-junk.sieve".text = '' + require ["imap4flags"]; + + if header :contains "X-Spam-Flag" "YES" { + addflag ["\\Junk"]; + } + ''; + security.dhparams = { params = { "postfix-512".bits = 512; @@ -381,6 +383,12 @@ in { }; systemd.services.dovecot2 = { + preStart = '' + for f in /etc/dovecot/sieve_before.d/*.sieve; do + sievec $f + done + ''; + serviceConfig = { LoadCredential = [ "surtr.yggdrasil.li.key.pem:${config.security.acme.certs."surtr.yggdrasil.li".directory}/key.pem" -- cgit v1.2.3