]> git.donarmstrong.com Git - bin.git/commitdiff
the spam check was inverted
authorDon Armstrong <don@donarmstrong.com>
Wed, 18 May 2016 17:21:07 +0000 (10:21 -0700)
committerDon Armstrong <don@donarmstrong.com>
Wed, 18 May 2016 17:21:07 +0000 (10:21 -0700)
learn_from_spam

index 4bc770c7e067b26a119387f05f8a97b89058a96b..35a25f6f5fb5214cd99796b90a8ecd68b6034d9b 100755 (executable)
@@ -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