[exim] Adding delay on *failure* of condition - impossible?

Pàgina inicial
Delete this message
Reply to this message
Autor: Eli
Data:  
A: exim-users
Assumpte: [exim] Adding delay on *failure* of condition - impossible?
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


I figured everything would be cool, run my test and notice it instead delays
when a *valid* user is given (and I realized why, since delay triggers if
condition returns a true result, not false). So then I tried figuring out
where I could put the delay and have it trigger if "endpass" caused a deny,
rather than an accept. From what I read/tried, I don't think it's possible
- is it?

If not, I guess my only option is to rework that "accept" and turn it in to
a "deny" so I can use the delay. I haven't tested this new ACL code yet,
but I'm assuming it's virtually identical, no? It denys if the user is
unknown (and does a delay now), and if it's not an unknown user, hits the
next ACL statement and accepts the user if it's in my "treat_as_local" list.

 deny    message     = No such account <${local_part}@${domain}>
         domains     = !+treat_as_local
         condition   = ${lookup {${local_part}@${domain}} dbmnz
{/etc/exim.acct.db} {${if eq {$value}{1} {yes}{no}}}}
         delay       = ${eval:$rcpt_fail_count * 5}s
 accept  domains     = +treat_as_local


I'm sure I'll answer that last question on my own in a second when I test it
out - just wanted to know really if it's at all possible to use delay with
endpass and have it do the delay on the failure of the condition. I tried
using !delay, but Exim didn't like that :)

Any options other than rewriting the ACL code in to the latter code?

Eli.