【问题标题】:Rundeck Gmail SMTP not Working - smtp.gmail.com Unknown HostRundeck Gmail SMTP 不工作 - smtp.gmail.com 未知主机
【发布时间】:2016-08-04 15:41:58
【问题描述】:

我想将 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,它有效

有人可以帮我吗?

【问题讨论】:

  • 尝试通过 sendmail 发送示例邮件并检查您的服务器是否可以使用 465 发送邮件...也尝试 587 或 25,因为某些 ISP 会阻止某些端口,但是 465 应该已经通过..
  • @LeoPrince,我如何测试“sendmail”?它在 Rundeck 内吗?谢谢你的回复。
  • 不需要发送邮件,可以使用邮件命令查看。 cyberciti.biz/faq/howto-write-command-to-send-receive-mail
  • @LucasRezende 我有一些问题。你有没有找到相同的解决方案?

标签: smtp rundeck


【解决方案1】:

你必须使用 .groovy 文件,因为 .properties 文件不支持 props

下面是我运行良好的 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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-07-02
    • 2019-05-30
    • 1970-01-01
    • 1970-01-01
    • 2013-03-10
    • 2016-08-14
    • 2012-12-04
    • 1970-01-01
    相关资源
    最近更新 更多