Gerrit Amazon SES SMTP configuration

379 views
Skip to first unread message

Philip Stefanov

unread,
May 25, 2017, 4:03:17 PM5/25/17
to Repo and Gerrit Discussion
Hello guys,

I have gerrit running in AWS which was blocked by proofpoint,
and i decided to switch from local postfix to Amazon SES.
My configuration in Gerrit looks like:

gerrit.config

[sendemail]
    smtpServer = email-smtp.us-west-2.amazonaws.com
    smtpServerPort = 465
    smtpEncryption = tsl
    sslVerify = false
    from = SERVER
    smtpUser = MYSMTPUSER

secure.config

[sendemail]
    smtpPass = mypass


After restart my gerrit was trying to send mails via postfix again.
Then i purge postix from my system and now i see in the logs.

[2017-05-25 19:59:40,361] [HTTP-10542] ERROR com.google.gerrit.httpd.restapi.RestApiServlet : Error in PUT /accounts/self/emails/stefanov%40.com
com.google.gerrit.common.errors.EmailException: Mail Error: Connection refused (Connection refused)
    at com.google.gerrit.server.mail.SmtpEmailSender.open(SmtpEmailSender.java:291)
    at com.google.gerrit.server.mail.SmtpEmailSender.send(SmtpEmailSender.java:174)
    at com.google.gerrit.server.mail.OutgoingEmail.send(OutgoingEmail.java:153)
    at com.google.gerrit.server.account.CreateEmail.apply(CreateEmail.java:136)
    at com.google.gerrit.server.account.CreateEmail.apply(CreateEmail.java:103)
    at com.google.gerrit.server.account.CreateEmail.apply(CreateEmail.java:44)

I guess now im trying to connect to the amazon SMTP right?

Same configuration is working in Jira.





Reyad Attiyat

unread,
May 25, 2017, 8:00:10 PM5/25/17
to Repo and Gerrit Discussion
I use AWS SES with Gerrit and it works fine. In my configuration I use:
  smtpEncryption = ssl
and do not include a port. Not sure why tls won't work but maybe try leaving off the port number or using port 2465 which seems to be another port number Amazon uses.
http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-connect.html#smtp-connect-tlswrapper

Philip Stefanov

unread,
May 26, 2017, 1:17:51 PM5/26/17
to Repo and Gerrit Discussion
Hi Reyad,

I did try with smtpEncryption = ssl
and no port then again with port 2465 still getting exception.
What Gerrit version do u use?
Im on 2.13.7

Philip Stefanov

unread,
May 26, 2017, 5:24:47 PM5/26/17
to Repo and Gerrit Discussion
In Confluence i had to use port 25 instead of 465 to get it work.
My workaround for Gerrit for now is to use localhost postfix
and then forward the mails from postfix to Amazon SES
Following this integration steps:
http://docs.aws.amazon.com/ses/latest/DeveloperGuide/postfix.html

Reyad Attiyat

unread,
May 27, 2017, 1:03:34 PM5/27/17
to Repo and Gerrit Discussion
I'm using Gerrit 2.14. Not sure what could be failing. If you can connect with another application it could be SSL/TLS connection Gerrit uses in 2.13 is not using a supported cipher.
Reply all
Reply to author
Forward
0 new messages