From 1046af6f594d79a7447d1410aee206f5d509ccc5 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Tue, 23 Oct 2007 05:35:11 +0000 Subject: [PATCH] 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. --- Lib/smtpd.py | 2 +- Misc/NEWS | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/smtpd.py b/Lib/smtpd.py index c656ec76396..4aa34763ecf 100755 --- a/Lib/smtpd.py +++ b/Lib/smtpd.py @@ -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:
') return diff --git a/Misc/NEWS b/Misc/NEWS index a3912191d88..4cc936db04d 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -32,6 +32,8 @@ Core and builtins Library ------- +- Bug #1307: Fix smtpd so it doesn't raise an exception when there is no arg. + - ctypes will now work correctly on 32-bit systems when Python is configured with --with-system-ffi.