redo report for spam messages before sticking into the needs rules directory
if [ "$(basename $0)" = "learn_from_spam" ]; then
for file in "$@"; do
$SPAM_REPORT < "$file" >/dev/null;
if [ "$(basename $0)" = "learn_from_spam" ]; then
for file in "$@"; do
$SPAM_REPORT < "$file" >/dev/null;
- grep -e '^From ' -e 'From: ' "$file" | spamassassin -R >/dev/null;
+ formail -c < "$file" | grep -e '^From ' -e 'From: ' | spamassassin -R >/dev/null;
# check to see if it's still spam
# check to see if it's still spam
- if ! spamc -c < "$file"; then
+ if ! spamc -c < "$file" >/dev/null; then
# this message is still not spam; may need custom rules
# this message is still not spam; may need custom rules
- cp "$file" ~/Maildir/spam/needs_rules/cur/;
+ spamc "$file" > ~/Maildir/spam/needs_rules/cur/"$(basename "$file")";
fi;
done;
elif [ "$(basename $0)" = "learn_from_ham" ]; then
for file in "$@"; do
$HAM_REPORT < "$file" >/dev/null;
fi;
done;
elif [ "$(basename $0)" = "learn_from_ham" ]; then
for file in "$@"; do
$HAM_REPORT < "$file" >/dev/null;
- grep -e '^From ' -e 'From: ' -e 'To: ' -e 'Cc: ' "$file"|spamassassin -W>/dev/null;
+ formail -c < "$file" |grep -e '^From ' -e 'From: ' -e 'To: ' -e 'Cc: '|spamassassin -W>/dev/null;
done;
else
"Called in a way this script cannot recognize";
done;
else
"Called in a way this script cannot recognize";