Uploaded image for project: 'Commons Validator'
  1. Commons Validator
  2. VALIDATOR-85

EmailValidator - valid email address fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Nightly Builds
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 23990

    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

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--email.diff
          3 kB
          Donald J. Brown

        Activity

          People

            Unassigned Unassigned
            vsr77@yahoo.com Srirajesh
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: