#!/bin/bash # these are for non-spamc setups SPAM_REPORT="spamassassin --report" HAM_REPORT="spamassassin --revoke" SPAM_CHECK="spamassassin -e" # these are for spamc SPAM_REPORT="spamc --learntype=spam" HAM_REPORT="spamc --learntype=ham" SPAM_CHECK="spamc -c" for file in "$@"; do spamc < "$file" |sponge "$file" 2>/dev/null; done;