regression? validate_email accepts trailing dash

25 views
Skip to first unread message

Jason Brackins

unread,
Apr 30, 2014, 5:27:21 PM4/30/14
to django...@googlegroups.com
Hi everybody,

I've found this behavior that feels like a bug. I would like your opinion on whether it is a bug.

In django 1.6 an EmailField will accept an address of the form 'f...@bar.com-'
In django 1.4 it would trigger a ValidationError.

Should this be considered a regression?

The way I interpret the email domain name specs f...@bar.com- is technically a valid email address, because bar.com- is technically a valid domain. But in practice there aren't any top level domains with a dash at the end, so this behavior is completely unexpected.

reference:
 * email spec: http://tools.ietf.org/html/rfc2822#section-3.4
 * domain name spec: http://tools.ietf.org/html/rfc1035#section-2.3.1


Tested in both versions like so:
   from django.core.validators import validate_email
   validate_email('f...@bar.com-')


Should I file a bug, do you think?

Thanks
-jason

Jason Brackins

unread,
May 5, 2014, 1:29:15 PM5/5/14
to django...@googlegroups.com
For future reference, I went ahead and filed https://code.djangoproject.com/ticket/22579
Reply all
Reply to author
Forward
0 new messages