]> granicus.if.org Git - python/commitdiff
Issue #1307, patch by Derek Shockey.
authorGuido van Rossum <guido@python.org>
Mon, 22 Oct 2007 16:27:19 +0000 (16:27 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 22 Oct 2007 16:27:19 +0000 (16:27 +0000)
When "MAIL" is received without args, an exception happens instead of
sending a 501 syntax error response.

Lib/smtpd.py

index c656ec76396a62fb5df0200eec1104b635ef2c8a..4aa34763ecff0a2fa84af1d3561666ba2939e3ef 100755 (executable)
@@ -221,7 +221,7 @@ class SMTPChannel(asynchat.async_chat):
 
     def smtp_MAIL(self, arg):
         print >> DEBUGSTREAM, '===> MAIL', arg
-        address = self.__getaddr('FROM:', arg)
+        address = self.__getaddr('FROM:', arg) if arg else None
         if not address:
             self.push('501 Syntax: MAIL FROM:<address>')
             return