]> git.donarmstrong.com Git - bin.git/blobdiff - learn_from_spam
add mutt alias which executes neomutt if that exists
[bin.git] / learn_from_spam
index 2535f8c2a8aab57fa2e9f5a246ec20c36cb23607..63cb9f8789b1fa4f32934bb2942ce6d97c490a76 100755 (executable)
@@ -6,8 +6,8 @@ HAM_REPORT="spamassassin --revoke"
 SPAM_CHECK="spamassassin -e"
 
 # these are for spamc
-SPAM_REPORT="spamc --learntype=spam"
-HAM_REPORT="spamc --learntype=ham"
+SPAM_REPORT="spamc --learntype=spam -s $((100 * 1024 * 1024))"
+HAM_REPORT="spamc --learntype=ham -s $((100 * 1024 * 1024))"
 SPAM_CHECK="spamc -s $((100 * 1024 * 1024)) -c"
 
 # needs rules directories
@@ -18,7 +18,9 @@ if [ "$(basename $0)" = "learn_from_spam" ]; then
     for file in "$@"; do
         if ! formail -c < "$file"|grep -q '^List-Id'; then
             $SPAM_REPORT < "$file" >/dev/null 2>&1;
-        fi;
+        else
+            spamasssin --local --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 ham