From bb346e294fc8fc795746693b6f3bf16ce5530007 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Tue, 24 Oct 2023 18:53:06 +0100 Subject: [PATCH] email: handle junk mails better --- applications/email.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/applications/email.nix b/applications/email.nix index 924d7ec..05ee8d0 100644 --- a/applications/email.nix +++ b/applications/email.nix @@ -111,7 +111,12 @@ with lib; let address :domain ["To"] "skynet.ie" ){ if address :matches ["To"] "*@skynet.ie" { - fileinto :create "''${1}"; + if header :is "X-Spam" "Yes" { + fileinto :create "''${1}.Junk"; + stop; + } else { + fileinto :create "''${1}"; + } } } '';