TheBigRoomXXL@leminal.space to Programmer Humor@programming.devEnglish · 2 months agoEveryone knows what an email address is, right? (Quiz)e-mail.wtfexternal-linkmessage-square87linkfedilinkarrow-up1171arrow-down13
arrow-up1168arrow-down1external-linkEveryone knows what an email address is, right? (Quiz)e-mail.wtfTheBigRoomXXL@leminal.space to Programmer Humor@programming.devEnglish · 2 months agomessage-square87linkfedilink
minus-squareTomasEkeli@programming.devlinkfedilinkarrow-up4·2 months agoI don’t validate emails, I test them. That’s your email? OK, what did we send it? if we couldn’t send to it or the user can’t read it there’s no reason to accept it. OK, maybe I do some light validation first, but I don’t trust the email address just because it’s email-address-shaped.
minus-squareChaoticNeutralCzech@feddit.orglinkfedilinkEnglisharrow-up1·2 months agoWhat kind of “light validation”? I’m guessing a .*@.* regex match.
minus-squareTomasEkeli@programming.devlinkfedilinkarrow-up0·edit-22 months agoAlmost correct. ^.+@.+$ Too hard to validate properly to be worth it. Even if it is technically valid that’s insufficient. It must also work, and the easiest way to test that is to use it and verify that the user got what we sent.
minus-squareTomasEkeli@programming.devlinkfedilinkarrow-up2·2 months agoWould pass first validation, but fail when we try to send an email. Successfully failed.
minus-squareGreenKnight23@lemmy.worldlinkfedilinkarrow-up0·2 months agoI see you accept lemmy handles.
I don’t validate emails, I test them.
That’s your email? OK, what did we send it? if we couldn’t send to it or the user can’t read it there’s no reason to accept it.
OK, maybe I do some light validation first, but I don’t trust the email address just because it’s email-address-shaped.
What kind of “light validation”? I’m guessing a
.*@.*
regex match.Almost correct. ^.+@.+$
Too hard to validate properly to be worth it. Even if it is technically valid that’s insufficient. It must also work, and the easiest way to test that is to use it and verify that the user got what we sent.
@@@
Would pass first validation, but fail when we try to send an email.
Successfully failed.
I see you accept lemmy handles.