Frustrated rant following:
Ok, I am getting really annoyed with companies and people that write their e-mail addresses in the form whoever(at)gmail(dot)com. I have gone to three business sites this week and I have had to change an e-mail address rather than just copy and paste it into an e-mail client. It is annoying to do the extra step and it is completely useless.
Come on! Really? Why is this needed? Do these people even know what a regular expression is? Ugh, just to prove how stupid this is, I altered a common e-mail regular expression to catch all of these I have come in contact lately with. Putting things like (at) in your e-mail is useless. It does nothing. A smart programmer’s SPAM bot can probably still find you. If you don’t want your e-mail address to be used by customers, then don’t even post it on your website. There is no need to alter your e-mail address. It doesn’t protect you.
The script I wrote in less than two minutes catches most of these and it really is not that complicated at all. I even threw in a few invalid ones to show you that it could easily parse through text with @ symbols and periods easily. I could spend a few more minutes on it and catch almost anything most companies could use that common users would understand.
If you have a site with addresses like this, please use the following code to go through your company website to find all e-mail addresses and change them to their proper form, or remove them completely.
BELOW is the script written in perl.
OUTPUT OF SCRIPT IS BELOW
Ok, I am getting really annoyed with companies and people that write their e-mail addresses in the form whoever(at)gmail(dot)com. I have gone to three business sites this week and I have had to change an e-mail address rather than just copy and paste it into an e-mail client. It is annoying to do the extra step and it is completely useless.
Come on! Really? Why is this needed? Do these people even know what a regular expression is? Ugh, just to prove how stupid this is, I altered a common e-mail regular expression to catch all of these I have come in contact lately with. Putting things like (at) in your e-mail is useless. It does nothing. A smart programmer’s SPAM bot can probably still find you. If you don’t want your e-mail address to be used by customers, then don’t even post it on your website. There is no need to alter your e-mail address. It doesn’t protect you.
The script I wrote in less than two minutes catches most of these and it really is not that complicated at all. I even threw in a few invalid ones to show you that it could easily parse through text with @ symbols and periods easily. I could spend a few more minutes on it and catch almost anything most companies could use that common users would understand.
If you have a site with addresses like this, please use the following code to go through your company website to find all e-mail addresses and change them to their proper form, or remove them completely.
BELOW is the script written in perl.
Code:
#!/usr/bin/perl @emailList =("l3tt3rsAndNumb3rs\@domain.com","has-dash\@domain.com","hasApostrophe.o'leary\@domain.org","uncommonTLD\@domain.museum","uncommonTLD\@domain.travel","uncommonTLD\@domain.mobi","countryCodeTLD\@domain.uk","countryCodeTLD\@domain.rw","lettersInDomain\@911.com","underscore_inLocal\@domain.net","IPInsteadOfDomain\@127.0.0.1","IPAndPort\@127.0.0.1:25","subdomain\@sub.domain.com","local\@dash-inDomain.com","dot.inLocal\@foo.com","a\@singleLetterLocal.org","singleLetterDomain\@x.org","&*=?^+{}'~\@validCharsInLocal.net","missingDomain\@.com","\@missingLocal.org","missingSign.net","missingDot\@com","two\@\@signs.com","colonButNoPort\@127.0.0.1:","someone-else\@127.0.0.1.26",".localStartsWithDot\@domain.com","localEndsWithDot.\@domain.com","two..consecutiveDots\@domain.com","domainStartsWithDash\@-domain.com","domainEndsWithDash\@domain-.com","TLDDoesntExist\@domain.moc","numbersInTLD\@domain.c0m","missingTLD\@domain.","! \"#$%(),/;<>[]`|\@CharsInLocal.org","invalidCharsInDomain\@! \"#$%(),/;<>_[]`|.org","local\@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org","jim (at) yahoo (dot) com","jim{at}gmail.net","jim{at}gmail{dot}net","jim {at} yahoo {dot} net","jim <AT> yahoo <DOT> net", "jim -AT- yahoo -DOT- net","jimatyahoodotnet"); foreach $code (@emailList) { # if ($code =~ /^([-a-z0-9~!$%^&*_=+}{\'?])+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*(@|at|.at.|\s+at\s+|\s+.at.\s+)([a-z0-9]([-a-z0-9_]?[a-z0-9])*(\.[-a-z0-9_]+)*(\.|dot|.dot.|\s+dot\s+|\s+.dot.\s+)(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z]{2})|([1]?\d{1,2}|2[0-4]{1}\d{1}|25[0-5]{1})((\.|dot|.dot.|\s+dot\s+|\s+.dot.\s+)([1]?\d{1,2}|2[0-4]{1}\d{1}|25[0-5]{1})){3})(:[0-9]{1,5})?$/i) if ($code =~ /^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*(@|at|.at.|\s+at\s+|\s+.at.\s+)([a-z0-9]([-a-z0-9_]?[a-z0-9])*(\.[-a-z0-9_]+)*(\.|dot|.dot.|\s+dot\s+|\s+.dot.\s+)(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z]{2})|([1]?\d{1,2}|2[0-4]{1}\d{1}|25[0-5]{1})((\.|dot|.dot.|\s+dot\s+|\s+.dot.\s+)([1]?\d{1,2}|2[0-4]{1}\d{1}|25[0-5]{1})){3})(:[0-9]{1,5})?$/i) { if ($code =~ /^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*(@)([a-z0-9]([-a-z0-9_]?[a-z0-9])*(\.[-a-z0-9_]+)*(\.)(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z]{2})|([1]?\d{1,2}|2[0-4]{1}\d{1}|25[0-5]{1})(\.([1]?\d{1,2}|2[0-4]{1}\d{1}|25[0-5]{1})){3})(:[0-9]{1,5})?$/i) { print "VALID $code \n"; } else { print "VALID $code -- Real e-mail address is: "; $code =~ s/(@|[\W]at[\W]|\s+at\s+|\s+.at.\s+)/@/ig; $code =~ s/(\.|[\W]dot[\W]|\s+dot\s+|\s+.dot.\s+)/\./ig; if ($code =~ /[^@]/){$code =~ s/at/@/;} if ($code =~ /[^\.]/){$code =~ s/dot/\./g;} print "$code \n"; } } else { print "INVALID $code \n "; } }
Code:
VALID l3tt3rsAndNumb3rs@domain.com VALID has-dash@domain.com VALID hasApostrophe.o'leary@domain.org VALID uncommonTLD@domain.museum VALID uncommonTLD@domain.travel VALID uncommonTLD@domain.mobi VALID countryCodeTLD@domain.uk VALID countryCodeTLD@domain.rw VALID lettersInDomain@911.com VALID underscore_inLocal@domain.net VALID IPInsteadOfDomain@127.0.0.1 VALID IPAndPort@127.0.0.1:25 VALID subdomain@sub.domain.com VALID local@dash-inDomain.com VALID dot.inLocal@foo.com VALID a@singleLetterLocal.org VALID singleLetterDomain@x.org VALID &*=?^+{}'~@validCharsInLocal.net INVALID missingDomain@.com INVALID @missingLocal.org INVALID missingSign.net INVALID missingDot@com INVALID two@@signs.com INVALID colonButNoPort@127.0.0.1: INVALID someone-else@127.0.0.1.26 INVALID .localStartsWithDot@domain.com INVALID localEndsWithDot.@domain.com INVALID two..consecutiveDots@domain.com INVALID domainStartsWithDash@-domain.com INVALID domainEndsWithDash@domain-.com INVALID TLDDoesntExist@domain.moc INVALID numbersInTLD@domain.c0m INVALID missingTLD@domain. INVALID ! "#0(),/;<>[]`|@CharsInLocal.org INVALID invalidCharsInDomain@! "#0(),/;<>_[]`|.org VALID local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.o rg VALID jim (at) yahoo (dot) com -- Real e-mail address is: jim@yahoo.com VALID jim{at}gmail.net -- Real e-mail address is: jim@gmail.net VALID jim{at}gmail{dot}net -- Real e-mail address is: jim@gmail.net VALID jim {at} yahoo {dot} net -- Real e-mail address is: jim@yahoo.net VALID jim <AT> yahoo <DOT> net -- Real e-mail address is: jim@yahoo.net VALID jim -AT- yahoo -DOT- net -- Real e-mail address is: jim@yahoo.net VALID jimatyahoodotnet -- Real e-mail address is: jim@yahoo.net
Comment