From eef422a6bee2fa1bfcdda781fe9ce33851f1768b Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Sun, 27 Oct 2024 00:31:39 -0700 Subject: [PATCH] Add label-by-heuristics sieve, fix typo in readme name --- projects/email-sieve/{README.me => README.md} | 0 .../email-sieve/label-by-heuristics.sieve | 31 +++++++++++++++++++ 2 files changed, 31 insertions(+) rename projects/email-sieve/{README.me => README.md} (100%) create mode 100644 projects/email-sieve/label-by-heuristics.sieve diff --git a/projects/email-sieve/README.me b/projects/email-sieve/README.md similarity index 100% rename from projects/email-sieve/README.me rename to projects/email-sieve/README.md diff --git a/projects/email-sieve/label-by-heuristics.sieve b/projects/email-sieve/label-by-heuristics.sieve new file mode 100644 index 00000000..6cac098f --- /dev/null +++ b/projects/email-sieve/label-by-heuristics.sieve @@ -0,0 +1,31 @@ +require ["fileinto", "include", "environment", "variables", "relational", "comparator-i;ascii-numeric", "spamtest", "regex", "imap4flags", "date"]; + +# Generated: Do not run this script on spam messages +if allof ( + environment :matches "vnd.proton.spam-threshold" "*", + spamtest :value "ge" :comparator "i;ascii-numeric" "${1}" +) { return; } + +if anyof( + address :comparator "i;unicode-casemap" :contains "From" ["bennyr.cloud", "maddiecrawfo13@gmail.com", "ccmychart.org", "o.sofi.org", "noreply@jafner.net"], + allof( + address :domain :comparator "i;unicode-casemap" :is "From" ["notify.cloudflare.com"], + header :comparator "i;unicode-casemap" :contains "Subject" ["Certificate Transparency Notification", "Your Cloudflare Invoice is Available"] + ), + allof( + address :domain :comparator "i;unicode-casemap" :is "From" ["privacy.com"], + header :comparator "i;unicode-casemap" :contains "Subject" ["Transaction decline notification"] + ), + allof( + address :domain :comparator "i;unicode-casemap" :is "From" ["amazon.com"], + header :comparator "i;unicode-casemap" :contains "Subject" ["Delivered:"] + ), + allof( + address :domain :comparator "i;unicode-casemap" :is "From" ["digitalocean.com"], + header :comparator "i;unicode-casemap" :matches "Subject" ["Your * invoice is available"] + ) +) { fileinto :copy "Important"; return; } +elsif anyof( + header :comparator "i;unicode-casemap" :contains "Subject" ["Confirmation", "Receipt", "Your subscription", "Your order", "Password reset", "Your appointment", "Verification code", "Your account"] +) { fileinto :copy "Maybe Important"; return; } +else { return; }