summaryrefslogtreecommitdiff
path: root/hosts/surtr/email
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/surtr/email')
-rw-r--r--hosts/surtr/email/default.nix22
1 files changed, 15 insertions, 7 deletions
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 {
344 344
345 plugin { 345 plugin {
346 sieve_redirect_envelope_from = orig_recipient 346 sieve_redirect_envelope_from = orig_recipient
347 sieve_before = ${compileSieve "tag-junk.sieve" '' 347 sieve_before = /etc/dovecot/sieve_before.d
348 require ["imap4flags"];
349
350 if header :contains "X-Spam-Flag" "YES" {
351 addflag ["\\Junk"];
352 }
353 ''}
354 } 348 }
355 ''; 349 '';
356 }; 350 };
357 351
352 environment.etc."dovecot/sieve_before.d/tag-junk.sieve".text = ''
353 require ["imap4flags"];
354
355 if header :contains "X-Spam-Flag" "YES" {
356 addflag ["\\Junk"];
357 }
358 '';
359
358 security.dhparams = { 360 security.dhparams = {
359 params = { 361 params = {
360 "postfix-512".bits = 512; 362 "postfix-512".bits = 512;
@@ -381,6 +383,12 @@ in {
381 }; 383 };
382 384
383 systemd.services.dovecot2 = { 385 systemd.services.dovecot2 = {
386 preStart = ''
387 for f in /etc/dovecot/sieve_before.d/*.sieve; do
388 sievec $f
389 done
390 '';
391
384 serviceConfig = { 392 serviceConfig = {
385 LoadCredential = [ 393 LoadCredential = [
386 "surtr.yggdrasil.li.key.pem:${config.security.acme.certs."surtr.yggdrasil.li".directory}/key.pem" 394 "surtr.yggdrasil.li.key.pem:${config.security.acme.certs."surtr.yggdrasil.li".directory}/key.pem"