aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-11-11 10:10:06 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-11-11 10:10:06 +0100
commitdc6d3af99aba4a81a2578cd10ccbc63603381ac5 (patch)
tree0d378a980e29c54b8ca2aa7731dd20c888259ea1 /modules
parentec9b656476d4af2784aea29b846bead85dc46e16 (diff)
downloadNix-dc6d3af99aba4a81a2578cd10ccbc63603381ac5.tar.gz
Nix-dc6d3af99aba4a81a2578cd10ccbc63603381ac5.tar.zst
Nix-dc6d3af99aba4a81a2578cd10ccbc63603381ac5.zip
Fix rspamc-dovecot deliver
Diffstat (limited to 'modules')
-rw-r--r--modules/private/mail/postfix.nix13
1 files changed, 11 insertions, 2 deletions
diff --git a/modules/private/mail/postfix.nix b/modules/private/mail/postfix.nix
index 1386f85..fcb0ce2 100644
--- a/modules/private/mail/postfix.nix
+++ b/modules/private/mail/postfix.nix
@@ -249,10 +249,19 @@
249 # its checks "per user" (milter is not yet dispatched to 249 # its checks "per user" (milter is not yet dispatched to
250 # users), so we wrap dovecot-lda inside rspamc per recipient 250 # users), so we wrap dovecot-lda inside rspamc per recipient
251 # here. 251 # here.
252 dovecot_exe = "${pkgs.dovecot}/libexec/dovecot/dovecot-lda -f \${sender} -a \${original_recipient} -d \${user}@\${nexthop}"; 252 rspamc_dovecot = pkgs.writeScriptBin "rspamc_dovecot" ''
253 #! ${pkgs.stdenv.shell}
254 sender="$1"
255 original_recipient="$2"
256 user="$3"
257
258 ${pkgs.coreutils}/bin/cat - | \
259 (${pkgs.rspamd}/bin/rspamc -h ${config.myServices.mail.rspamd.sockets.worker-controller} -c bayes -d "$user" --mime || true) | \
260 ${pkgs.dovecot}/libexec/dovecot/dovecot-lda -f "$sender" -a "$original_recipient" -d "$user"
261 '';
253 in [ 262 in [
254 "flags=DRhu" "user=vhost:vhost" 263 "flags=DRhu" "user=vhost:vhost"
255 "argv=${pkgs.rspamd}/bin/rspamc -h ${config.myServices.mail.rspamd.sockets.worker-controller} -c bayes -d \${user}@\${nexthop} --mime --exec {${dovecot_exe}}" 264 "argv=${rspamc_dovecot}/bin/rspamc_dovecot \${sender} \${original_recipient} \${user}@\${nexthop}"
256 ]; 265 ];
257 }; 266 };
258 }; 267 };