Re: [exim] warn ACL and deferred LDAP lookup

Top Page
Delete this message
Reply to this message
Author: W B Hacker
Date:  
To: exim users
Subject: Re: [exim] warn ACL and deferred LDAP lookup
Micha Lenk wrote:
> Hi,
>
> I would like to use a warn ACL to set an ACL variable depending on the
> result of a LDAP lookup using ${lookup ldapm{...}}. I use something
> similar like this:
>
> warn condition = ${lookup ldapm{...}}
>       set acl_c0 = 1

>
> This works just fine, except for one thing: In case the lookup fails for
> some reason (e.g. the LDAP server is currently unreachable), I would
> like the entire ACL to return defer and *not* continue with the next
> ACL. How do I achieve that?
>
> Regards,
> Micha
>


A 'warn' verb ordinarily makes a log entry or sets a marker - it
doesn't, in and of itself, otherwise affect the flow of the smtp
session. Exim WILL continue to the next acl regardless.

So ... to achieve the next part of your goal some SUBSEQUENT acl - not
necessarily the next immediate one - would need to be a 'defer' based on
whatever the warn had set into [ the | a | several] variable(s).

There can be tests for either/both fail-to-match and fail-to-access LDAP.

Pay attention to how Exim decides to exit an acl clause, consider use of
stacked NOT conditionals to provide for finer grain control of that flow.

Use of BOTH 'logwrite' and 'log_message' in the clause - or in a 'warn'
clause inserted purely for 'instrumenting' what is going on - can make
it clear if the test was traversed, and with what entry and exit values.
Comment those OFF only AFTER you are sure you have what you want, and
all the time, not just 'mostly'.

HTH,

Bill
--
韓家標