summaryrefslogtreecommitdiffstats
path: root/fooconf-postfix-mailbox-domains
diff options
context:
space:
mode:
Diffstat (limited to 'fooconf-postfix-mailbox-domains')
-rw-r--r--fooconf-postfix-mailbox-domains21
1 files changed, 21 insertions, 0 deletions
diff --git a/fooconf-postfix-mailbox-domains b/fooconf-postfix-mailbox-domains
new file mode 100644
index 0000000..35cc6d6
--- /dev/null
+++ b/fooconf-postfix-mailbox-domains
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+# Hey Emacs, this is -*-python-*- code!
+
+from fooconflib import *
+
+def generatePostfixMailboxDomainsFragment(ctx = FooConfContext()):
+ cursor = ctx.db.cursor()
+
+ cursor.execute("SELECT domain.name AS name "+
+ "FROM domain, account "+
+ "WHERE domain.owner = account.id "+
+ "AND account.enabled = \"t\"")
+
+ while 1:
+ row = cursor.fetchone()
+ if row is None: break
+
+ print "%s any" % row["name"]
+
+if __name__ == "__main__":
+ generatePostfixMailboxDomainsFragment()