Opened 8 years ago

Closed 8 years ago

#27290 closed Bug (wontfix)

Email validation doesn't check length

Reported by: kyoki Owned by: nobody
Component: Core (Other) Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Django's validate_email /EmailValidator doesn't properly check the length of emails as defined in RFC3696. The local part should be restricted to 64 characters and the domain to 255. The overall email address length is restricted to 256 characters in RFC 2821.

Change History (3)

in reply to:  description comment:1 by Lewis Cowles, 8 years ago

Replying to kyoki:

Django's validate_email /EmailValidator doesn't properly check the length of emails as defined in RFC3696. The local part should be restricted to 64 characters and the domain to 255. The overall email address length is restricted to 256 characters in RFC 2821.

The maximum length of an email address is 254 as in RFC 5321 it states "The maximum total length of a reverse-path or forward-path is 256 characters". With two chars taken up, 254 is all we are left with.

Sources:
http://stackoverflow.com/questions/386294/what-is-the-maximum-length-of-a-valid-email-address
http://www.rfc-editor.org/errata_search.php?rfc=3696&eid=1690

comment:2 by Moritz Sichert, 8 years ago

This is possibly a duplicate of #26423. The consensus there is to use less complex HTML5 validation rules instead of trying to validate an address exactly according to the RFCs.

Also one problem I can immediately think of is how you would count the length of unicode characters: For the purposes of validation should the length of ä@foo be 5 or 6?

comment:3 by Tim Graham, 8 years ago

Component: UncategorizedCore (Other)
Resolution: wontfix
Status: newclosed

Yes, I don't think there's any change to make here in light of #26423.

Note: See TracTickets for help on using tickets.
Back to Top