Re: [Exim] simple conditional logwrite

Pàgina inicial
Delete this message
Reply to this message
Autor: Richard.Hall
Data:  
A: exim-users
Assumpte: Re: [Exim] simple conditional logwrite
Thomas,

On Thu, 29 Jan 2004, Thomas Baumann wrote:

> Hello list,
>
> i want to use different logentries within the acl_check_content.
>
> When I use
>
> warn logwrite = ## acl_check_content no spam [$spam_score_int]
>      condition = ${if <{$spam_score_int}{55}{1}{0}}

>
> warn logwrite = ## acl_check_content is spam [$spam_score_int]
>      condition = ${if >{$spam_score_int}{55}{1}{0}}

>
> I got always 2 logentries like
> 2004-01-29 13:18:07 1AmB7S-0008Lk-Ud ## acl_check_content no spam [2]
> 2004-01-29 13:18:07 1AmB7S-0008Lk-Ud ## acl_check_content is spam [2]
>
> But I either want the first (when spam_score_int < 55) or the last
> (when spam_score_int >= 55).


logwrite "writes a message to a log file as soon as it is encountered when
processing an ACL." So either put the condition before the logwrite, as in

  warn condition = ${if <{$spam_score_int}{55}{1}{0}}
       logwrite = ## acl_check_content no spam [$spam_score_int]


  warn condition = ${if >{$spam_score_int}{55}{1}{0}}
       logwrite = ## acl_check_content is spam [$spam_score_int]


or use log_message instead of logwrite. The choice depends on your exact
requirements - consult the spec for full details.

HTH,
Richard Hall