[exim] Clarification On PCRE Syntax In .Forward

Top Page
Delete this message
Reply to this message
Author: Telly Williams
Date:  
To: Exim Users
Subject: [exim] Clarification On PCRE Syntax In .Forward
Hi,

    Problem: Can't seem to get the PCRE syntax correct for my forward 
file.


    Tried: Google, doc/filter.txt, doc/pcrepattern.txt.


    I think I'm close on this one, but, I must be missing something.  
What I want to happen is that when a certain email comes in containing the 
$h_subject: Monthly Utilities, it needs to pipe a perl script.  If I "contain" 
the $h_subject, it works, but I need to match it.  So I've been trying all sorts 
of REGEX/PCRE combos, but to no avail, like:


    $h_subject: matches \N\s*[Mm]onthly\s*[Uu]tilities\s*\N
    $h_subject: matches "\\s*[Mm]onthly\\s*[Uu]tilities\\s*"
    $h_subject: matches "\\\\s*[Mm]onthly\\\\s*[Uu]tilities\\\\s*"


    The actual header looks like this (part of a large if statement):


    elif ("$h_from:" contains "xzy@xyz" and "$h_subject:" matches [one of above])
    then
        pipe...
        save...
        finish


    With the PCRE patterns, the email doesn't match at all and goes to the default 
mailbox.  My regexes are working in my pipe file no problem, so what am I not grasping 
about the syntax of the PCRE?  The manual (can't remember where) says that most of 
the time I'd need the circumflex.  I tried that and it didn't work.  Why do I need 
it?  I plan for spaces in the beginning of the header.  Also, I thought that I could 
write the pattern EXACTLY like I did in my perl script (syntax-wise) if I suppressed 
expansion with "\N".  My patterns work in pcretest, just not in the .forward file.  
Any other PCRE tutorials on the web?  Thanks for the help.

    
-- 
VR ~
    TW
    Email: twilliams001@???
    "Knowledge Is Power"