Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E47E81830B for ; Sun, 25 Oct 2015 07:07:43 +0000 (UTC) Received: (qmail 71546 invoked by uid 500); 25 Oct 2015 07:07:43 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 71431 invoked by uid 500); 25 Oct 2015 07:07:43 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 71420 invoked by uid 99); 25 Oct 2015 07:07:42 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Oct 2015 07:07:42 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 7B160180E55 for ; Sun, 25 Oct 2015 07:07:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=6.31 tests=[none] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id dNIEpZayI1lE for ; Sun, 25 Oct 2015 07:07:35 +0000 (UTC) Received: from smtp694.redcondor.net (smtp694.redcondor.net [208.80.206.94]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 8D8F92164D for ; Sun, 25 Oct 2015 07:07:34 +0000 (UTC) Received: from mailproxy12.neonova.net ([137.118.22.77]) by smtp694.redcondor.net ({c8ad8081-e921-4f15-9a53-034744fe478f}) via TCP (outbound) with ESMTP id 20151025070726502_0694 for ; Sun, 25 Oct 2015 07:07:26 +0000 X-RC-FROM: X-RC-RCPT: Received: from [192.168.1.14] (ip72-201-43-179.ph.ph.cox.net [72.201.43.179]) (Authenticated sender: ralph.goers@dslextreme.com) by mailproxy12.neonova.net (Postfix) with ESMTPA id 5533336006B for ; Sun, 25 Oct 2015 03:07:22 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: [validator] EmailValidator accept empty domain names From: Ralph Goers In-Reply-To: Date: Sun, 25 Oct 2015 00:07:21 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <9D946DD1-06B2-42B1-B951-DB37C7BB8A7A@dslextreme.com> References: To: Commons Users List X-Mailer: Apple Mail (2.2104) X-MAG-OUTBOUND: greymail.redcondor.net@137.118.22.64/27 Please see VALIDATOR-376. I just committed the fix for this. FYI - = commons-validator 1.4 does not have this behavior. Ralph > On Oct 22, 2015, at 12:05 AM, S=C3=A9bastien De Nef = wrote: >=20 > Hi everybody, >=20 > First, sorry for my english. >=20 > I tried the EmailValidator component and I was surprised that it = accepts a > domain part that contains only the TLD (like joe@.org). See below a = failing > test. >=20 > Although domainValidator.isValid(domain) returns false > domainValidator.isValid(domain) || domainValidator.isValidTld(domain) > returns true > Is it the source of the problem ? Why does it bypass the domain = validation > if the TLD is valid ? > NB: DomainValidator.isValid already contains isValidTld() >=20 > S=C3=A9bastien >=20 > /** > * Tests the email validation for empty domain. > */ > public void testEmailWithEmptyDomain() { > assertFalse("empty domain name should fail", > emailValidator.commonsValidator("joe@")); > assertFalse("domain name starting with dot should fail", > emailValidator.commonsValidator("joe@.apache.org")); > assertFalse("domain name with only TLD should fail", > emailValidator.commonsValidator("joe@.org")); // yes or no ? > } --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org