2005-09-19 20:55:40 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2005-09-19 20:40:21 +02:00
|
|
|
import psycopg
|
|
|
|
|
|
|
|
cnx = psycopg.connect("user=exim4 password=CotOgigmeIk5 dbname=gnuviechadmin")
|
|
|
|
|
|
|
|
cr = cnx.cursor()
|
|
|
|
|
|
|
|
print "-- Information from mailalias --"
|
|
|
|
cr.execute('SELECT * FROM mailalias')
|
|
|
|
cnx.commit()
|
|
|
|
|
|
|
|
print cr.description
|
|
|
|
|
|
|
|
result = cr.fetchall()
|
|
|
|
for line in result:
|
|
|
|
print line
|
|
|
|
|
|
|
|
print "-- Information from mailpasswd --"
|
|
|
|
cr.execute('SELECT * FROM mailpasswd')
|
|
|
|
cnx.commit()
|
|
|
|
result = cr.fetchall()
|
|
|
|
for line in result:
|
|
|
|
print line
|
|
|
|
|
|
|
|
print "-- Domains --"
|
|
|
|
cr.execute('SELECT DISTINCT domain FROM mailalias')
|
|
|
|
cnx.commit()
|
|
|
|
result = cr.fetchall()
|
|
|
|
for line in result:
|
|
|
|
print line
|