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

Página Inicial
Delete this message
Reply to this message
Autor: Eli
Data:  
Para: 'Bill Hacker', exim-users
CC: 
Assunto: RE: [exim] Adding delay on *failure* of condition - impossible?
Bill wrote:
> Eli wrote:
>
> > 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?
>
> What happens if you simply add a "!" and invert the condition?
>
> http://www.exim.org/exim-html-4.40/doc/html/spec_toc.html#TOC129


Heh, I blame this on too much work (and not playing with Exim for a while)
;P That did it - can't believe I didn't think of that.

 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


Still, it's too bad I can't trigger delay on a false - using endpass was a
prettier piece of code and it made me feel a bit better at night knowing
that if for whatever reason a lookup failed, Exim would instead just not
accept the recipient - now with the quite naked accept after this deny,
should the deny suffer any baddies, the accept will take the recipient when
I'd rather not :(

If I were to make a patch for Exim that could allow delays on a failure of
conditions as well, what sort of syntax would people feel most comfortable
with? I personally would like this ability and have no problems making a
patch to do it, I just need to know how it should look in the config file.

Philip, what's your feeling towards this?

Eli.