]> git.donarmstrong.com Git - bin.git/commitdiff
don't report mail if it has a list id; this is because spamcop sometimes doesn't...
authorDon Armstrong <don@donarmstrong.com>
Wed, 19 Mar 2014 23:21:01 +0000 (16:21 -0700)
committerDon Armstrong <don@donarmstrong.com>
Wed, 19 Mar 2014 23:21:01 +0000 (16:21 -0700)
learn_from_spam

index 7d7c7fae24b97850a52277200ce7455ece41ae12..306b227c4e13975c49efc4bde800dda786910f22 100755 (executable)
@@ -12,7 +12,9 @@ SPAM_CHECK="spamc -c"
 
 if [ "$(basename $0)" = "learn_from_spam" ]; then
     for file in "$@"; do
-        $SPAM_REPORT < "$file" >/dev/null 2>&1;
+        if ! formail -c < "$file"|grep -q '^List-Id'; then
+            $SPAM_REPORT < "$file" >/dev/null 2>&1;
+        fi;
         formail -c < "$file" | grep -e '^From ' -e 'From: ' | spamassassin --add-to-blacklist >/dev/null 2>&1;
         formail -c < "$file" | grep -e '^From ' -e 'From: ' | spamassassin --remove-from-whitelist >/dev/null 2>&1;
         # check to see if it's still spam