commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nick Burch (JIRA)" <>
Subject [jira] Commented: (VALIDATOR-292) [PATCH] @localhost and @localhost.localdomain email addresses aren't correctly detected as valid
Date Thu, 17 Mar 2011 12:06:29 GMT


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:
>             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:

View raw message