this post was submitted on 18 Aug 2025
661 points (99.1% liked)
Programmer Humor
25776 readers
2194 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
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.
if i can email them and the user gets it - fine by me
@
matches