2

I'm setting up Rundeck but can't get notification emails working. Here's the config:

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

and here's the error:

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;

I've poked holes at both 465 and 587 in the (Windows) firewall (in fact, I turned it off completely temporarily and got the same exception).

Burt Beckwith
  • 75,342
  • 5
  • 143
  • 156
sming
  • 801
  • 2
  • 12
  • 25
  • Try to connect to the mail server using telnet ?Like `telnet smtp.gmail.com 465`. Try this command and see if you are able to connect.. – Racer Jun 04 '15 at 11:56
  • @Racer yep it connects (i.e. I do not get a "Could not open..." message) – sming Jun 06 '15 at 20:01
  • I am having problems configuring gmail smtp on Rundeck. Where should I put the smtp settings? – Lucas Rezende May 05 '16 at 17:20
  • Check my answer: http://stackoverflow.com/questions/37057245/rundeck-gmail-smtp-not-working- smtp-gmail-com-unknown-host/38761317#38761317 – yogs Aug 04 '16 at 07:45

1 Answers1

3

Just for the record answer: Currently you need to create a rundeck-config.groovy file (at /etc/rundeck path) with Gmail server configuration (only the email configuration) like this:

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"

The main reason of this is that .config file by design doesn't support extended features by external provider like gmail or office365. Check this.

MegaDrive68k
  • 3,768
  • 2
  • 9
  • 51