aboutsummaryrefslogtreecommitdiff
path: root/mailfilter.dot.link
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2022-03-12 13:42:32 -0300
committerSilvio Rhatto <rhatto@riseup.net>2022-03-12 13:42:32 -0300
commit264e8aec9a7665e3ce299c823070f5cd9e04e10b (patch)
tree13880b70be9cc159430f94f956d48f687b534877 /mailfilter.dot.link
parent8da68e6cba09e5695bccdadf783d996267551923 (diff)
downloadmail-264e8aec9a7665e3ce299c823070f5cd9e04e10b.tar.gz
mail-264e8aec9a7665e3ce299c823070f5cd9e04e10b.tar.bz2
Migration from procmail to maildrop
Diffstat (limited to 'mailfilter.dot.link')
-rw-r--r--mailfilter.dot.link61
1 files changed, 59 insertions, 2 deletions
diff --git a/mailfilter.dot.link b/mailfilter.dot.link
index 7e80347..48c9c93 100644
--- a/mailfilter.dot.link
+++ b/mailfilter.dot.link
@@ -2,16 +2,73 @@
# Maildrop rules
#
# See http://www.wonkity.com/~wblock/docs/html/maildrop.html
+# https://github.com/QMailToaster/maildrop/blob/master/mailfilter
+# https://we.riseup.net/debian/maildrop
#
# regex flags, used after the regex: /something/:b
# :h - header
# :b - body
# :D - distinguish between upper and lower case (default is to ignore case)
+#
+# Basic parameters
+#
+
TYPE="maildir"
-DEFAULT="$HOME/mail/INBOX"
+BASE="$HOME/mail"
+DEFAULT="$BASE/INBOX"
+
+#
+# Logging
+#
logfile "$HOME/temp/log/maildrop"
+#
# Custom recipes
-include $HOME/.custom/mailfilter
+#
+
+# Test for a custom maildrop configuration
+`test -r $HOME/.custom/mailfilter`
+
+# Includes an existing maildrop configuration
+if ($RETURNCODE == 0)
+{
+ log "Including $HOME/.custom/mailfilter"
+ exception {
+ include $HOME/.custom/mailfilter
+ }
+}
+
+#
+# SPAM handling
+#
+
+# Send mail through bogofilter
+xfilter "/usr/bin/bogofilter -uep"
+
+# Put mail bogofilter deems as spam in spam folder
+if (/^X-Bogosity: Spam, tests=bogofilter/)
+ to $BASE/INBOX.Trash
+
+# Put mail bogofilter deems as unsure in spam folder
+#if (/^X-Bogosity: Unsure, tests=bogofilter/)
+# to $BASE/INBOX.Trash
+
+if (/^X-Spam-Level: \*\*\*\*\*\*/)
+ to $BASE/INBOX.Trash
+
+if (/^X-Spam-Flag: YES/)
+ to $BASE/INBOX.Trash
+
+if (/^Subject:.*(SPAM)/)
+ to $BASE/INBOX.Trash
+
+if (/^X-Bogosity:.*Yes/)
+ to $BASE/INBOX.Trash
+
+if (/^Subject:.*\*\*\*SPAM\*\*\*/)
+ to $BASE/INBOX.Trash
+
+if (/^X-Bogosity: Spam.*/)
+ to $BASE/INBOX.Trash