Yes, my email exists
Ah yes, another day, another outdated website that still doesn’t know about .dev domains. At least it doesn’t deny me signing up for their services, but it still nags me with ‘Hey, did you mean me[at]kytta.de?’
No, I didn’t.
I find it hard to understand why the companies care so much about what the emails look like. Some do not allow me to use plus addressing, others fail on domain names with more than two components. I understand that one doesn’t want to lose a customer just because they made a typo, but I, as a power user, don’t make typos!
So, what’s the alternative?
Dear site owners, there is a very simple solution to this problem that is easy to implement and easy to maintain. It consists of two main rules.
Rule 1. Redefine ‘wrong’.
The issue with most of these websites is that they try to save themselves from spam and/or user errors by forbidding things that are actually legal. To solve this, do the following:
- Carefully read all the email falsehoods programmers believe in.
- Remove everything that validates the local-part (everything that precedes the last
@
sign). - Do the following to validate the domain part:
- Ignore comments (such as
foo@(comment)bar.com
) and IP addresses (such asbaz@[192.168.1.1]
) - Try resolving the
MX
record of the domain part. Using DNS-over-HTTPS is easier than ever; just make a request tohttps://cloudflare-dns.com/dns-query?name=<DOMAIN>&type=MX
- If the
Status
field is0
, andAnswer
is not empty, shut up and accept the email. - Otherwise, display a warning about not being able to resolve the domain name. Place the ‘I am sure it’s correct, continue anyway’ button right under it.
- Ignore comments (such as
That’s it! That’s the only validation that is reasonable for this task. DNS queries are fast, and you can cache them to minimize request rate. But what should you do if a user makes a typo? What if their e-mail address is on a different server? Well, there comes the second rule…
Rule 2. It’s their responsibility, not ours.
If the user typed the email wrong, it’s their concern, not ours. Yes, it’s that simple. Whatever the user types in the email input field, save it in your database as-is and don’t nag about it.
Perhaps I am overreacting. Perhaps my solution is not the one that generates the most conversion. But sometimes I wish that the companies would just stop reinventing the wheel and trying to help where their help is not asked for.
This is post 002 of #100DaysToOffload.
Comments (via Mastodon)
tux0r
@tux0r
@kytta Possible solution: make all website admins use my library to validate addresses. ;-) https://github.com/dertuxmalwieder/libvldmail
Klaus Alexander Seistrup
@kas
🔗 https://publicsuffix.org/
It has libraries for many programming languages:
🔗 https://publicsuffix.org/learn/
I have attached a simple example in Python.
tux0r
@tux0r
@kas @kytta Suffixes should be irrelevant for this "problem".
Klaus Alexander Seistrup
@kas
Ru (Tech)
@ru
@kytta God, ugh. The number of times my .one throwaway has been rejected because it's...invalid. I had to sign up for a .com with a much longer name to have a "backup" email that will safely work 100% of the places I try to use it. -_-
AutocorrectGPTBot
@wcbdata
@kytta
At least some of this is because of the absolutely horrible decision to use email address as a primary or unique key for accounts. The data modeler in my soul dies a little each time I see it. ☠️
AutocorrectGPTBot
@wcbdata
@kytta
I blame MongoDB.
Zlatko Duric
@zlatko
@kytta Yeah, but why the well would you have a .dev domain?
No, wait...
Som
@Som89
@kytta oh my, I have so much of this trouble with my som.observer domain that after a year possessing it I start thinking to buy another one with a less cumbersome TLD just to have a backup email for such stupid checks...
René Fouquet
@rene
@kytta I have a .me domain and I feel your pain.
Nikita
@kytta
@rene Damn, and it's not even one of those shiny new gTLDs!
René Fouquet
@rene
@kytta It’s almost like they’ve found this old email validation regex from 1995 and thought “eh, good enough”.
Roni Laukkarinen
@rolle
@kytta It's even funnier that my email roni@dude.fi causes "Did you mean roni@dude.fr". No, I'm Finnish, not French. Finland is a real country, no matter what they say.
Andrew Ross
@amr
@kytta @bazbt3 This reminds me of a friend who couldn't get a package delivered to his address, because he lived on Broadway. The software couldn't believe that it was just “Broadway” and not “Broadway St" or "Broadway Ave”.
bazbt3
@bazbt3
@amr @kytta It's quite a common thing isn't it. I've only had people mid-spelling one of my previous street names because they assumed it was named after a long-dead public figure instead of a geographical feature. It didn't help that the street sign of a cul-de-sac off it was incorrectly named for the dead person. :)
I do occasionally get asked if my email's short second level domain is actually (at)yahoo.com.
smorks
@smorks
@kytta i have a .tech domain and run into this more often than i'd like too. ugh.
Comments last fetched . Updates at least every six hours.