3 ms·
Domains ending with a dot are valid though, and it's needed sometimes. For example, someone@ai. (ai. is a TLD) is a different email than someone@ai (ai is a loc
by easrng 5y ago
Domains ending with a dot are valid though, and it's needed sometimes. For example, someone@ai. (ai. is a TLD) is a different email than someone@ai (ai is a local hostname)
- hathawsh 5y agoGood to know. I guess I'll simplify again. Besides, I wonder whether the expression is vulnerable to catastrophic backtracking.
- Beltalowda 5y ago> it's needed sometimes When is this needed in the context of a Rails app? You never want to send emails to local hosts, and emails directly on the TLD is possible, but very little will work with them in practice.
- turminal 5y ago> You never want to send emails to local hosts That's not entirely true, it depends on how your mailing infrastructure is set up.
- Beltalowda 5y agoBut in the context of a web app though? That's the key part: you're taking in email addresses from myapp.example.com. For other cases: sure, local email addresses can be useful (not often these days, but sometimes still are). But in this context I'm not really seeing any use case.
- bbatha 5y agoAt previous $work, I wrote a rails app that managed releases. On the app you could sign up for email notifications when your change was released. These went through the unix local email system. So yes there is very much a use case
- lolinder 5y agoIt's still a bit silly to tell every SaaS developer that they shouldn't validate that they have a normal-looking domain because some people's use cases call for sending emails to local addresses or to TLDs directly. If a developer needs to handle those cases, they know already, and they're in a vanishingly small minority.
- Biganon 5y agoI'm pretty sure the one guy behind ai. doesn't justify that you change your regex for him. Let's not be overly pedantic.
- campital 5y agohttps://en.wikipedia.org/wiki/Top-level_domain#Dotless_domains https://en.wikipedia.org/wiki/Top-level_domain#Dotless_domai...
- Supermancho 5y ago> Domains ending with a dot are valid though, That doesn't mean you have to support their use. I have never seen a company support an email ending in a period and the world seems to continue along.