[Exim] comparaison in filter

Página Inicial
Delete this message
Reply to this message
Autor: edouard.boucher
Data:  
Para: exim-users
Assunto: [Exim] comparaison in filter
hi,

i have a filter working like this :

if ${extract{spamicity}{${sg{$h_X-Bogosity:}{,}{}}}{$value}{0}} is above 0.9
then
#msg is spam
else
# msg is ham


( i run bogofilter thru a local_scan() )

when ${extract{spamicity}{${sg{$h_X-Bogosity:}{,}{}}}{$value}{0}} doesnt
expend to a number, this filter will produce an error.
i know this is very unlikely to happend, but i think about some situation where
it can.

is there a way to check that a string expend to a particular type ?
(ok, i can do a match againt /[0-9]+(\.[0-9]*)?/ but quite ugly)
if not, would it be a good idea that all the comparaison in filter operation
works ternary like in SQL : true, false, NULL (NULL when the comparaison is
inaplicable (ie. number >= string)) ?

Also, if the filter doesnt allow the user to declare some variable,
is this because of a lack of time or is it on purpose ?

And last think : for my filter to work whith floating numbers, i had to change
get_number() in filter.c, i was gonna propose this very simple patch, but i saw
in the archive that they was allready a tread about this. So at the end, will
floating point number be supported by exim in filters, or do i have to use my
patch ?


thanks for your help


edouard

--