3 ms·
Along those lines, I've settled on the following overly permissive regex: /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/ -- it makes sure it looks something like an email addr
by jbr 16y ago
Along those lines, I've settled on the following overly permissive regex: /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/ -- it makes sure it looks something like an email address (a@b.cd)
- jrockway 16y agoWhat if I want to receive mail directly at my TLD?
- DougBTX 16y agoInterestingly, there is a test for that in the article - under the "These should be invalid" section.
- _fool 16y agointerestingly i count 19 TLD's with mx records. but judging from your earlier post you know as well as i do (i use <single character>@w.tf for many purposes) that there are pretty much no web forms on the planet that would take such an address. tis a shame, but such addresses while pretty nifty are also frequently unusable. not to mention trying to explain to someone that that is really your email address and if it doesn't work they should talk to their ISP/mail client author/etc...well, suffice it to say they won't be getting in touch with you that way anyhow. (be that a blessing or curse, it's just reality)
- davidu 16y agoExcept it's not allowed... http://tools.ietf.org/html/rfc5321#section-2.3.5 http://tools.ietf.org/html/rfc5321#section-2.3.5 RFC 5321 section 2.3.5 specifically prohibits TLDs from receiving email. Other RFCs back that up, actually including RFC5322 (not directly, but in wire format). That said, we see some TLDs run MX's. I think at least some portion of them sell the mail received there to spammers. Seriously.
- tav 16y agoHey David, You obviously know a lot more on this topic... but where exactly does it say in that section that TLDs are prohibited from receiving emails? From my reading, it seems to suggest the opposite, e.g. "In the case of a top-level domain used by itself in an email address, a single string is used without any dots." I've re-read that section many times and forgive me if I missed it — it's late! =) People have been posting conflicting responses throughout this thread suggesting that TLDs can/cannot receive emails, and I'd really like to know which should be valid... thanks!
- mike-cardwell 16y agoWhat if my email address is: "@"@example.com ?
- mattmanser 16y agoThen you should be taken outside and shot as you probably set it up yourself. ;)