From: Anjo K. <kr...@lo...> - 2007-01-24 19:58:49
|
And actually, yes, you can mailto:ak which would resolve - at least on a unix system - to ak@localhost. So it's not even a bug. It's merely that maybe adminEmail shouldn't run through the validation. Am 24.01.2007 um 20:55 schrieb Anjo Krank: > I made this patch to allow for ak@localhost which was not allowed > previously and is perfectly valid, and needed in particular with the > admin email. That the @ ended up the regex {0,1} is a probably a bug, > but given that umlauts are allowed in emails now (correct me if I'm > wrong, they just need to be escaped) and given that the regex isn't > the most clearest piece of code, it's hopefully understandable... > > My guess too is that we need some more methods like > isEmailWithFullDomain, escapeEmail etc. > > Cheers, Anjo > > Am 24.01.2007 um 20:47 schrieb Mike Schrag: > >> I believe (and as far as I can parse that grammar in 3.4.1) that >> foobar is a valid domain. You can setup your DNS to respond to >> whatever you want. It MIGHT be worth adding a second validation >> method that lets you pass in a boolean whether you want to allow it >> or not. Even though it's RFC-valid, I can see that most people using >> this method would expect otherwise. >> >> On Jan 24, 2007, at 1:54 PM, Kieran Kelleher wrote: >> >>> Is foobar a valid RFC 2822 email address (http://rfc.net/ >>> rfc2822.html)?, then if not change the code below in ERJavaMail and >>> submit patch to Anjo I guess. If it is valid, then implement your >>> own >>> more strict validation regex. >>> >>> >>> /** >>> *<code>EMAIL_VALIDATION_PATTERN</ >>> code>isaregexppatternthatisusedtovalidateemails. >>> */ >>> // RFC 2822 token definitions for valid email - only used together >>> to form a java Pattern object: >>> private static final String sp = "!#$%&'*+-/=?^_`{|}~"; >>> private static final String atext = "[a-zA-Z0-9" + sp + "]"; >>> private static final String atom = atext + "+"; // one or more >>> atext >>> chars >>> private static final String dotAtom = "\\." + atom; >>> private static final String localPart = atom + "(" + dotAtom + ") >>> *"; // one atom followed by 0 or more dotAtoms. >>> // RFC 1035 tokens for domain names: >>> private static final String letter = "[a-zA-Z]"; >>> private static final String letDig = "[a-zA-Z0-9]"; >>> private static final String letDigHyp = "[a-zA-Z0-9-]"; >>> private static final String rfcLabel = letDig + letDigHyp + >>> "{0,61}" >>> + letDig; >>> private static final String domain = rfcLabel + "((\\." + >>> rfcLabel + >>> ")*\\." + letter + "{2,6}){0,1}"; >>> // Combined together, these form the allowed email regexp >>> allowed by >>> RFC 2822: >>> private static final String EMAIL_VALIDATION_PATTERN = "^" + >>> localPart + "(@" + domain + "){0,1}$"; >>> >>> >>> >>> On Jan 24, 2007, at 1:07 PM, Denis Frolov wrote: >>> >>>> I've done that. The problem is that 'foobar' is considered valid >>>> intentially >>>> - this is not a programming error. >>>> >>>> The pattern is "^" + localPart + "(@" + domain + "){0,1}$"; >>>> (added in rev. >>>> 1.24 by Anjo). >>>> >>>> The real question is why did Anjo do that and if 'foobar' is indeed >>>> needs to >>>> be valid do I need to add my own check and change all my calls in >>>> all apps >>>> to use my own logic that would consider 'foobar' to be invalid e- >>>> mail >>>> format. >>>> >>>> on 1/24/07 7:05 PM, Kieran Kelleher at kie...@ma... wrote: >>>> >>>>> Look at the source ...... there is a big regex there. Try and >>>>> troubleshoot it (compare diff to an old working version). >>>>> >>>>> On Jan 24, 2007, at 10:28 AM, Denis Frolov wrote: >>>>> >>>>>> Hello, >>>>>> >>>>>> I am using ERJavaMail.sharedInstance().isValidEmail to validate >>>>>> user entered >>>>>> emails. Starting with ERJavaMail rev. 1.24 'foobar' is a valid >>>>>> email which >>>>>> seems rather odd to me since user is now allowed to enter emails >>>>>> without >>>>>> domains. >>>>>> >>>>>> Why was this change needed and is there any other proper way to >>>>>> validate >>>>>> emails using Wonder? >>>>>> >>>>>> --- >>>>>> Denis Frolov >>>>>> Design Maximum MA >>>>>> >>>>>> Tel: +7 863 2648211 >>>>>> Fax: +7 863 2645229 >>>>>> Web: http://www.designmaximum.com >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> ----------------------------------------------------------------- >>>>>> - >>>>>> - >>>>>> - >>>>>> -- >>>>>> --- >>>>>> Take Surveys. Earn Cash. Influence the Future of IT >>>>>> Join SourceForge.net's Techsay panel and you'll get the chance to >>>>>> share your >>>>>> opinions on IT & business topics through brief surveys - and earn >>>>>> cash >>>>>> http://www.techsay.com/default.php? >>>>>> page=join.php&p=sourceforge&CID=DEVDEV >>>>>> _______________________________________________ >>>>>> Wonder-disc mailing list >>>>>> Won...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/wonder-disc >>>>> >>>>> >>>> >>>> >>>> --- >>>> Denis Frolov >>>> Design Maximum MA >>>> >>>> Tel: +7 863 2648211 >>>> Fax: +7 863 2645229 >>>> Web: http://www.designmaximum.com >>>> >>>> >>>> >>> >>> >>> -------------------------------------------------------------------- >>> - >>> - >>> --- >>> Take Surveys. Earn Cash. Influence the Future of IT >>> Join SourceForge.net's Techsay panel and you'll get the chance to >>> share your >>> opinions on IT & business topics through brief surveys - and earn >>> cash >>> http://www.techsay.com/default.php? >>> page=join.php&p=sourceforge&CID=DEVDEV >>> _______________________________________________ >>> Wonder-disc mailing list >>> Won...@li... >>> https://lists.sourceforge.net/lists/listinfo/wonder-disc >> >> >> >> --------------------------------------------------------------------- >> - >> --- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to >> share your >> opinions on IT & business topics through brief surveys - and earn >> cash >> http://www.techsay.com/default.php? >> page=join.php&p=sourceforge&CID=DEVDEV >> _______________________________________________ >> Wonder-disc mailing list >> Won...@li... >> https://lists.sourceforge.net/lists/listinfo/wonder-disc > > > ---------------------------------------------------------------------- > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Wonder-disc mailing list > Won...@li... > https://lists.sourceforge.net/lists/listinfo/wonder-disc |