[exim] In-line Exim filter with regex

Top Page
Delete this message
Reply to this message
Author: John Horne
Date:  
To: Exim users
Subject: [exim] In-line Exim filter with regex
Hello,

Using Exim 4.51 I have a redirect router which specifies an in-line Exim
filter:

==========================================================
data = # Exim filter\n\
       logfile /var/log/exim/reject.log\n\
       if ${quote:$h_X-Spam-Status:} matches "\\Nscore=(\\d+)\\N"then\n\
             logwrite "$tod_log $message_id Blackholed by spam dump:
score is $1"\n\                         (this is all one line)
       else\n\
             logwrite "$tod_log $message_id Blackholed by spam dump"\n\
       endif\n\
       seen finish
==========================================================


However, I just cannot get the if statement to 'match' with the score.
The header line would look like: X-Spam-Status: score=12.5
So I would like to print out '... spam dump: score is 12'.

I've been playing with this for a while now and getting nowhere :-
( Either the 'match' doesn't match or I get log errors about:

error in filter data: unexpected "(" in line 3 of filter file

I've tried using '\N', with and without quotes and a regex without both
quotes and '\N', but nothing seems to work.


Any suggestions?


Thanks,

John.

-- 
---------------------------------------------------------------
John Horne, University of Plymouth, UK  Tel: +44 (0)1752 233914
E-mail: John.Horne@???       Fax: +44 (0)1752 233839