Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think that the domain part of email addresses could be an IP address. Depending on how IPv6 addresses are displayed there, they won’t contain a dot.

Somewhat artificial, yes.



I'll admit I hadn't considered IPv6b addresses, might have to rethink my trusty regex. Sad, it's served me well for so many years.


IPv4 also has a valid decimal representation. http://1249764136/ will send you to Google!


TIL.

I wonder what the security implications of this is.


If using IPs in an email address you are supposed to surround it with square brackets anyway.

I wouldn't add IP address support to an email regex because I'd rather turn away such perverse data anyway. Nobody uses IP-based email addresses.


A square bracket, however, is not a dot (which is for what the original regexp checked).

And I just tried sending an email to me@[my.ip.addr.[0]]. Postfix somehow recognised it was for this local host, but failed because it wasn’t part of the virtual domains I had put into it. ‘perverse’ seems to be somewhat appropriate.

[0] Sorry, too lazy to check the appropriate documentation IP address ranges. 20db?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: