Ticket #188 (closed defect: fixed)

Opened 6 years ago

Last modified 6 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:
Hardware: Operating system:
Product: URL:


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

comment:1 Changed 6 years ago by robert@…

  • Owner changed from Robert@… to work@…
  • Status changed from new to assigned

I've implemented email validation using the default grails email validator:

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.

comment:2 Changed 6 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})$';

comment:3 Changed 6 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.

comment:4 Changed 6 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.