INNER CODE UNIT · Python

mail2pgsql

netkiller/netkiller.github.io · postgres/python/server.py:71

def mail2pgsql():
    db = pg.DB(dbname='netkiller', host='127.0.0.1', user='netkiller',passwd='chen')
    db.query("insert into oa.away(personnel,note,manager) values('mail2pgsql','"+mailfrom+text+mailto+"','pgsql')")
    for r in db.query("select * from oa.away").dictresult():
        print '%(id)s %(note)s' % r
        
def mail2file(filename):
    f=open(filename,'w');
    f.write(mailfrom)
    f.write(mailto)
    f.write(text)
    f.close()
    
mail2pgsql()
mail2file('socket-file.log')


#HELO

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…