Ticket #188 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Implement rfc 2822 compliant email validation

Reported by: work@… Owned by: work@…
Priority: major Milestone: 0.6.1
Component: General Version:
Keywords: Cc:
Product: Operating system:
URL: Hardware:

Description

Currently, email fields are not being checked throughout the application. Implement RFC 2822 compliant email validation in the account creation page as well as in the login bar's account creation form.

Change History

Changed 3 years ago by robert@…

  • status changed from new to assigned
  • owner changed from Robert@… to work@…

I've implemented email validation using the default grails email validator:
 http://grails.org/doc/latest/ref/Constraints/email.html

As explained in the (very brief) documentation, this doesn't cover all email addresses, but I think it is enough for our purposes. A discussion on the tradeoffs with email validation can be found on  http://www.regular-expressions.info/email.html.

Please test whether this meets your requirements.

Changed 3 years ago by work@…

  • owner changed from work@… to robert@…

At TomTom? I created the following (PHP) regular expression to validate the email addresses to be RFC 2822 compliant. Would it be possible to use (a rewrite of) this regular expression in GSCF?

/**

  • @var string */

protected $strRegularExpression = '([a-zA-Z0-9\.\_\~\+\=\*\'\-]+)([\.])@((([a-zA-Z0-9_\-]+)([\.]{1}))+)([a-zA-Z]{2,4})$';

Changed 3 years ago by robert@…

  • owner changed from robert@… to work@…

I'd really prefer using code already built in to grails, that has been tested and used by many people instead of creating our own validator and having to maintain it.

Besides, the regex provided doesn't cover all RFC2822 addresses (e.g. "spaces may be quoted"@example.com or !#$%&'*+-/=.?_`{|}~@[IPv6:0123:4567:89AB:CDEF:0123:4567:89AB:CDEF]).

But I think we need a way to have a basic e-mail address check, instead of a complete 100% waterproof validation. If the users don't receive the email because they provided a wrong email address, they will never be able to login.

The difficulties with email validation are also discussed at the link I gave earlier:  http://www.regular-expressions.info/email.html.

Changed 3 years ago by work@…

  • status changed from assigned to closed
  • resolution set to fixed

Yeah you're right, and it seems to work okay as well.. closing this issue.

Note: See TracTickets for help on using tickets.