Backport 58594:
Issue #1307, patch by Derek Shockey.
When "MAIL" is received without args, an exception happens instead of
sending a 501 syntax error response.
diff --git a/Lib/smtpd.py b/Lib/smtpd.py
index c656ec7..4aa3476 100755
--- a/Lib/smtpd.py
+++ b/Lib/smtpd.py
@@ -221,7 +221,7 @@
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