You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Nick Burch (JIRA)" <ji...@apache.org> on 2011/03/16 19:39:29 UTC

[jira] Created: (VALIDATOR-292) [PATCH] @localhost and @localhost.localdomain email addresses aren't correctly detected as valid

[PATCH] @localhost and @localhost.localdomain email addresses aren't correctly detected as valid
------------------------------------------------------------------------------------------------

                 Key: VALIDATOR-292
                 URL: https://issues.apache.org/jira/browse/VALIDATOR-292
             Project: Commons Validator
          Issue Type: Bug
          Components: Routines
    Affects Versions: 1.4
            Reporter: Nick Burch
         Attachments: CommonsValidatorLocalhost.patch

Email addresses of the form <something>@localhost and <something>@localhost.localdomain are valid, but the Email Validator doesn't detect this.

The attached patch fixes the underlying issue in the domain validator, and adds unit tests for Domain + Email validation of these.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (VALIDATOR-292) [PATCH] @localhost and @localhost.localdomain email addresses aren't correctly detected as valid

Posted by "Nick Burch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VALIDATOR-292?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Burch updated VALIDATOR-292:
---------------------------------

    Attachment:     (was: CommonsValidatorLocalhost.patch)

> [PATCH] @localhost and @localhost.localdomain email addresses aren't correctly detected as valid
> ------------------------------------------------------------------------------------------------
>
>                 Key: VALIDATOR-292
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-292
>             Project: Commons Validator
>          Issue Type: Bug
>          Components: Routines
>    Affects Versions: 1.4
>            Reporter: Nick Burch
>         Attachments: CommonsValidatorLocalhost.patch
>
>
> Email addresses of the form <something>@localhost and <something>@localhost.localdomain are valid, but the Email Validator doesn't detect this.
> The attached patch fixes the underlying issue in the domain validator, and adds unit tests for Domain + Email validation of these.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VALIDATOR-292) [PATCH] @localhost and @localhost.localdomain email addresses aren't correctly detected as valid

Posted by "Nick Burch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VALIDATOR-292?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13034096#comment-13034096 ] 

Nick Burch commented on VALIDATOR-292:
--------------------------------------

Following discussions with commons committers at the Apache Retreat, I've re-worked the patch to follow the same design as validators such as the ISBN validator. By default, the domain and email validators will continue to declare localhost as invalid (as they always have done). For most people, this will be correct. For anyone running in a development environment (where localhost is wanted to be valid), a boolean can be passed when fetching the validator instance to toggle this. 

New patch for this pattern attached, along with unit tests.

> [PATCH] @localhost and @localhost.localdomain email addresses aren't correctly detected as valid
> ------------------------------------------------------------------------------------------------
>
>                 Key: VALIDATOR-292
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-292
>             Project: Commons Validator
>          Issue Type: Bug
>          Components: Routines
>    Affects Versions: 1.4
>            Reporter: Nick Burch
>         Attachments: CommonsValidatorLocalhost.patch
>
>
> Email addresses of the form <something>@localhost and <something>@localhost.localdomain are valid, but the Email Validator doesn't detect this.
> The attached patch fixes the underlying issue in the domain validator, and adds unit tests for Domain + Email validation of these.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (VALIDATOR-292) [PATCH] @localhost and @localhost.localdomain email addresses aren't correctly detected as valid

Posted by "Nick Burch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VALIDATOR-292?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Burch updated VALIDATOR-292:
---------------------------------

    Attachment: CommonsValidatorLocalhost.patch

> [PATCH] @localhost and @localhost.localdomain email addresses aren't correctly detected as valid
> ------------------------------------------------------------------------------------------------
>
>                 Key: VALIDATOR-292
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-292
>             Project: Commons Validator
>          Issue Type: Bug
>          Components: Routines
>    Affects Versions: 1.4
>            Reporter: Nick Burch
>         Attachments: CommonsValidatorLocalhost.patch, CommonsValidatorLocalhost.patch
>
>
> Email addresses of the form <something>@localhost and <something>@localhost.localdomain are valid, but the Email Validator doesn't detect this.
> The attached patch fixes the underlying issue in the domain validator, and adds unit tests for Domain + Email validation of these.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (VALIDATOR-292) [PATCH] @localhost and @localhost.localdomain email addresses aren't correctly detected as valid

Posted by "Nick Burch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VALIDATOR-292?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Burch updated VALIDATOR-292:
---------------------------------

    Attachment: CommonsValidatorLocalhost.patch

> [PATCH] @localhost and @localhost.localdomain email addresses aren't correctly detected as valid
> ------------------------------------------------------------------------------------------------
>
>                 Key: VALIDATOR-292
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-292
>             Project: Commons Validator
>          Issue Type: Bug
>          Components: Routines
>    Affects Versions: 1.4
>            Reporter: Nick Burch
>         Attachments: CommonsValidatorLocalhost.patch
>
>
> Email addresses of the form <something>@localhost and <something>@localhost.localdomain are valid, but the Email Validator doesn't detect this.
> The attached patch fixes the underlying issue in the domain validator, and adds unit tests for Domain + Email validation of these.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (VALIDATOR-292) [PATCH] @localhost and @localhost.localdomain email addresses aren't correctly detected as valid

Posted by "Nick Burch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VALIDATOR-292?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Burch resolved VALIDATOR-292.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4

Patch applied in r1128342.

> [PATCH] @localhost and @localhost.localdomain email addresses aren't correctly detected as valid
> ------------------------------------------------------------------------------------------------
>
>                 Key: VALIDATOR-292
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-292
>             Project: Commons Validator
>          Issue Type: Bug
>          Components: Routines
>    Affects Versions: 1.4
>            Reporter: Nick Burch
>             Fix For: 1.4
>
>         Attachments: CommonsValidatorLocalhost.patch
>
>
> Email addresses of the form <something>@localhost and <something>@localhost.localdomain are valid, but the Email Validator doesn't detect this.
> The attached patch fixes the underlying issue in the domain validator, and adds unit tests for Domain + Email validation of these.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (VALIDATOR-292) [PATCH] @localhost and @localhost.localdomain email addresses aren't correctly detected as valid

Posted by "Nick Burch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VALIDATOR-292?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007896#comment-13007896 ] 

Nick Burch commented on VALIDATOR-292:
--------------------------------------

Chatting about this with a couple of other users yesterday, I now think that perhaps this needs to be an option.

For a dev environment, or maybe for an intranet setup, you might well want to declare @localhost email addresses to be valid ones. (I certainly do want them to be valid for my use case)

However, for a public, internet facing application, you probably don't want to allow public users to set an @localhost email address, so for that use case you don't want them to be declared as valid.

Maybe the solution is to have two methods. isValid(String) would continue to work as before. isValidLocal(String) would accept @localhost, @localhost.localdomain, and @<machinename> forms. If you only want valid + public email addresses, you'd then continue to use isValid as now. If you'd like to also allow local email addresses, you can additionally call the local one. Any thoughts?

> [PATCH] @localhost and @localhost.localdomain email addresses aren't correctly detected as valid
> ------------------------------------------------------------------------------------------------
>
>                 Key: VALIDATOR-292
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-292
>             Project: Commons Validator
>          Issue Type: Bug
>          Components: Routines
>    Affects Versions: 1.4
>            Reporter: Nick Burch
>         Attachments: CommonsValidatorLocalhost.patch
>
>
> Email addresses of the form <something>@localhost and <something>@localhost.localdomain are valid, but the Email Validator doesn't detect this.
> The attached patch fixes the underlying issue in the domain validator, and adds unit tests for Domain + Email validation of these.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira