RE: [exim] one more condition

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Jakob Hirsch
Dátum:  
Címzett: Chris Knipe
CC: exim-users
Tárgy: RE: [exim] one more condition
Chris Knipe wrote:

> Blah:
> driver = accept
> domains = mysql query to get the relay domains
> local_parts = mysql query to select the users from mysql to the relay
> domains
> verify_only


This implies that there is another router that handles the delivery, like:

blah2:
driver = dnslookup
domains = mysql query to get the relay domains
no_verify


But that won't help you with your logic problem. I don't know your tables,
but something like this could work (my sql is a little rusty...)

!condition = ${lookup mysql{
  SELECT 'yes' FROM domain, user
  WHERE domain.name = '{quote_mysql:$domain}'
  AND (domain.verify = 0
       OR (domain.domain_id = user.domain_id
           AND user.local_part = '{quote_mysql:$local_part}'))
  LIMIT 1}}


(trailing \es stripped)

not exactly beautiful, though...