[imp] Re: Validate Email Address

Richard Carpenter rcarpenter at brandxnet.com
Fri May 28 09:29:01 PDT 2004


Hello,

I added Javascript form validation to compose.inc to check the To, Cc, and
Bcc fields against this regular expression

/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+[\.])+[a-zA-Z0-9]{2,4}$/

I chose to use Javascript because it is close to the source of the problem;
and it is clear where in the overall process of Message Composition my
additions will be executed.

I looked at using Mail_RFC822::parseparseAddressList, adding it following
the is8Bit check in compose.php.  But the email address has already been
processed at that point.  The function does not generate errors on some of
the bad email addresses I want to suppress.  And detecting the error
involves a round-trip to the server which is not as efficient as detecting
errors in the client.

FYI.

Regards,
Richard

Horde: 2.2.1 IMP: 3.2.1



More information about the imp mailing list