Google Apps SMTP Server Configuration

1,559 views
Skip to first unread message

Eric Schoonover

unread,
Jun 14, 2010, 2:17:32 AM6/14/10
to Repo and Gerrit Discussion
I'm trying to configure GIT to send emails via Google's SMTP servers
using an email address/domain that I have setup with Google Apps.

I have been able to get SSMTP working with this configuration:

root=ger...@mydomain.com
mailhub=smtp.gmail.com:587
AuthUser=ger...@mydomain.com
AuthPass=****
UseSTARTTLS=YES
UseTLS=YES

My Gerrit configuration looks like:

[sendemail]
from = ${user} <ger...@mydomain.com>
smtpServer = smtp.gmail.com
smtpServerPort = 587
smtpUser = ger...@mydomain.com
smtpPass = ****
smtpEncryption = tls

Gerrit is unable to send mails and I am getting this error in the UI
after quite awhile (> 30 seconds), I don't see anything in [gerrit2]/
logs/error_log:

ERROR com.google.gerrit.httpd.rpc.account.AccountSecurityImpl :
Cannot send email verification message to us...@mydomain.com
com.google.gerrit.server.mail.EmailException: Connection closed
without indication.
at
com.google.gerrit.server.mail.SmtpEmailSender.open(SmtpEmailSender.java:
201)
at
com.google.gerrit.server.mail.SmtpEmailSender.send(SmtpEmailSender.java:
107)
at
com.google.gerrit.server.mail.OutgoingEmail.send(OutgoingEmail.java:
202)
at
com.google.gerrit.httpd.rpc.account.AccountSecurityImpl.registerEmail(AccountSecurityImpl.java:
267)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)

Any ideas on what I need to change in the Gerrit configuration to get
this working?

- Eric

Rob Heittman

unread,
Jun 14, 2010, 2:53:29 AM6/14/10
to Eric Schoonover, Repo and Gerrit Discussion
Hi Eric -- mine looks like this and works; I got the same error as you until I changed to to SSL instead of TLS.

[sendemail]
smtpServer = smtp.gmail.com
smtpServerPort = 465
smtpEncryption = SSL 
sslVerify = false
        smtpUser = us...@mygoogleappsdomain.com
smtpPass = *****

Antony Stubbs

unread,
Jun 14, 2010, 3:12:05 AM6/14/10
to Rob Heittman, Eric Schoonover, Repo and Gerrit Discussion
Try logging in the gmail account through the web - sometimes accounts get disabled until a human passes a captcha test - Happened to me twice.

Shawn Pearce

unread,
Jun 14, 2010, 10:02:46 AM6/14/10
to Antony Stubbs, Rob Heittman, Eric Schoonover, Repo and Gerrit Discussion
FWIW, I use Google Apps domain Gmail for review.source.android.com,
but I do it by having the Gerrit Code Review process send to the local
SMTP server. The local SMTP server is Postifx, configured to relay
through Gmail. This configuration gives pretty good response times,
since the message enqueue occurs on the web handler thread. :-)
Reply all
Reply to author
Forward
0 new messages