Re: [exim] Adding delay on *failure* of condition - impossib…

Pàgina inicial
Delete this message
Reply to this message
Autor: exim-users
Data:  
A: exim-users
Assumpte: Re: [exim] Adding delay on *failure* of condition - impossible?
Eli schrieb:

> I was trying to add delays based on the number of invalid recipients given
> in an SMTP transaction, and came to this section in my RCPT ACL:
>
>  accept  domains     = +treat_as_local
>          endpass
>          message     = No such account <${local_part}@${domain}>
>          condition   = ${lookup {${local_part}@${domain}} dbmnz
> {/etc/exim.acct.db} {${if eq {$value}{1} {yes}{no}}}}

>
> So without thinking I just tacked on this to the end after my "condition":
>
>          delay       = ${eval:$rcpt_fail_count * 5}s


Hi Eli,

you'll have to rewrite your test like this:

warn
   domains     = +treat_as_local
   set acl_m0  = 1
   condition   = ${lookup {${local_part}@${domain}} dbmnz \
                     {/etc/exim.acct.db} {${if eq {$value}{1} \
                     {no}{yes}}}}
   set acl_m0  = 0
   delay       = ${eval:$rcpt_fail_count * 5}s


accept
   domains     = +treat_as_local
   endpass
   condition   = $acl_m0
   message     = No such account <${local_part}@${domain}>


I hope I haven't twisted any logic. But I guess, you get the trick. Pull
the condition into a separate warn statement, where you delay if the
check fails. Remember the result of the check in a acl variable and use
that variable as your condition in the accept statement.

HTH,
Patrick