diff options
| author | R David Murray <rdmurray@bitdance.com> | 2011-07-19 01:34:04 (GMT) |
|---|---|---|
| committer | R David Murray <rdmurray@bitdance.com> | 2011-07-19 01:34:04 (GMT) |
| commit | 9522595d704e031a60304d4eb8cbc457bcb91e23 (patch) | |
| tree | f180506587e7fc002cd587dcde414bd19fb8bb76 /Lib/test/test_smtplib.py | |
| parent | 60bf489e8aab38519cbc5c9683574d01a52e5c65 (diff) | |
| download | cpython-9522595d704e031a60304d4eb8cbc457bcb91e23.zip cpython-9522595d704e031a60304d4eb8cbc457bcb91e23.tar.gz cpython-9522595d704e031a60304d4eb8cbc457bcb91e23.tar.bz2 | |
#7484: no more <> around addresses in VRFY or EXPN
The RFC doesn't say that they are allowed; apparently many mailers accept
them, but not postfix. Contributions to this patch were made by Felipe Cruz
and Catalin Iacob.
Diffstat (limited to 'Lib/test/test_smtplib.py')
| -rw-r--r-- | Lib/test/test_smtplib.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py index 42a10be..81806c9 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -330,15 +330,14 @@ class SimSMTPChannel(smtpd.SMTPChannel): self.push(resp) def smtp_VRFY(self, arg): - raw_addr = email.utils.parseaddr(arg)[1] - quoted_addr = smtplib.quoteaddr(arg) - if raw_addr in sim_users: - self.push('250 %s %s' % (sim_users[raw_addr], quoted_addr)) + # For max compatibility smtplib should be sending the raw address. + if arg in sim_users: + self.push('250 %s %s' % (sim_users[arg], smtplib.quoteaddr(arg))) else: self.push('550 No such user: %s' % arg) def smtp_EXPN(self, arg): - list_name = email.utils.parseaddr(arg)[1].lower() + list_name = arg.lower() if list_name in sim_lists: user_list = sim_lists[list_name] for n, user_email in enumerate(user_list): @@ -454,7 +453,7 @@ class SMTPSimTests(unittest.TestCase): self.assertEqual(smtp.vrfy(email), expected_known) u = 'nobody@nowhere.com' - expected_unknown = (550, 'No such user: %s' % smtplib.quoteaddr(u)) + expected_unknown = (550, 'No such user: %s' % u) self.assertEqual(smtp.vrfy(u), expected_unknown) smtp.quit() |
