2

I'm going crazy with rundeck and this grails configuration for mail, I'm trying to connect to my smtp server running STARTSSL on 587 (self signed cert) here is my configuration:

grails.mail.host=smtp.myhost.com
grails.mail.port=587
grails.mail.username=username
grails.mail.password=password
grails.mail.smtp.auth="true"
grails.mail.starttls.enable=true
grails.mail.props["mail.smtp.auth":"true","mail.smtp.starttls.enable":"true","mail.smtp.socketFactory.port":"587"``,"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory","mail.smtp.socketFactory.fallback":"false,"mail.smtp.port":"587"]
grails.mail.default.from=rundeck@myhost.com

I read all the issues about it on Stack Overflow but without result...

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Nhoya
  • 413
  • 1
  • 5
  • 11

1 Answers1

2

Setting the grails.mail.props in rundeck-config.properties won't work, you have to convert to groovy format.

See these links:

Here is an example:

grails {
  mail {
    host="smtp.gmail.com"
    port="465"
    username="rundecktest@gmail.com"
    password="..."
    props=["mail.smtp.auth":"true",
             "mail.smtp.socketFactory.port":"465",
             "mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
             "mail.smtp.socketFactory.fallback":"false"]
  }
}
grails.mail.default.from="rundecktest@gmail.com"
Greg Schueler
  • 378
  • 2
  • 8
  • Do you need to convert the whole rundeck-config.properties to groovy in order to work? – Gilroy May 29 '19 at 02:49
  • No. You should create a separate file with just SMTP settings in /etc/rundeck/ dir https://stackoverflow.com/questions/30601574/rundeck-gmail-smtp-not-working/63922280#63922280 For Rundeck inside a Docker container: https://stackoverflow.com/a/76058536/11130638 – Kirill Vakhrushev Apr 19 '23 at 20:28