14 Mar
2010
14 Mar
'10
2:23 a.m.
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'