summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--smtp.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/smtp.py b/smtp.py
index 3be3d63..1f50884 100644
--- a/smtp.py
+++ b/smtp.py
@@ -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()