#!/usr/bin/procmail PMDIR=${PMDIR:-$HOME/.etc/mailfilter/procmail} :0 * !PMVAR ?? . { # PMVAR is not defined, so we are being called as filter # thus source the standard defines INCLUDERC=$PMDIR/defines # prevent feeding back to procmail and delete the leading From line PROCMAIL='/bin/cat' # and tell the fucking procmail piece-of-shit to continue to be a filter DEFAULT='|$PROCMAIL' } # unpack SA report_safe mails :0 * B ?? ^Content-Type: message/rfc822; x-spam-type=original$ { LOG="cleanup: unpacking SA MIME-wrapped spam mail$NL" :0 fw |$SPAMASSASSIN -d } # remove other unwanted headers from all messages :0 fw |$FORMAIL -IX-Virus -IX-UID -IX-OfflineIMAP- -IX-Status -IStatus -IX-Keywords -IX-Greylist \ -IX-Spam -IX-CRM114 -IX-Auto -IX-Trained-As -IX-EqDomain -IX-EqTo -IX-Justme # now should be idempotent