diff options
-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() |