]> gitweb.fluxo.info Git - rhatto/dotfiles/mail.git/commitdiff
Migration from procmail to maildrop
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 12 Mar 2022 16:42:32 +0000 (13:42 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 12 Mar 2022 16:42:32 +0000 (13:42 -0300)
mailfilter.dot.link
procmailrc.dot.link

index 7e80347c32651941814ca318d93a1e71e7d78233..48c9c9327592acb5bd7af9d13e9b8e0dfb431417 100644 (file)
@@ -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
index 333d753ff58ac96ffab07fe26953e27dff00da37..4a13d0fb4ddc09ef80c2e29e87692344321f4858 100644 (file)
@@ -49,7 +49,7 @@ INBOX.Trash/new
 #INBOX.Trash/new
 
 :0:
-*^X-Spam-Level: ******
+* ^X-Spam-Level: ******
 INBOX.Trash/new
 
 :0:
@@ -57,11 +57,19 @@ INBOX.Trash/new
 INBOX.Trash/new
 
 :0:
-*^Subject:.*(SPAM)
+* ^Subject:.*(SPAM)
 INBOX.Trash/new
 
 :0:
-*^X-Bogosity:.*Yes
+* ^X-Bogosity:.*Yes
+INBOX.Trash/new
+
+:0:
+*^Subject:.*(\*\*\*SPAM\*\*\*)
+INBOX.Trash/new
+
+:0:
+*^X-Bogosity: Spam.*
 INBOX.Trash/new
 
 ################################