summaryrefslogtreecommitdiff
path: root/hosts/surtr/email
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-05-05 19:18:05 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2022-05-05 19:18:05 +0200
commit5102bbd24db669a01fa060f05794b9aa609dd670 (patch)
tree2a7e3c62b864fa6c7e93ea3611a408f9ab3a4e4b /hosts/surtr/email
parent958406e36f6940cd04e51753b3148be8cc913f4f (diff)
downloadnixos-5102bbd24db669a01fa060f05794b9aa609dd670.tar
nixos-5102bbd24db669a01fa060f05794b9aa609dd670.tar.gz
nixos-5102bbd24db669a01fa060f05794b9aa609dd670.tar.bz2
nixos-5102bbd24db669a01fa060f05794b9aa609dd670.tar.xz
nixos-5102bbd24db669a01fa060f05794b9aa609dd670.zip
...
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"