Re: [Exim] Multi-condition ACL statement in a macro possible…

Pàgina inicial
Delete this message
Reply to this message
Autor: Robert Kehl
Data:  
A: Pat Lashley, exim-users
Assumpte: Re: [Exim] Multi-condition ACL statement in a macro possible?
----- Original Message -----
From: "Pat Lashley" <patl+cyrus@???>
Sent: Saturday, September 13, 2003 8:01 AM
Subject: [Exim] Multi-condition ACL statement in a macro possible?


> warn message = X-Test: YES
> condition = ${if {$h_subject}{macro test}{yes}{no}}
>
> No matter what combination of \ and \n I try, it seems to always
> make the condition part of the X-Test header's value. Or an "unknown
> ACL condition/modifier" error message.


This is the intended behaviour IMHO. A macro simply substitutes it's
name through it's exact contents. An example - you define a multiline
macro using \ like this:

MYMACRO=warn message = X-Test: YES \
condition = ${if {$h_subject}{macro test}{yes}{no}}

In your acl you might have:

MYMACRO
log_message = mymacro triggered.

After macro substitution, it will become:

warn message = X-Test: YES \
condition = ${if {$h_subject}{macro test}{yes}{no}}
log_message = mymacro triggered.

The \ won't be touched, it appears in the result as it appears in the
macro. To get around this, define each line as a single macro and omit
the \ like shown below:

MYMACRO1=warn message = X-Test: YES
MYMACRO2=condition = ${if {$h_subject}{macro test}{yes}{no}}

acl:
MYMACRO1
MYMACRO2
log_message = mymacro triggered.

This yields:
warn message = X-Test: YES
condition = ${if {$h_subject}{macro test}{yes}{no}}
log_message = mymacro triggered.

Bingo. But now you have two macros for one condition instead of one,
that's not nice, but I don't know of a way to overcome this.

hth,

Robert Kehl