From 3be2bc7caa2a524a2e2f713af304b4b9647db34a Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 22 Feb 2017 15:21:15 +0100 Subject: Potential to log email --- ymir.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ymir.nix b/ymir.nix index 5dfa265e..3f4fd496 100644 --- a/ymir.nix +++ b/ymir.nix @@ -504,6 +504,17 @@ in rec { mlmmj unix - n n - - pipe flags=ORhu user=mlmmj argv=${pkgs.mlmmj}/bin/mlmmj-receive -F -L /var/spool/lists/''${user} mlmmj-subs unix - n n - - pipe flags=ORhu user=mlmmj argv=${pkgs.mlmmj-exposed}/bin/mlmmj-exposed /var/spool/lists/''${user} ''${extension} policy-spf unix - n n - - spawn user=nobody argv=${pkgs.pythonPackages.pypolicyd-spf}/bin/policyd-spf ${./ymir/spf.conf} + logEmail unix - n n - 10 pipe flags=Rq user=postfix null_sender= argv=${pkgs.writeScript "logEmail" '' + #!${pkgs.stdenv.shell} + + mailFile=/tmp/logEmail/$(date +"%F-%H%M%S").$$ + + mkdir -p -m 700 /tmp/logEmail + + cat >$mailFile + + sendmail -G -i "$@" <$mailFile + ''} -f ''${sender} -- ''${recipient} ''; networks = ["127.0.0.0/8" "[::ffff:127.0.0.0]/104" "[::1]/128" "10.141.0.0/16"]; }; -- cgit v1.2.3