Skip to content

Change the Subject: header of messages not going through antispam filter

Published on: October 29, 2006 | Last modified on: August 19, 2011

Here is my maildrop rule to change the subject of any message delivered without being filtered by my antispam filter (I use dspam but this can be easily adapted to any other mail filter):

1
2
3
4
5
6
7
if (!/^X-DSPAM-Signature:/:hD)
{
   exception {
        SUBJ=`reformail -x 'Subject:'`
        xfilter 'reformail -A "Subject: [NOT FILTERED] $SUBJ"'
   }
}

As I use dspam to connect to clamd to scan for infected messages, this can be used especially on Windows environment to warn the end-user that the message can potentially be infected by a virus.