Grails Rundeck GMail SMTP不工作
我正在设置Rundeck,但无法使通知电子邮件正常工作。以下是配置:Grails Rundeck GMail SMTP不工作,grails,gmail,rundeck,Grails,Gmail,Rundeck,我正在设置Rundeck,但无法使通知电子邮件正常工作。以下是配置: grails.mail.host = "smtp.gmail.com" grails.mail.port = 465 grails.mail.username = "peter@blahblah.com" grails.mail.password = "blahblahblah" grails.mail.props = ["mail.smtp.starttls.enable":"true","mail.smtp.auth":"
grails.mail.host = "smtp.gmail.com"
grails.mail.port = 465
grails.mail.username = "peter@blahblah.com"
grails.mail.password = "blahblahblah"
grails.mail.props = ["mail.smtp.starttls.enable":"true","mail.smtp.auth":"true","mail.smtp.socketFactory.port":"465","mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory","mail.smtp.socketFactory.fallback":"false"]
下面是错误:
2015-06-02 12:17:49,142 ERROR NotificationService - Error sending notification email to peter@blahblah.com for Execution 29: Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: "smtp.gmail.com", 465; timeout -1;
我已经在(Windows)防火墙的465和587上戳了个洞(事实上,我暂时完全关闭了它,得到了相同的例外)。只是为了记录答案:目前你需要创建一个带有Gmail服务器配置(仅电子邮件配置)的
rundeck config.groovy
文件(位于/etc/rundeck
路径)像这样:
grails {
mail {
host = "smtp.gmail.com"
username = "username@gmail.com"
port = 587
password = "example"
props = ["mail.smtp.starttls.enable":"true","mail.smtp.auth":"true","mail.smtp.socketFactory.port":"587","mail.smtp.socketFactory.fallback":"false"]
}
}
grails.mail.default.from = "username@gmail.com"
其主要原因是,
.config
file by design不支持外部提供商(如gmail或office365)提供的扩展功能。检查。尝试使用telnet连接到邮件服务器,如telnet smtp.gmail.com 465
。尝试此命令并查看您是否能够连接..@Racer yep它连接(即,我没有收到“无法打开…”消息)我在Rundeck上配置gmail smtp时遇到问题。我应该把smtp设置放在哪里?检查我的答案:smtp gmail com未知主机/38761317#38761317