- # check to see if it's still spam
- 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
- # this message is still not spam; may need custom rules
- spamc < "$file" > "$TMP/file" 2>/dev/null;
- mv "$TMP/file" "${NEEDS_SPAM_RULES}/cur/$(basename "$file")";
- trap - EXIT;
- rmdir "$TMP";
+ # check to see if it's still ham
+ if $SPAM_CHECK < "$file" >/dev/null 2>&1; then
+ run_through_spamc "${NEEDS_SPAM_RULES}/cur" "$file";