diff options
author | yvesf <yvesf@aurora.xapek.org> | 2010-02-20 20:35:58 +0100 |
---|---|---|
committer | yvesf <yvesf@aurora.xapek.org> | 2010-02-20 20:35:58 +0100 |
commit | 7c54483dffe17585ddaa71c9490c4bfb8609dcb7 (patch) | |
tree | 56c44462a4eeb05156f2bf2c316befac90761544 /smtp.py | |
parent | e163ae33ce7979988beed1098368b656ef4f7fe1 (diff) | |
download | fakesmtp-7c54483dffe17585ddaa71c9490c4bfb8609dcb7.tar.gz fakesmtp-7c54483dffe17585ddaa71c9490c4bfb8609dcb7.zip |
fix previous mistake, better logging
Diffstat (limited to 'smtp.py')
-rw-r--r-- | smtp.py | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -63,14 +63,17 @@ class SMTPServer(asyncore.dispatcher): def handle_accept(self): conn, addr = self.accept() - self.logger.info("New Client %s" % addr) - SMTPChannel(self, conn, addr) + self.logger.info("New Client %s:%s" % conn.getpeername()) + try: + SMTPChannel(self, conn, addr) + except Exception,e: + self.logger.error(str(e)) if __name__ == '__main__': s = SMTPServer() - + #user change pwinfo = pwd.getpwnam('nobody') os.setregid(pwinfo[3],pwinfo[3]) @@ -106,5 +109,6 @@ if __name__ == '__main__': os.dup2(se.fileno(), sys.stderr.fileno()) # Set custom file descriptors so that they get proper buffering. sys.stdout, sys.stderr = so, se - + #""" + asyncore.loop() |