Re: [exim] Exim filters: converting strings to numbers?

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Adam Funk
Fecha:  
A: exim-users
Asunto: Re: [exim] Exim filters: converting strings to numbers?
On 2006-11-23, Magnus Holmgren <holmgren@???> wrote:

> ("This variable is special; it is saved with the message, and written to
> Exim's spool file. This means that it can be used during the whole life of>
> the message on your Exim system, in particular, in routers or transports
> during the later delivery phase.") Then your condition becomes:
>
> $spam_score_int is above 95


I liked that idea, but I checked with my hosting company and
SpamAssassin is run on a different machine so that variable isn't
available to my filter.


> Otherwise you might be able to create an integer with the substr
> operator/item:


OK, so a number in an Exim filter is necessarily an integer. (I
suspected this but wasn't sure.)

As it turns out, I've noticed that messages with a positive spam score
have another with a string of int(score) plus-signs:

X-Blackcat-Spam-Score: 5.9
X-Blackcat-Spam-Level: +++++

So if I want to write a condition equivalent to "score >= 4" I can say

$h_X-Blackcat-Spam-Level begins "++++"

and that will match
X-Blackcat-Spam-Level: ++++
and
X-Blackcat-Spam-Level: +++++
but not
X-Blackcat-Spam-Level: +++

right?