From 4b8669b2fe87ea05a7648cbc826588b7815ff492 Mon Sep 17 00:00:00 2001 From: Robin Raymond Date: Wed, 13 Sep 2017 13:06:44 +0200 Subject: [PATCH] include junk sieve script --- mail-server/dovecot.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mail-server/dovecot.nix b/mail-server/dovecot.nix index fc525c8..6c54ca8 100644 --- a/mail-server/dovecot.nix +++ b/mail-server/dovecot.nix @@ -38,8 +38,23 @@ in sslServerKey = keyPath; enableLmtp = true; modules = [ pkgs.dovecot_pigeonhole ]; + protocols = [ "sieve" ]; + + sieveScripts = { + before = builtins.toFile "spam.sieve" + '' + require "fileinto"; + + if header :is "X-Spam" "Yes" { + fileinto "Junk"; + stop; + } + ''; + }; + extraConfig = '' #Extra Config + #mail_debug = yes mail_access_groups = ${vmailGroupName} ssl = required @@ -51,6 +66,10 @@ in } } + protocol lmtp { + mail_plugins = $mail_plugins sieve + } + service auth { unix_listener /var/lib/postfix/queue/private/auth { mode = 0660