#9890 closed (fixed)
EmailField bug
Reported by: | Özgür Vatansever | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I have a form like this:
class InvitationForm(forms.Form): e_mail = forms.EmailField()
when I test this form;
In [10]: i = InvitationForm(data={"e_mail":"ozgur@gmail-.com"}) In [11]: i.is_valid() Out[11]: True
However; when I tried to send an email to this email via postfix; I got that error:
ada:~# nc localhost smtp 220 ada.adacor.com.tr ESMTP Postfix (Debian/GNU) MAIL FROM:can@canb.net 250 2.1.0 Ok RCPT TO: ozgur@gmail-.com 501 5.1.3 Bad recipient address syntax
The problem is that although django.forms.EmailField accepts "ozgur@…" as a valid email, however, postfix is giving me an error.
Attachments (1)
Change History (9)
comment:1 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 16 years ago
Russell -- are you sure about that? RFC 1035 (listed as obsoleting 822) describes domain names:
The following syntax will result in fewer problems with many applications that use domain names (e.g., mail, TELNET). <domain> ::= <subdomain> | " " <subdomain> ::= <label> | <subdomain> "." <label> <label> ::= <letter> [ [ <ldh-str> ] <let-dig> ] <ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str> <let-dig-hyp> ::= <let-dig> | "-" <let-dig> ::= <letter> | <digit> <letter> ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case <digit> ::= any one of the ten digits 0 through 9 Note that while upper and lower case letters are allowed in domain names, no significance is attached to the case. That is, two names with the same spelling but different case are to be treated as if identical. The labels must follow the rules for ARPANET host names. They must start with a letter, end with a letter or digit, and have as interior characters only letters, digits, and hyphen. There are also some restrictions on the length. Labels must be 63 characters or less.
While the first sentence sounds pretty wishy-washy on whether these are "rules" the last paragraph sounds pretty definite that hyphens are not allowed as the last character of a label.
comment:3 by , 16 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Bah - you are correct, Karen. I was mistakenly looking at RFC 822 (format for internet text messages), not 882 (domain names). For what it's worth, 882 also prohibits hyphens at the end of a domain element, as does 821/2821 (SMTP). Reopening; apologies for the confusion ozgur.
comment:4 by , 16 years ago
Has patch: | set |
---|
comment:5 by , 16 years ago
milestone: | → 1.1 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:6 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
The email address ozgur@… is completely legal. See RFC822 for more details. If If Postfix has a problem with this address, then that is Postfix's problem, not Django's.