Issue 3802: smtpd.py __getaddr insufficient handling (original) (raw)

Created on 2008-09-08 04:59 by marcus@internetnowasp.net, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg72763 - (view) Author: Marcus CM (marcus@internetnowasp.net) Date: 2008-09-08 04:59
The __getaddr does not handle certain valid MAIL FROM well : For eg, <marcus@internetnow.com.my> SIZE=7777 AUTH=<> would result in a mismatch of bracket handling. Suggested fix is :- def __getaddr(self, keyword, arg): address = None keylen = len(keyword) if arg[:keylen].upper() == keyword: address = arg[keylen:].strip() if not address: pass # Marcus fix : i = address.count("<") ii = address.count(">") if i != ii : address = None return address # Marcus remark : bug if : <abc@ap.com.my> SIZE=6092 AUTH=<> elif address[0] == '<' and address[-1] == '>' and address ! = '<>': # Addresses can be in the form <person@dom.com> but watch out # for null address, e.g. <> if address.count("<") == 1 : address = address[1:-1] return address
msg109304 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-07-05 06:13
Note there is a patch inline, not sure if a doc patch is needed for this.
msg146013 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-10-20 09:41
AFAIK, the extra MAIL FROM and RCPT TO parameters are only valid for ESMTP. smtpd doesn't currently handle ESMTP, so this should not be a problem.
msg309756 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2018-01-10 00:56
I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement.
History
Date User Action Args
2022-04-11 14:56:38 admin set github: 48052
2018-01-10 00:56:50 barry set status: open -> closednosy: + barrymessages: + resolution: wont fixstage: test needed -> resolved
2014-02-03 15:45:59 BreamoreBoy set nosy: - BreamoreBoy
2013-11-20 10:54:37 lpolzer set nosy: + lpolzer
2011-10-20 09:41:53 petri.lehtinen set nosy: + petri.lehtinenmessages: + versions: + Python 2.7, Python 3.2, Python 3.3, - Python 2.6
2010-07-05 06:13:21 BreamoreBoy set nosy: + BreamoreBoymessages: + keywords: + patchtype: behaviorstage: test needed
2008-09-08 04:59:56 marcus@internetnowasp.net create