3 ms·
you are supposed to not use email as a token of user uniqueness, because it's not. the fundamental problem here is assuming that "emailA == emailB" could ever
by paulmd 4y ago
you are supposed to not use email as a token of user uniqueness, because it's not.
the fundamental problem here is assuming that "emailA == emailB" could ever conceivably be used as a proxy of the equality "userA == userB". Unicode tarpits aside (that's a legitimate problem where even if you did everything exactly right, libraries or api calls etc might not) the idea of "do these mailboxes belong to the same user" (in the sense of stripping '+' suffixes from gmail boxes etc) cannot be answered period. You cannot affirmatively confirm this nor can you disprove the assertion either, without some additional information about the behavior of the receiving mail transport agent.
even if you understand the behavior of the receiving MTA, you cannot prove that they don't have an email account somewhere else, so that is not sufficient either.
email is not a key for user uniqueness, period. It's a channel for contacting a user. You don't mess with it, and you simply send an email and see if the session user can authenticate it. If you want identity verification that happens at another layer, not email.
"transforms" like lowercasing or mailbox-suffix-stripping are only window dressing patching around this fundamental issue. There is no way to affirmatively go from "email address" to "user identity" without more information from another layer. It's a communication channel, not an identity provider. You can (reasonably) use it as a medium to talk to the user while you verify them against something else (although like SMS it can of course be hijacked unless your IDP protocol accounts for this possibility) but "email verification" is not and can never be an IDP in itself. Gmail addresses are free.
- JohnFen 4y agoI don't think I know a single person, tech-savvy or not, that only has one email address.
- rovr138 4y ago> (in the sense of stripping '+' suffixes from gmail boxes etc) I have a few accounts. Those + suffixes drive a bunch of rules on them to get me to take action. They forward to my primary email address if it's important. Some of them get scraped and mailed in a weekly summary. Some of them send text messages alerting me. When they mess with them, I'll probably just not see it unless I have to login for some other reason to that account.