From: Don Armstrong Date: Wed, 19 Mar 2014 23:21:01 +0000 (-0700) Subject: don't report mail if it has a list id; this is because spamcop sometimes doesn't... X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=43d0af53391d4d3f11c1329a2117bb0ccf03261a;p=bin.git don't report mail if it has a list id; this is because spamcop sometimes doesn't properly handle spam forwarded by lists --- diff --git a/learn_from_spam b/learn_from_spam index 7d7c7fa..306b227 100755 --- a/learn_from_spam +++ b/learn_from_spam @@ -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