Clean Spam
Views:
This is a simple little script for cleaning up spam. Get the message cleaned up so it looks like it's just come in on a mailrelay, then pass it to spamassassin so you can test your new rules.
ssed is used here, because I usually run this script on a mac. macs have bsd sed, not gnu sed and bsd sed is not all that super.
#!/bin/bash
ssed -i -e '/^X-Mozilla-Status/d;
/^X-SpamAssassin-Score/d;
/^X-SpamAssassin-SpamBar/d;
/^X-QM-SPAM-Warning/d;
/^X-Sieve/d' \
-e '/^Received: from mail[12]\.qmul\.ac\.uk .*/,+3d;
/^X-SpamAssassin-Report/,+3d;/^ \* /d;' \
$*
