gpc / grails-mail

The Grails Mail Plugin
http://grails.org/plugin/mail
Apache License 2.0
45 stars 85 forks source link

Implemented workaround for props configuration being translated into nested map in Grails-3.0.1, which results in mail not sent #26

Closed puneetbehl closed 4 years ago

puneetbehl commented 9 years ago

The Mail plugin is not working with Grails-3.0.1, It seems like the issue is with props: [] in mail configuration and javaMailProperties is not set properly for JavaMailSenderImpl due to

props: [
 'mail.smtp.auth'                  : true,
 'mail.smtp.socketFactory.port'    : 465,
 'mail.smtp.socketFactory.class'   : 'javax.net.ssl.SSLSocketFactory',
 'mail.smtp.socketFactory.fallback': 'false'
]

is transformed into

props: [ mail: [ smtp: [ auth : true, socketFactory: [ port:465, class: 'javax.net.ssl.SSLSocketFactory', fallback: 'false' ] ] ] ]

Here is the github link for the workaround I've implemented https://github.com/puneetbehl/grails3mail-plugin/blob/master/src/main/groovy/grails/plugins/mail/MailGrailsPlugin.groovy