From f54ca21bb5823e935f7fc910b3883ef630052297 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 7 Dec 2004 16:53:18 +0000 Subject: move stuff into trunk git-svn-id: file:///home/lennart/svn/public/fooconf/trunk@5 a3b0ba65-a9ea-0310-aec1-fe512e4e1665 --- fooconf-postfix-mailbox-domains | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 fooconf-postfix-mailbox-domains (limited to 'fooconf-postfix-mailbox-domains') 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() -- cgit