Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- PHP and email addresses
- Nick Bell
June 11, 2006, 11:58 am
rate this thread
Re: PHP and email addresses
This isn't foolproof by a long shot. Every printable character except [,
\, and ] is valid in an RFC2822 e-mail address, and even [ and ] can be
used if the address is wrapped in quotes.
The full regular expression required to match an RFC2822 compliant e-mail
address is more than 6,000 characters long, and is one of the gems in
Friedl's book "Mastering Regular Expressions".
It is common to use "*" in an e-mail address, for example. Sendmail has a
feature that uses it. If you send to "firstname.lastname@example.org", it will try find
an alias for "abc*def" exactly. Failing that, it will send the message to
"email@example.com". This is great for spam catching; I can sign up with web
sites as "firstname.lastname@example.org" without defining it, and if I get to much
spam, I just add a specific alias for that which routes to null.
- Tim Roberts, email@example.com
Providenza & Boekelheide, Inc.