Block mail by subject content with MCP

Steen, Glenn Glenn.Steen at AP1.SE
Wed Dec 15 14:57:46 GMT 2004


    [ The following text is in the "iso-8859-1" character set. ]
    [ Your display is set for the "US-ASCII" character set.  ]
    [ Some characters may be displayed incorrectly. ]

> -----Original Message-----
> From: MailScanner mailing list 
> [mailto:MAILSCANNER at JISCMAIL.AC.UK] On Behalf Of José Angel 
> Blanco González
> Sent: den 15 december 2004 15:51
> To: MAILSCANNER at JISCMAIL.AC.UK
> Subject: Block mail by subject content with MCP
> 
> 
> I am trying to block mails based on subject with MCP
> I modified a 10_example.cf
> 
(snip)
> header   SAMPLE_RULE5  Subject =~ /Delivery Status 
> Notification (Failure)/i
> describe SAMPLE_RULE5    Banned Subject
> score    SAMPLE_RULE5    11
(snip)
> but is not working, here is a extract of header from a message:
> 
> Message-ID: <mucVFckA10001b25e at URANO.sc.com>
> Subject: Delivery Status Notification (Failure)
> X-Treelogic-MailScanner: Found to be clean, Found to be clean
> X-MailScanner-MCPCheck: MCP-Clean, MCP-Checker (puntaje=0, 
> requerido 1)
> X-Treelogic-MailScanner-SpamCheck: no es spam, SpamAssassin (punta...
> 
Problem is with the RE above. In perl the "unescaped ()" are special so
you need escape them like:
header   SAMPLE_RULE5  Subject =~ /Delivery Status Notification \(Failure\)/i
... else it'll look for "Delivery Status Notification Failure" and, if found,
will assign "Failure" to $1 ... Probably not what you want:-)

-- Glenn

------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the MAQ (http://www.mailscanner.biz/maq/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).

Support MailScanner development - buy the book off the website!




More information about the MailScanner mailing list