From: Don Armstrong Date: Wed, 18 May 2016 17:21:07 +0000 (-0700) Subject: the spam check was inverted X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2b3024cfe6b4d7bd035fb28835c22529ef74b9e9;p=bin.git the spam check was inverted --- diff --git a/learn_from_spam b/learn_from_spam index 4bc770c..35a25f6 100755 --- a/learn_from_spam +++ b/learn_from_spam @@ -21,8 +21,8 @@ if [ "$(basename $0)" = "learn_from_spam" ]; then 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 - if ! $SPAM_CHECK < "$file" >/dev/null 2>&1; then + # check to see if it's still ham + if $SPAM_CHECK < "$file" >/dev/null 2>&1; then mkdir -p "${NEEDS_SPAM_RULES}/cur"; TMP="$(mktemp -d)" trap "rm -f '$TMP'/file; rmdir '$TMP'" EXIT @@ -39,7 +39,7 @@ elif [ "$(basename $0)" = "learn_from_ham" ]; then for file in "$@"; do $HAM_REPORT < "$file" >/dev/null 2>&1; formail -c < "$file" |grep -e '^From ' -e 'From: ' -e 'To: ' -e 'Cc: '|spamassassin --add-to-whitelist >/dev/null 2>&1; - if $SPAM_CHECK < "$file" >/dev/null 2>&1; then + if ! $SPAM_CHECK < "$file" >/dev/null 2>&1; then mkdir -p "${NEEDS_HAM_RULES}/cur"; TMP="$(mktemp -d)" trap "rm -f '$TMP'/file; rmdir '$TMP'" EXIT