From 6390d090590b6212a1d3ccf2af9d25d98a10b522 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Tue, 29 Apr 2025 01:01:55 +0100 Subject: [PATCH] feat: all mail from our own internal mail gateway gets put into its own folder for everyone --- applications/email.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/applications/email.nix b/applications/email.nix index 2129de2..2341952 100644 --- a/applications/email.nix +++ b/applications/email.nix @@ -113,7 +113,11 @@ with lib; let address :domain ["To", "Cc"] "skynet.ie" ){ if address :matches ["To", "Cc"] "*@skynet.ie" { - if header :is "X-Spam" "Yes" { + # handle spam reports specifically for teh service accounts in each users inbox + if address :matches ["From"] "postmaster@mimi.skynet.ie" { + fileinto :create "''${1}.Spam_Report"; + stop; + } else if header :is "X-Spam" "Yes" { fileinto :create "''${1}.Junk"; stop; } else { @@ -122,6 +126,13 @@ with lib; let } } } + + # handle spam Reports for general users + if address :matches ["From"] "postmaster@mimi.skynet.ie" { + fileinto :create "INBOX..Spam_Report"; + stop; + } + if allof ( address :localpart ["From"] ["${toString create_config_to}"], address :domain ["From"] "skynet.ie"