[New-bugs-announce] [issue1307] smtpd.SMTPServer throws exception on MAIL command with no arg

Derek Shockey report at bugs.python.org
Sun Oct 21 03:51:06 CEST 2007


New submission from Derek Shockey:

smtpd.SMTPChannel contains a bug such that when connected to an 
SMTPServer (or any subclass thereof), issuing a MAIL command with no 
argument closes the socket and gives this error on the server:

(<type 'exceptions.TypeError'>:'NoneType' object is unsubscriptable ... 
smtpd.py|__getaddr|212])

The desired result is of course is to respond with a 501 Syntax error. 
The problem arises because the arg parameter passed to each smtp_* 
command handler function is None when there is no argument. arg is 
passed on to __getaddr which attempts a slice on the None object.

A check for None in __getaddr that returns will allow the existing code 
to issue the appropriate 501 Syntax error.

----------
components: Library (Lib)
messages: 56616
nosy: dshockey
severity: normal
status: open
title: smtpd.SMTPServer throws exception on MAIL command with no arg
versions: Python 2.5

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1307>
__________________________________


More information about the New-bugs-announce mailing list