From 821265bb6de9a5261db4bbc2556cb5086a596e95 Mon Sep 17 00:00:00 2001 From: Chuck Date: Fri, 5 Jul 2013 14:35:38 +0700 Subject: [PATCH] Adding help. Catching exception. --- src/class_smtpServer.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/class_smtpServer.py b/src/class_smtpServer.py index 65cc6cea..2f1b3097 100644 --- a/src/class_smtpServer.py +++ b/src/class_smtpServer.py @@ -103,6 +103,11 @@ class bitmessageSMTPChannel(asynchat.async_chat): self.push(status) # SMTP and ESMTP commands + def smtp_HELP(self, arg): + self.push('214 HELP HELO EHLO AUTH NOOP QUIT MAIL RCPT RSET DATA') + # TODO - detailed help for all commands. + return + def smtp_EHLO(self, arg): if not arg: self.push('501 Syntax: EHLO hostname') @@ -130,7 +135,11 @@ class bitmessageSMTPChannel(asynchat.async_chat): self.push('501 method not understood') return - z, username, pw = base64.b64decode(pw).split('\x00') + try: + z, username, pw = base64.b64decode(pw).split('\x00') + except: + z = 'error' + if z != '': self.push('501 method not understood') return