On 1/29/2010 4:41 AM, Robert Schetterer wrote:
> Hi all,
> i have a sasl mysql map matching existing users in mysql
>
> SELECT username FROM mailbox WHERE username='%s' AND active = 1
>
> this works nice
>
> but now i need a query or chain for allowing specific admin users in
> mysql to allow so i am unsure about the syntax of the or statement
>
> i need something like
>
> SELECT username FROM mailbox WHERE username='%s' AND active = 1 OR
> SELECT username FROM domain_admins WHERE username='%s' AND domain = '%d'
>   

If the expected result is in either table, but not both, replace the
word OR with UNION.
If the expected result in in both tables and you want both answers, you
can still do the replace.

Test results using 'postmap -q' (see 'man postmap' for detail) to make
sure you get the results you expect.

Reply via email to