From 37f0ace36b0b4f54db131845e44ea2ffb001b388 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Tue, 4 Mar 2014 10:44:07 -0800 Subject: [PATCH] add add to blacklist and remove from whitelist to learn_from_spam --- learn_from_spam | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/learn_from_spam b/learn_from_spam index 7a9ac93..7d7c7fa 100755 --- a/learn_from_spam +++ b/learn_from_spam @@ -13,7 +13,8 @@ SPAM_CHECK="spamc -c" if [ "$(basename $0)" = "learn_from_spam" ]; then for file in "$@"; do $SPAM_REPORT < "$file" >/dev/null 2>&1; - formail -c < "$file" | grep -e '^From ' -e 'From: ' | spamassassin -R >/dev/null 2>&1; + 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 # this message is still not spam; may need custom rules @@ -23,7 +24,7 @@ if [ "$(basename $0)" = "learn_from_spam" ]; then 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 -W >/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 mkdir -p ~/Maildir/spam/needs_ham_rules/cur; spamc < "$file" > ~/Maildir/spam/needs_ham_rules/cur/"$(basename "$file")" 2>/dev/null; -- 2.39.2