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/17 13:06:29 UTC

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

    [ 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