Bug 868016 - Feature request - Make email validation pluggable by user's custom rule in EPP 6.
Feature request - Make email validation pluggable by user's custom rule in EP...
Product: JBoss Enterprise Portal Platform 6
Classification: JBoss
Component: Portal (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: ---
: 6.1.0
Assigned To: Default User
Depends On:
  Show dependency treegraph
Reported: 2012-10-18 17:31 EDT by Gary Hu
Modified: 2013-11-07 09:25 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-11-07 09:25:28 EST
Type: Feature Request
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Gary Hu 2012-10-18 17:31:09 EDT
The current EPP 5.2.2 has a default rule to validate email address. Here is the source code http://anonsvn.jboss.org/repos/gatein/epp/portal/tags/EPP_5_2_2_GA/webui/core/src/main/java/org/exoplatform/webui/form/validator/EmailAddressValidator.java

 private boolean validateLocalPart(char[] localPart)
      if(localPart.length == 0 || !Character.isLetter(localPart[0]) || !Character.isLetterOrDigit(localPart[localPart.length - 1]))
         return false;

      for(int i = 1; i < localPart.length -1; i++)
         char c = localPart[i];
         char next = localPart[i+1];

         if(Character.isLetterOrDigit(c) || (isLocalPartSymbol(c) && Character.isLetterOrDigit(next)))
            return false;
      return true;

It only allow letter, digit and symbols "." and "_" in the local part. It also forces the first character to be letter and the last character to be letter or digit.

1) Can we review the validation rule? Are we following any spec for the validation rule?

2) Can we create a mechanism in EPP 6 that allows user to plug in their own custom validation rule such as regular expression as we've done for username/groupmembership?
Comment 2 Boleslaw Dawidowicz 2013-05-08 19:22:19 EDT
Implemented upstream. Documentation remaining.
Comment 3 Viliam Rockai 2013-05-21 08:31:22 EDT
Since this was just an extension of existing solution, just a very minor addition to documentation was needed. It's done here:
Comment 5 vramik 2013-07-08 17:15:02 EDT
Verified in er02

Note You need to log in before you can comment on or make changes to this bug.