Commons Validator
  1. Commons Validator
  2. VALIDATOR-85

EmailValidator - valid email address fails

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Nightly Builds
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      I just downloaded the head version (1.10) of <I>EmailValidator.java</I> from
      http://cvs.apache.org/...

      1. For a valid email address with symbolic name like <B>someone@yahoo.com<B>,
      the output from isValid() method always returns <B>FALSE</B>.

      2. For an email address with IP address like <B>someone@216.109.118.76<B>, the
      ouput from isValid() method always returns <B>FALSE</B>.

      NB: 216.109.118.76 is one of yahoo's mirror ip address.

      When I looked at the code, I figured out the following points:
      1. In the method isValidSymbolicDomain(), the matcher uses ATOM_PATTERN instead
      of DOMAIN_PATTERN. For eg, <B>yahoo.com</B> is a valid DOMAIN_PATTERN but not a
      valid ATOM_PATTERN as per the regular expressions used for those strings.

      2. In the method isValidDomain(), the check for <B>symbolic</B> variable should
      be inside the "else block" as symbolic will always be "false" for domains that
      matches IP_DOMAIN_PATTERN.

      After modifying the code in the above two places, isValid() method returns true
      for the above metioned email addresses.

      Thanks
      Srirajesh

        Activity

        Srirajesh created issue -
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 23990 12341038
        Henri Yandell made changes -
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Affects Version/s Nightly Builds [ 12311648 ]
        Component/s Validator [ 12311135 ]
        Key COM-887 VALIDATOR-85
        Project Commons [ 12310458 ] Commons Validator [ 12310494 ]
        Henri Yandell made changes -
        Affects Version/s Nightly Builds [ 12311748 ]
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Srirajesh
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development