3 # these are for non-spamc setups
4 SPAM_REPORT="spamassassin --report"
5 HAM_REPORT="spamassassin --revoke"
6 SPAM_CHECK="spamassassin -e"
9 SPAM_REPORT="spamc --learntype=spam"
10 HAM_REPORT="spamc --learntype=ham"
13 if [ "$(basename $0)" = "learn_from_spam" ]; then
15 $SPAM_REPORT < "$file" >/dev/null;
16 grep -e '^From ' -e 'From: ' "$file" | spamassassin -R >/dev/null;
17 # check to see if it's still spam
18 if ! spam -c < "$file"; then
19 # this message is still not spam; may need custom rules
20 cp "$file" ~/Mail/spam/needs_rules/cur/;
23 elif [ "$(basename $0)" = "learn_from_ham" ]; then
25 $HAM_REPORT < "$file" >/dev/null;
26 grep -e '^From ' -e 'From: ' -e 'To: ' -e 'Cc: ' "$file"|spamassassin -W>/dev/null;
29 "Called in a way this script cannot recognize";