Subject: Identity Report- No. 36-15472a

From: Investigate your neighbor <[email-masked]>
Date: Fri, 23 May 2014 12:17:51 -0700

Hey Ietf-dkim-archive,

Did you hear about he eBay Hack Attack?

Its the Second Largest in US History. Hackers gained access to its entire database of 145 Mil
user records and leaves many questions unanswered. 

My name was used falsely in an arrest, and I didnt even Know it until I checked my public record.

You can check your history as well as the history of your neighbors to see if they have committed 
similar crimes. 

Enter Name Here -> / http://www.askpoh.com/identity/arrest/record.index

Regards, 

Alert Systems Notifications

Alter message settings w/ Alert System Notifications at ( 1107 Valeria Dr-Marion, TX 78124)
or http://www.askpoh.com/kgje/skfg.4ighj

@PaoloBergantino i mean that , why would i try to send a mail to check an obviously wrong mail address? even if i need to "be absolutely, positively sure that what the user entered is in fact an email" , i would only check the email addresses that match the regex   kommradHomer Jul 19 '12 at 14:32
9	  	
@PaoloBergantino I just do not except that regex is a bad idea and just a guess. A regex-invalid address is %100 an invalid address.   kommradHomer Jul 19 '12 at 14:48
14	  	
@kommradHomer -- a "regex invalid" address is almost always valid, because whatever regex you use to validate an email address is almost certainly wrong and will exclude valid email addresses. An email address is name_part@domain_part and practically anything, including an @, is valid in the name_part; The address is legal, although it must be escaped as foo\ine..... Once the email reaches the domain e.g. 'example.com' that domain can route the mail "locally" so "strange" usernames and hostnames can exist.   Stephen P Mar 7 '13 at 1:40
The second regex in voyager's answer in97 is practical for use and should have almost no false negatives. I agree with @kommradHomer here -- why send an email if you don't have to? I can understand reflexive dislike for incomprehensible regexes and desire to keep code simple, but this is a couple lines of code that can save your server a lot of trouble by immediately weeding out items that are definitely invalid. A regex on its own is unhelpful, but serves as a good complement to serverside validation.   Ben Apr 10 '13 at 21:30
@StephenP is right. It's virtually impossible to find a regex that will match all valid emails. Plus email address formats can change.   Eduard Luca Oct 17 '13 at 8:05
@kommradHomer - "why would i want to spend my time validating an..." Huh? Spend your time? Of course not, silly! You'd write code to do that for you. And then you'd actually know if you had a valid address without risk of alienating users. That's pretty cool! Or you can pout and defiantly use a broken solution. I ain't mad at it. @StephenP "a 'regex invalid' address is almost always valid, because whatever regex you use to validate an email address is almost certainly wrong and will exclude valid email addresses" I find this argument to be logically flawed. People enter all kinds of invalid stuff in forms.   dmur Feb 7 at 21:53
@dmur I concede "almost always valid" is probably overstating it, but I've had my (perfectly valid and working) email addresses rejected by websites far too often, just because I have a .us domain or because I used a + to the left of the @ -- many places have fixed these egregious errors, but the local-part (left of @) can be anything the domain owner wants. -"@example.com <-- is a valid email addressa-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\
x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(
?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[
(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])You can implement something 20x as long that might cause problems for a few users and might not be valid in the future, or you can grab ImmortalFirefly's version to make sure they at least put in the effort to make it look real. Depending on your application it may be more likely to come across someone will get mad because you don't accept their unconventional email, rather than someone who causes problems by entering email addresses that don't really exist (which they can do anyways by entering a 100% validmail address but using an unregistered username or domain). Upvoted!   user83358 Jul 30 '12 at 18:20 
This allows the entry of so many invalid email addresses it is useless advice.   cazlab Jan 6 '12 at 23:07
It doesn't have to be impossible to debug at all. There are many fine examples in this thread that validate further than "does it have an '@' in it. Your example allows "u@" to be considered a valid email address. At least evaluate for whether there is a domain or something that might be a domain. Yours is an example of what I'd call "aggressively lazy coding." I'm not sure why you are defending it as it is by far the lowest rated answer in the thread.   cazlab Jan 26 '12 at 9:08 
@cazlab maybe you are right. After all I have been voted down. Differently from you I don't think though any of the code above shows easy to debug snippets. My 'agressively lazy' approach at least can be improved if required.   Zo72 Jan 26 '12 at 11:37 How is this any different from using regex? (.+)@(.*) does the same thing, and shorter.   snostorm Apr 7 '12 at 21:03 
+1 - If the objective is to make sure that the user has at least attempted to put in an e-mail address, then checking to see if it can be determined that the e-mail address is definitely NOT an e-mail is a great solution. A good example would be if you want a person's username to be an e-mail address. If the user types in 'sexy_chick_23', then this regex can be used to give them a heads up that an e-mail is expected. If something is typed in that looks like an e-mail, but is not, then the user will never get the 'confirmation' e-mail and the sign up process will never be validated
@ImmortalFirefly, the regex you provided will actually match name@[email-masked]. Try pasting your line into a JavaScript console. I believe your intention was to match only the entire text, which would require the beginning of text '^' and end of text '$' operators. The one I'm using