1

我想将 Rundeck 配置为允许电子邮件通知。

rundeck-config.properties的是:

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"]

当我运行作业时,我得到的错误是:

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"

我尝试了在 Google 上可以找到的所有内容,但错误仍然存​​在。

我也试过了telnet smtp.gmail.com 465,它有效

有人可以帮助我吗?

4

1 回答 1

0

您必须使用 .groovy 文件,因为 .properties 文件不支持道具

下面是我运行良好的 rundeck-config.groovy 文件

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"

参考:https ://github.com/rundeck/rundeck/issues/1607

于 2016-08-04T07:41:58.647 回答