Re: [exim] ACL woes

Top Page
Delete this message
Reply to this message
Author: Tony Finch
Date:  
To: Craig Schneider
CC: exim-users
Subject: Re: [exim] ACL woes
On Thu, 1 Dec 2005, Craig Schneider wrote:
>
> I'm trying to have user not in a flat text file to have the following
> errors returned. Not sure if there is something wrong with my logic.
>
> acl_check_content:
>
> #  deny message   = External email to this user is prohibited
> #       condition = ${lookup{$recipients}lsearch{/etc/mail/no_external}{0}{1}}
> #       !senders  = *@internal-domain1.com : *@internal-domain2.com

>
> #  deny message     = You are prohibited to send external mail
> #       condition   = ${lookup{$sender_address}lsearch{/etc/mail/no_external}{0}{1}}
> #       !recipients = *@internal-domain1.com : *@internal-domain2.com


The recipients condition is only valid in the RCPT ACL, and I guess from
the name of your ACL you have put this in the wrong place.

Never use the condition condition without checking for better
alternatives. In particular, it's good to get to know how to
put lookups in address lists. Your ACL can be written:

deny
  message    = External email to this user is prohibited
  recipients = lsearch;/etc/mail/no_external
! senders    = *@internal-domain1.com : *@internal-domain2.com


deny
  message    = You are prohibited from sending external email
  senders    = lsearch;/etc/mail/no_external
! recipients = *@internal-domain1.com : *@internal-domain2.com


Tony.
--
<fanf@???> <dot@???> http://dotat.at/ ${sg{\N${sg{\
N\}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}\
\N}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}