Re: [exim] condition check in router with a space in the hea…

Góra strony
Delete this message
Reply to this message
Autor: Andreas Metzler
Data:  
Dla: exim-users
Temat: Re: [exim] condition check in router with a space in the header
Marco Kammerer <marco.kammerer@???> wrote:
> I want to ask in a router if the Spam Flag is set to YES


> condition = ${if def:h_X-Spam-FLAG: YES {1}{0}}


> http://www.exim.org/exim-html-3.30/doc/html/filter_33.html


Consulting the documentation for 3.30 if you are using 4.63 is not
necessarily a good thing. ;-)

> tells that it hat to be terminated with : if no whitespaces follow, but does
> not tell how to get the above working.


With def:... you can check *existence* of a header.

> if it remove modify it to
> condition = ${if def:h_X-Spam-FLAG: {1}{0}}
> it is working, but i want to ask in the router for YES and also for NO


> I use exim 4.63.


This should work:
condition = ${if eqi{$h_X-Spam-FLAG:}{yes}{true}{false}}
cu andreas

-- 
The 'Galactic Cleaning' policy undertaken by Emperor Zhark is a personal
vision of the emperor's, and its inclusion in this work does not constitute
tacit approval by the author or the publisher for any such projects,
howsoever undertaken.                                (c) Jasper Ffforde