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