- $SPAM_REPORT < "$file" >/dev/null;
- grep -e '^From ' -e 'From: ' "$file" | spamassassin -R >/dev/null;
- # check to see if it's still spam
- if ! spam -c < "$file"; then
+ if ! formail -c < "$file"|grep -q '^List-Id'; then
+ $SPAM_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
+ 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