Bug 868016

Summary: Feature request - Make email validation pluggable by user's custom rule in EPP 6.
Product: [JBoss] JBoss Enterprise Portal Platform 6 Reporter: Gary Hu <ghu>
Component: PortalAssignee: Default User <jbpapp-maint>
Status: CLOSED CURRENTRELEASE QA Contact: vramik
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: bdawidow, epp-bugs, mweiler, vramik
Target Milestone: ---   
Target Release: 6.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-07 14:25:28 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gary Hu 2012-10-18 21:31:09 UTC
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)))
         {
            continue;
         }
         else
         {
            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 23:22:19 UTC
Implemented upstream. Documentation remaining.

Comment 3 Viliam Rockai 2013-05-21 12:31:22 UTC
Since this was just an extension of existing solution, just a very minor addition to documentation was needed. It's done here:
https://docs.jboss.org/author/display/GTNPORTAL36/Configuration+of+custom+data+validators

Comment 5 vramik 2013-07-08 21:15:02 UTC
Verified in er02