From 74fcc1a37a4930f0b34ed483f477d74bcb2dff95 Mon Sep 17 00:00:00 2001 From: main Date: Mon, 28 Nov 2022 00:38:21 +0100 Subject: [PATCH] Email changes, enable sieve in Dovecot Signed-off-by: main --- containers/dovecot.nix | 20 ++++++++++++++++++++ containers/getmail/default.nix | 1 - 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/containers/dovecot.nix b/containers/dovecot.nix index 8fedc18..6ad5980 100644 --- a/containers/dovecot.nix +++ b/containers/dovecot.nix @@ -25,7 +25,27 @@ nglib.makeSystem { mail_location = "maildir:/maildir/%u"; protocol."imap" = { }; + protocol."lmtp" = { + mail_plugins = [ "sieve" ]; + }; + plugin."" = { + sieve = pkgs.writeText "filter.sieve" '' + require "variables"; + require "fileinto"; + + if header :matches "X-MAILBOX" "*" { + set "DESIRED_MAILBOX" "''${0}"; + } + + fileinto "''${DESIRED_MAILBOX}"; + ''; + }; + + mail_plugin_dir = pkgs.symlinkJoin { + name = "dovecot-modules"; + paths = map (pkg: "${pkg}/lib/dovecot") ([ pkgs.dovecot pkgs.dovecot_pigeonhole ]); + }; # Optimizations: # dotlock_use_excl = true; diff --git a/containers/getmail/default.nix b/containers/getmail/default.nix index b84e54b..3eee631 100644 --- a/containers/getmail/default.nix +++ b/containers/getmail/default.nix @@ -64,7 +64,6 @@ nglib.makeSystem { '' export PATH=${with pkgs; lib.makeBinPath [ busybox runit bash getmail6-fixed maildrop-fixed ]}:${pkgs.opensmtpd}/libexec/opensmtpd:$PATH - chown vmail:vmail -R /getmail.d set -m