[Mimedefang] Remove existing tag from Subject:

Mickey Hill mickey at mickeyhill.com
Mon Dec 6 13:08:06 EST 2010


On Dec 6, 2010, at 9:24 AM, Jason Bertoch wrote:
> Does anyone have filter code they're willing to share that removes any existing
> "*****SPAM*****" tag in the Subject: header?


This matches my subject lines like Subject: Free Shipping [SPAM: ***** (5.961)]

Adjust to match your own.

sub filter_end {
    ...

    if ($Subject =~ /\[SPAM:.*\]/) {
        $Subject =~ s/\s*\[SPAM:.*?\]//;
        action_change_header("Subject", "$Subject");
    }


--
Mickey Hill <mickey at mickeyhill.com>




More information about the MIMEDefang mailing list