#15042 closed (fixed)
1.2.4 regression: send_mail doesn't access email recipient with no domain
Reported by: | net147 | Owned by: | Łukasz Rekucki |
---|---|---|---|
Component: | Core (Mail) | Version: | 1.2 |
Severity: | Keywords: | blocker regression send_mail email | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Sending email using django.core.mail.send_mail fails to send to an email recipient that is just the username on the current system (e.g. joe instead of joe@localhost).
This worked fine in Django 1.2.3 but no longer works in Django 1.2.4 (throws a ValueError trying to split the email by @ into name and domain).
Attachments (2)
Change History (9)
comment:1 by , 14 years ago
Keywords: | blocker added |
---|---|
milestone: | → 1.3 |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 14 years ago
Owner: | changed from | to
---|
Started refactoring of regressiontests/mail/tests.py
. Shouldn't take long.
comment:3 by , 14 years ago
Has patch: | set |
---|
The patch contains:
- Refactored tests for mail handling:
MailTests
class contains test cases related to EmailMessage class that don't depend on any backend.BaseEmailBackendTests
contains all other tests that involve actually sending any messages.FakeSMTPServer
using Python'ssmptd
module for testing the SMTP backend. This runs in another thread for the duration of the testcase.
- Correct handling of IDN: all headers that contain email addresses must be sanitized properly. Otherwise, the whole header will be encoded as "quoted-printable", thus loosing it's structure. I tried sending some emails to a localy defined IDN and Postfix treats the value in
From: =?utf-8?b?ZnLDtm1Aw7bDpMO8LmNvbQ==?=
as it was a mailbox name. - Some support for non-ASCII characters in local-part of the email (they're encoded as they we're before).
- A fix and a regression test for this issue.
Note: Backporting to 1.2.X involves moving some code from setUpClass/tearDownClass
in SMTPBackendTests
to setUp/tearDown
. Should I make a seperate patch ?
comment:4 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [15211]) Fixed #15042 -- Ensured that email addresses without a domain can still be mail recipients. Patch also improves the IDN handling introduced by r15006, and refactors the test suite to ensure even feature coverage. Thanks to net147 for the report, and to Łukasz Rekucki for the awesome patch.
comment:5 by , 14 years ago
(In [15213]) [1.2.X] Fixed #15042 -- Ensured that email addresses without a domain can still be mail recipients. Patch also improves the IDN handling introduced by r15006, and refactors the test suite to ensure even feature coverage. Thanks to net147 for the report, and to Łukasz Rekucki for the awesome patch.
Backport of r15211 from trunk.
To clarify - this only affects the SMTP backend. Code was broken by r15006, fixing #14301, because there's no existing test for the behavior described.
Mail tests should probably be backend-duplicated like the tests for cache backends.