Re: [Exim] need help with a condition

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Nico Erfurth
Fecha:  
A: Christian Frömmel, exim
Asunto: Re: [Exim] need help with a condition
Christian Frömmel wrote:
> Hello,
>
> 2 days ago I posted a config for a mail-mirroring-cluster. Now (the time I
> test this config) the condition in one router always fails to expand.
>
> I am not able to see where the error is (and I see $, { and } everwhere in
> my office since I look at the conditions for 2h ;-).
>
> I want to do:
>  if (($message_age < 300) && (exists(/var/lock/MASTER))) ||
>     ((!$h_X-delayed:) && !(exists(/var/lock/MASTER)))

>
> with this condition.
>
> condition = "${if or\
>                       {\
>                           ${if and\
>                                 {\
>                                        { < {$message_age}{300}}\
>                                        {exists {/var/lock/MASTER}}\
>                                 }\
>                           }\
>                       }\
>                       {\

                  ^^^^^^^^<--- exim execpts a condition here

>                           ${if and\
>                                 {\
>                                        {def:$h_X-delayed:{0}{1}}\
>                                        {exists {/var/lock/MASTER}{0}{1}}\
>                                 }\
>                           }\
>                       }\
>                    }"


Nice one ;))

try this condition:

${if or {\
        { and\
            {\
                { < {$message_age}{300}}\
                { exists {/var/lock/MASTER}}\
            }\
        }\
        { and\
            {\
                {!def:h_X-delayed:}\
                {!exists {/var/lock/MASTER}}\
            }\
        }\
        }{1}{0}\
    }


1.) you forgot to yield a result
2.) you used ${if inside of a "or" group, ONLY pure conditions are
allowed here

Sometimes the exim-expansion can be VERY confusing ;)

ciao