wrote:
> I've read enough about email validation to know that the only real
> validation is having a user respond to a confirmation message you've
> sent them.
Yes. A syntactically valid address may not exist.
> However, I want to store the address temporarily, so I want to make
> sure what is entered is safe to work with.
How does validation help with that? A valid e-mail address that, if used
as-is, may play havoc with a SQL statement is still valid. What would
you tell the user? "Sorry, but your e-mail address would break my
database?" That's hardly reasonable.
What you need to focus on is making a valid address safe, not limiting
what is considered valid. The address will be included in SQL statements
as a quoted literal, yes? So, only other quotes should cause problems
and these can be escaped (two consecutive quotes, or a preceding
backslash, depending on DBMS).
The API for your database client library should include a function that
will escape input such that it won't interfere with an SQL statement.
Some query functions may avoid SQL injection by separating parameters
from the SQL statement itself, thereby preventing values from altering
the structure of that statement. The documentation for your DBMS will
provide more information.
[snip]
Mike