--- a/pgsql/create_tables-dovecot-1.2.x.pgsql Tue Apr 10 22:56:30 2012 +0200
+++ b/pgsql/create_tables-dovecot-1.2.x.pgsql Tue Apr 10 23:50:18 2012 +0200
@@ -196,7 +196,10 @@
(SELECT count(gid)
FROM domain_name
WHERE domain_name.gid = domain_data.gid
- AND NOT domain_name.is_primary) AS aliasdomains
+ AND NOT domain_name.is_primary) AS aliasdomains,
+ (SELECT count(gid)
+ FROM catchall
+ WHERE catchall.gid = domain_data.gid) AS catchall
FROM domain_data
LEFT JOIN domain_name USING (gid)
LEFT JOIN users USING (gid)