Re: [exim] Regex Matching In ACL

Top Pagina
Delete this message
Reply to this message
Auteur: Jasen Betts
Datum:  
Aan: exim-users
Onderwerp: Re: [exim] Regex Matching In ACL
On 2013-07-12, Pete Long <pete@???> wrote:
> This is a cryptographically signed message in MIME format.
>
> --===============3436826819943659557==
> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms090509070703040301080401"
>
> This is a cryptographically signed message in MIME format.
>
> --------------ms090509070703040301080401
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Content-Transfer-Encoding: quoted-printable
>
> Hello,
>
> I wonder if anyone can point me in the right direction regarding how to=20
> match a subject line using 'if match'.
>
> Here is my ACL, set to 'warn' for the time being until I understand=20
> where I'm going wrong.
>
>
> warn
>        condition =3D ${if match{$h_subject:}{^tester.*}{yes}{no}}
>        add_header =3D X-Test: Matched something.
>        log_message =3D Matched something.

>
>
> The only time I can get a match is if I use {.*} as the regex which=20
> appears to match everything. My ultimate goal is to match two names=20
> commonly used in the subject lines of a particular spammer and to reject =
>
> at SMTP time also showing the winning match string somewhere in the=20
> headers/logs.
>
> I've read that 'if match' conditions don't need to be encased in \N \N=20
> but even when I do I never get a match.
>
> Here's what I would ideally like to use as a regex:
>
> {(i?)*.spammer.person\$}
>
> Right now, to me that means a match for 'hi i'm spammer person' or 'Hi I =
> am Spammer pErson' but I guess I'm way wrong.


I think you want this:

{(?i)i.*spammer.person\$}

or this

{(?i)spammer.person\$}

--
⚂⚃ 100% natural