Rundeck Gmail SMTP not Working - smtp.gmail.com Un

2019-06-01 01:42发布

问题:

I want to configure Rundeck to allow e-mail notifications.

My rundeck-config.properties is:

grails.mail.host = "smtp.gmail.com"
grails.mail.username = "name@domain.com"
grails.mail.port = 465
grails.mail.password = "******"
grails.mail.props = ["mail.smtp.starttls.enable":"true","mail.smtp.auth":"true","mail.smtp.socketFactory.port":"465","mail.smtp.socketFactory.fallback":"false"]

When I run the Job, the error I get is:

2016-05-05 14:49:30,557 ERROR NotificationService - Error sending notification email to me@gmail.com for Execution 11: Mail ser
ver connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: "smtp.gmail.com", 465; ti
meout -1;
  nested exception is:
        java.net.UnknownHostException: "smtp.gmail.com". Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host,
port: "smtp.gmail.com", 465; timeout -1;
  nested exception is:
        java.net.UnknownHostException: "smtp.gmail.com"

I tried everything I could find on Google but the error keeps the same.

I also tried to telnet smtp.gmail.com 465 and it works

Could someone help me?

回答1:

You Must need to use .groovy file as props is not supported in .properties file

below is my rundeck-config.groovy file which is working fine

loglevel.default="INFO"
rdeck.base="/var/lib/rundeck"
rss.enabled=false

dataSource.dbCreate = "update"
dataSource.url = "jdbc:h2:file:/var/lib/rundeck/data/rundeckdb;MVCC=true;TRACE_LEVEL_FILE=4"
grails {
  mail {
        host = "smtp.gmail.com"
        username = "************"
        port = 587
        password = "*********"
        props = ["mail.smtp.starttls.enable":"true","mail.smtp.auth":"true","mail.smtp.socketFactory.port":"587","mail.smtp.socketFactory.fallback":"false"]
  }
}
grails.serverURL="http://***.***.***.***:4440"

Reference: https://github.com/rundeck/rundeck/issues/1607

  • https://github.com/rundeck/rundeck/wiki/Faq#how-do-i-configure-a-smtp-server-for-email-notifications
  • https://github.com/rundeck/rundeck/wiki/Faq#how-do-i-convert-my-rundeck-config-file-to-groovy
  • https://github.com/rundeck/rundeck/wiki/Faq#how-do-i-specify-a-new-config-file-location


标签: smtp rundeck