Ignore:
Timestamp:
Feb 1, 2011, 1:10:23 PM (12 years ago)
Author:
work@…
Message:
  • resolves issue #289 for mail configuration being too inflexible (it was not possible to use a local mailer on port 25). Now authenticated mail over port 465 is used if 'username' and 'password' are set, otherwise non-authenticated mail over port 25 is used.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/BootStrap.groovy

    r1456 r1459  
    3232                // get configuration
    3333                def config = ConfigurationHolder.config
     34
     35                // set the mail configuration properties in runtime, as
     36                // this is not definable in a .properties file due to the
     37                // fact for the mail properties a map is used
     38                if (config.grails.mail.username && config.grails.mail.password) {
     39                        // use TLS
     40                        config.grails.mail.port = 465
     41                        config.grails.mail.props= [
     42                                "mail.smtp.auth": "true",
     43                                "mail.smtp.socketFactory.port": '465',
     44                                "mail.smtp.socketFactory.class": "javax.net.ssl.SSLSocketFactory",
     45                                "mail.smtp.socketFactory.fallback": "false"
     46                        ]
     47                }
    3448
    3549                // define timezone
Note: See TracChangeset for help on using the changeset viewer.