Re: [exim] Filter on plussign

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: John W. Baxter
Fecha:  
A: exim-users
Asunto: Re: [exim] Filter on plussign
On 4/21/2005 1:33, "Jakob Hirsch" <jh@???> wrote:

>>> if $header_x-spamscore: matches "+{5,}" then
>
> maybe you have to escape the + (has a special meaning in regex) with the
> backslash (\ or \\)...
> if not, you could change the character spamassassin puts there.


As said in another message: contains should work fine, and likely less
resource intensive (or perhaps Philip implemented contains with an RE). The
RE should be written as
\N\+{5,}\N

(Actually, the , is moot--and probably a slight waste of CPU cycles, since
you only care about "at least 5". With the , I think the RE engine will go
on and find the rest of the +s (although that might be optimized away since
there is nothing else following in the RE--but the optimization is not done
in zero CPU cycles either).

The \N pair shuts off Exim expansion of the text in between. The \+ says
look for +; without the \ plus says 1 or more of the prior "thing" (highly
technical term for "I forget the right term"), but there is no prior thing,
so it is an error. Without the \N pair you have to protect the \ from its
meaning in Exim expansions, which probably requires \\ (in some contexts it
requires \\\\). Thanks to \N, we've been able to stop trying to second
guess Exim.

exim -be

Is your friend when working with regular expressions (or other expansions
which are giving you trouble).

--John