On Sat, 2010-03-13 at 21:19 -0300, Leonardo Rodrigues wrote:
> >
> > .., domains.host as host, 'Y' as proxy_maybe, ..
> > from emails, domains where domains.domain = '%d', ..
> >
> > So it's really exactly the same as per-user quota, except you're just
> > returning it per-domain in the query.
> >    
> 
> 
>      but if i simply add that, query will always return nothing when 
> user is not local.
> 
>      where endereco='%u'
> 
>      will make it return an empty resultset when user does not exists 
> locally.

So are you saying that the users table contains only local users, while
some domain table contains all domains and their destination servers?
Then you'll just need to do outer join. Something like:

.., domains.host as host, 'Y' as proxy_maybe, ..
from domains
outer join emails on (username = '%u')
where domain.domain = '%d'

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to