Re: [exim] Calling an acl from another acl

Top Page
Delete this message
Reply to this message
Author: Chris Wilson
Date:  
To: soumya tr
CC: exim-users@exim.org
Subject: Re: [exim] Calling an acl from another acl
Hi Soumya,

On Thu, 13 Jun 2013, soumya tr wrote:

> Is it possible to call an acl from another acl? Something like..
>
> acl_smtp_data = acl_smtp_data_custom
>
> acl_smtp_data_custom:
> ...
> ...
> ...
> if there exist acl_smtp_data_custom1, then process the conditions of
> acl_smtp_data_custome1


You can include another ACL unconditionally with the "acl =
other_acl_name" condition
<http://www.exim.org/exim-html-current/doc/html/spec_html/ch-access_control_lists.html#SECTaclconditions>.

     acl_check_foo:
         accept
             acl = other_acl_name


I don't know of any way to include the other ACL only if it exists. I
guess as the developer of the exim configuration, you are supposed to know
whether the other ACL exists before including it :)

But you might be able to use "warn" and "set" to change the error
(inclusion of a nonexistent ACL) into a warning (which you can ignore) and
a change to a variable value, which you can then use to accept or reject
the command later. So this might work:

     acl_check_foo:
         warn
             set acl_m_accepted = no
             acl = other_acl_name
             set acl_m_accepted = yes


         accept
             condition = ${acl_m_accepted}


Cheers, Chris.
-- 
_____ __     _
\  __/ / ,__(_)_  | Chris Wilson <chris+sig@???> Cambs UK |
/ (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Ruby/Perl/SQL Developer |
\__/_/_/_//_/___/ | We are GNU : free your mind & your software |