SMTP setting error using Gmail account

714 views
Skip to first unread message

Derick Woo

unread,
Sep 12, 2014, 11:43:30 AM9/12/14
to repo-d...@googlegroups.com
Dear all. 

When setting up my gerrit server, I faced some problem for smtp mail configuration using Gmail. 

'semdemail' configuration in gerrit.config is as below. 

---------------------------------------------------------
[sendemail]
        smtpServer = smtp.gmail.com
        smtpServerPort = 465
        smtpEncryption = SSL
        sslVerify = false
        smtpUser=[MY_ID]@gmail.com
        smtpPass=[MY_PASSWORD]
---------------------------------------------------------

I double checked my google account and its password. 
However, below "Username and Password not accepted." is occurred continually. 

---------------------------------------------------------  
[2014-09-13 00:28:27,692] ERROR com.google.gerrit.httpd.restapi.RestApiServlet : Error in PUT /accounts/self/emails/agai...@gmail.com
com.google.gerrit.common.errors.EmailException: Mail Error: SMTP server rejected auth: 535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8 http://support.google.com/mail/bin/answer.py?answer=14257 iu10sm4204923pbd.57 - gsmtp

        at com.google.gerrit.server.mail.SmtpEmailSender.open(SmtpEmailSender.java:276)
        at com.google.gerrit.server.mail.SmtpEmailSender.send(SmtpEmailSender.java:173)
        at com.google.gerrit.server.mail.OutgoingEmail.send(OutgoingEmail.java:124)
---------------------------------------------------------  

I also set the 'Access for less secure apps' is enabled but the result is the same. 
I googled a lot but I can't find the _right_ solution for me. 

If you let me know the reason or solution,
I would be really happy. :)

Thank you  in advances. 

Derick. 

Doug Kelly

unread,
Sep 18, 2014, 10:22:23 AM9/18/14
to repo-d...@googlegroups.com
Hi Derick,

I would suggest using postfix or some other MTA locally on the Gerrit server, and then have Postfix relay out through Gmail.  There's a few reasons for this: one, I know postfix can be configured to relay that way (it's been a while, but I'm fairly sure I've done it), and two, I personally would recommended to use a local server for sending email with Gerrit (and I think others may agree with me).  I've seen Gerrit back up with tasks to send emails when something goes wrong sending an email, and there's no way to flush the mail queue (aside from a restart) or manage it manually: if the tasks queue up, you have to restart to continue sending emails.

I recall there are other benefits to not connecting to external mail servers as well, but I may be misremembering.

--Doug


On Friday, September 12, 2014 10:43:30 AM UTC-5, Derick Woo wrote:
Dear all. 

When setting up my gerrit server, I faced some problem for smtp mail configuration using Gmail. 

'semdemail' configuration in gerrit.config is as below. 

---------------------------------------------------------
[sendemail]
        smtpServer = smtp.gmail.com
        smtpServerPort = 465
        smtpEncryption = SSL
        sslVerify = false
        smtpUser=[MY_ID]@gmail.com
        smtpPass=[MY_PASSWORD]
---------------------------------------------------------

I double checked my google account and its password. 
However, below "Username and Password not accepted." is occurred continually. 

---------------------------------------------------------  
[2014-09-13 00:28:27,692] ERROR com.google.gerrit.httpd.restapi.RestApiServlet : Error in PUT /accounts/self/emails/again4you...@gmail.com
com.google.gerrit.common.errors.EmailException: Mail Error: SMTP server rejected auth: 535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8 http://support.google.com/mail/bin/answer.py?answer=14257 iu10sm4204923pbd.57 - gsmtp

        at com.google.gerrit.server.mail.SmtpEmailSender.open(SmtpEmailSender.java:276)
        at com.google.gerrit.server.mail.SmtpEmailSender.send(SmtpEmailSender.java:173)
        at com.google.gerrit.server.mail.OutgoingEmail.send(OutgoingEmail.java:124)
Reply all
Reply to author
Forward
0 new messages