Re: [Exim] lookups in ACLs

Góra strony
Delete this message
Reply to this message
Autor: William Thompson
Data:  
Dla: Nico Erfurth
CC: Kevin P. Fleming, exim-users
Temat: Re: [Exim] lookups in ACLs
> >That's good, I use lots of sql lookups in ACLs.
>
> Put them into address/domain/host lists, IIRC they have their own
> cachine mechanism.


The sql queries I'm doing doesn't involve those types of lists.

For instance this ACL in RCPT:
        deny    message = ${lookup \
                                mysql{select reject_reason \
                                  from eximconf.reject_messages \
                                  where reject_name='send_outside'} \
                                {${expand:$value}} \
                           }
                log_message = Sender not allowed to send to outside addresses
                !domains = +local_domains
                !condition = ${lookup \
                                   mysql{select outside_email \
                                     from userbase.passwd \
                                     where enabled='yes' and \
                                     email='$sender_address_local_part' \
                                     limit 1\
                                   } \
                                   {$value} \
                                   {yes} \
                              }
                sender_domains = +local_domains



Basically if the user is not allowed to email an address not in local_domains,
it's refused. The sql query would be the same for every rcpt address.

of course, if these are checked in sequence, then I should move sender_domains
above the condition. In this particular one, the $value is either 'yes' or
'no' (that field is an enum).