30 lines
578 B
Python
30 lines
578 B
Python
|
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
|