[ 
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

Reply via email to