| Railo 4.0.4.000 Error (application) | |
| Message | attribute [to] of the tag [mail] is invalid |
| Detail | Invalid E-Mail Address definition (billy~b...@junk.org) |
| Stacktrace | The Error Occurred in1: <cfmail from="ajme...@gmail.com" Â to="billy~b...@junk.org" subject="tilde test"> |
--
Need help right now? Why not have one of the Railo Team help you directly: http://www.getrailo.com/index.cfm/consulting/
---
You received this message because you are subscribed to the Google Groups "Railo" group.
For more options, visit https://groups.google.com/groups/opt_out.
Â
Â
| Railo 4.1.0.005 Error (application) |
| Message | attribute [to] of the tag [mail] is invalid |
| Detail | Invalid E-Mail Address definition (billy~b...@junk.org) |
| Stacktrace | The Error Occurred in |
1: <cfmail from="ajme...@gmail.com" cc="ame...@psl.com.au" to="billy~b...@junk.org" subject="tilde test"> |
|
I investigated bungness like this from a ColdFusion perspective, but the results (and conclusions) mostly apply to Railo too:
http://adamcameroncoldfusion.blogspot.co.nz/2013/02/email-address-validation-1-in-series.html
(Just FYI, really)
--
Adam
I have filed https://issues.jboss.org/browse/RAILO-2381 and I really hope you guys take Adam's advice and either rip out the validation or make it as minimal as possible -- this is not the first time I and my colleagues have been bitten by Railo rejecting valid email addresses.
Read the stack overflow answer
Justin
--
bennadel has also an interesting blog post to email validation with similar topic.Â
http://www.bennadel.com/blog/265-ColdFusion-Email-Validation-IsValid-And-CFMail-Errors.htm
regards.
bennadel has also an interesting blog post to email validation with similar topic.Â
http://www.bennadel.com/blog/265-ColdFusion-Email-Validation-IsValid-And-CFMail-Errors.htm
regards.
--
Need help right now? Why not have one of the Railo Team help you directly: http://www.getrailo.com/index.cfm/consulting/
---
You received this message because you are subscribed to the Google Groups "Railo" group.
For more options, visit https://groups.google.com/groups/opt_out.
Â
Â
IMO our main issue is the restriction on the attribute validation of cfmail and its inconsistency with IsValid()
The immediate fix should be to run cfmail's validation through the same code that checks IsValid()
Igal
--
typos, misspels, and other weird words brought to you courtesy of my mobile device and its auto-(in)correct feature.
--
Need help right now? Why not have one of the Railo Team help you directly: http://www.getrailo.com/index.cfm/consulting/
---
You received this message because you are subscribed to the Google Groups "Railo" group.
For more options, visit https://groups.google.com/groups/opt_out.
Â
Â
agree, it not only should do a better job it should do a perfect job ;-)
EOF
the problems that I see at this point are:I propose a simple, effective, way to validate email addresses. it is much more liberal than the current tests but can be improved for edge cases (comments welcome).
this is a proof of concept in cfml, to be rewritten in Java and added to the core:
   function isValidEmail( addr ) {
      if ( addr CT '@' ) {
         try {
            createObject( "java", "javax.mail.internet.InternetAddress" ).init( addr );
            return true;
         }
         catch ( ex ) {}
      }
      return false;
   }
attached test script produces the results below (++ green means valid; examples taken from Wikipedia (http://en.wikipedia.org/wiki/Email_address#Valid_email_addresses) and Ben Nadel's post that was mentioned earlier in this thread):
++    som...@zürich.ch++    <som...@zürich.ch> "zyz 09812)(*"++    <som...@zürich.ch> "Some One"++    <som...@zürich.ch> Some One++    <som...@zürich.ch> (Some One)++    Some One <som...@zürich.ch>++    "Some One" <som...@zürich.ch>++    (Some One) som...@zürich.ch
++ Â Â Â user@[IPv6:2001:db8:1ff::a0b:dbd0]++ Â Â Â us...@192.168.0.1
++ Â Â Â "very.u...@.unusual.com"@example.com++ Â Â Â nicean...@example.com++ Â Â Â very....@example.com++ Â Â Â not~tha...@example.com++ Â Â Â a.little.len...@dept.example.com
++ Â Â Â user@[IPv6:2001:db8:1ff::a0b:dbd0]++ Â Â Â "much.more unusual"@example.com
++ Â Â Â "very.u...@.unusual.com"@example.com
++ Â Â Â "very.(),:;<>[]\".VERY.\"very@\\ \"very\".unusual"@strange.example.com++ Â Â Â postbox@com (top-level domains are valid hostnames)++ Â Â Â admin@mailserver1 (local domain name with no TLD)++ Â Â Â !#$%&'*+-/=?^_`{}|~@example.org++ Â Â Â "()<>[]:,;@\\\"!#$%&'*+-/=?^_`{}| ~.a"@example.org++ Â Â Â " "@example.org++ Â Â Â weird."but".ri...@example.com++ Â Â Â user...@example.com-- Â Â Â Abc.example.com
-- Â Â Â A...@b@c...@example.com-- Â Â Â a"b(c)d,e:f;g<h>i[j\k...@example.com
++ Â Â Â just"not"ri...@example.com-- Â Â Â this is"not\all...@example.com-- Â Â Â this\ still\"not\\all...@example.com
--    Some One som...@zürich.ch--    <som...@zürich.ch> "zyz 09812)(*--    <som...@zürich.ch> zyz 09812)(*
-- Â Â Â user@IPv6:2001:db8:1ff::a0b:dbd0-- Â Â Â user@2001:db8:1ff::a0b:dbd0-- Â Â Â-- Â Â Â 1-- Â Â Â @-- Â Â Â .ben-- Â Â Â .-- Â Â Â ...-- Â Â Â -.-.ben++ Â Â Â sa...@hotties.ben++ Â Â Â mary...@equinox.ben++ Â Â Â mrs....@teacup.ben++ Â Â Â libby...@blondes.ben++ Â Â Â d.d....@domain.ben
++ Â Â Â heathe...@gotglue.ben++ Â Â Â anne--...@hackley.ben++ Â Â Â .anna.cooper.@hockeychicks.ben++ Â Â Â -christina.cox-@hollywoodhotties.ben
-- Â Â Â @campuscuties.ben++ Â Â Â -...@justlegal.ben++ Â Â Â .@swank.ben++ Â Â Â 3...@atatime.ben++ Â Â Â /@punctuation.ben++ Â Â Â *@punctuation.ben
++ Â Â Â ben&...@kittens.ben
++ Â Â Â sa...@hot-girls.ben++ Â Â Â an...@got----blondes.ben++ Â Â Â jes...@-cool-girl-.ben++ Â Â Â ju...@cool.beans.ben
++ Â Â Â ju...@brazil..buddies.ben
++ Â Â Â ka...@dorm.-.girls.ben++ Â Â Â la...@-.ben++ Â Â Â mich...@36-24-36.ben++ Â Â Â kim...@ladies.who.smile.ben++ Â Â Â ye@whatwhat
++ Â Â Â j...@cutencurley.xy++ Â Â Â p...@waycute.xyz++ Â Â Â gi...@cowgirls.a4b++ Â Â Â li...@lumpyladies.abcdef++ Â Â Â ja...@ilikeemlarge.abcdefghijEOF
the problems that I see at this point are:
xx    just"not"ri...@example.com -- according to Wikipedia should fail
xx    ju...@brazil..buddies.ben -- I'm not sure that two consecutive dots should be allowed in domain?
Thats really great and IMO that is how it should be!!!! I even wouldn't bother about any edge cases, just let java do the whole stuff. In case java doesn't do the email format validation job according to rfc, it's a java issue, not railos.
Best wishes!