kefirfromperm / grails-asynchronous-mail

The Grails Asynchronous Mail plugin
http://grails.org/plugin/asynchronous-mail
21 stars 36 forks source link

Too strict emails validation #79

Closed demon101 closed 6 years ago

demon101 commented 6 years ago

In the plugin for emails validation InternetAddress.validate used. this is a very strict check.

since 2012 you can use international characters above U+007F, encoded as UTF-8.

https://stackoverflow.com/questions/3844431/are-email-addresses-allowed-to-contain-non-alphanumeric-characters

But with current validations, unicode symbols are forbidden at all

From my point of view, better to use apache.commons EmailValidator.

kefirfromperm commented 6 years ago

It would be better to do this changes in grails-core.

demon101 commented 6 years ago

In grails for email validation EmailVlidator used. For internet addresses InternetAddress used. for example, in domains, emails constraint works correct (EmailValidator used)

And I think, this is a bug

kefirfromperm commented 6 years ago

Oh, yes, I understand

kefirfromperm commented 6 years ago

Unfortunately EmailValidator doesn't support mailboxes. :( So I combine two methods.

demon101 commented 6 years ago

@kefirfromperm what is it "mailbox"?

kefirfromperm commented 6 years ago

For example "John Smith \john.smith@example.com\"

demon101 commented 6 years ago

I think, the issue can be closed

demon101 commented 6 years ago

with new version of plugin I have got following error:

16:03:45.676 WARN -- [ main] gEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsApplicationPostProcessor' defined in com.avax.Application: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [grails.boot.config.GrailsApplicationPostProcessor]: Factory method 'grailsApplicationPostProcessor' threw exception; nested exception is org.grails.core.exceptions.GrailsRuntimeException: Failed to introspect class: class grails.plugin.asyncmail.Application 16:03:45.690 ERROR -- [ main] f.s.DefaultListableBeanFactory : Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@77524ca7: startup date [Mon Jan 29 16:03:36 CET 2018]; root of context hierarchy

Looks like, you included application.groovy to the plugin. Could u delete it?

demon101 commented 6 years ago

I have grails 3.2.11 version

kefirfromperm commented 6 years ago

Looks like needs to build the plugin under Grails 3.2.x

demon101 commented 6 years ago

@kefirfromperm could you build it with grails 3.2.11, please?

kefirfromperm commented 6 years ago

Try 2.0.1-3.2.x