Warm tip: This article is reproduced from serverfault.com, please click

smtp-Gerrit无法发送电子邮件验证消息504

(smtp - Gerrit Cannot send email verification message 504)

发布于 2020-06-16 06:54:10

我正在使用Gerrit 3.2.1

在尝试了所有可以配置gerrit.sendemail的操作后,我无法发送验证邮件

[sendemail]
        enable = true
        smtpServer = smtp.offce365.com
        smtpServerPort = 587
        smtpEncryption = ssl
        sslVerify = false
        smtpUser = gerrit@gerritserver.com
        smtpPass = pswd

我指的是https://groups.google.com/forum/#!msg/repo-discuss/RWvdXR-Z4nA/1USSK1F6AAAJ \

但似乎我遇到了另一个问题,

对于加密,根据Office 365,SMTP使用STARTTLS,但似乎总是失败。我尝试了ssl,tls,但均无效。我还尝试了端口25。

[2020-06-16T14:33:53.834+0800] [WorkQueue-2] INFO com.googlesource.gerrit.plugins.deleteproject.fs.RepositoryCleanupTask : Cleaning up expired git repositories... Done
[2020-06-16T14:35:32.927+0800] [plugin-manager-preloader] INFO com.googlesource.gerrit.plugins.manager.OnStartStop : 66 plugins successfully pre-loaded
[2020-06-16T14:36:13.420+0800] [HTTP PUT /accounts/self/emails/name%40emailhost.com (flynn from 127.0.0.1)] ERROR com.google.gerrit.server.restapi.account.CreateEmail : Cannot send email verification message to name@emailhost.com
com.google.gerrit.exceptions.EmailException: Mail Error: Connection timed out (Connection timed out)
        at com.google.gerrit.server.mail.send.SmtpEmailSender.open(SmtpEmailSender.java:437)
        at com.google.gerrit.server.mail.send.SmtpEmailSender.send(SmtpEmailSender.java:207)
        at com.google.gerrit.server.mail.send.OutgoingEmail.send(OutgoingEmail.java:225)
        at com.google.gerrit.server.restapi.account.CreateEmail.apply(CreateEmail.java:164)
        at com.google.gerrit.server.restapi.account.CreateEmail.apply(CreateEmail.java:121)
        at com.google.gerrit.server.restapi.account.CreateEmail.apply(CreateEmail.java:71)
Questioner
yunfei
Viewed
11
uncletall 2020-06-17 13:59:16

和邮件列表上的这个问题有关吗?

另外,当我检查office365 smtp设置时,看起来应该使用tls而不是ssl:

SMTP Host: smtp.office365.com
SMTP Port: 587
SSL Protocol: OFF
TLS Protocol: ON
SMTP Username: (your Office365 username)
SMTP Password: (your Office365 password)

尝试将设置更改为tls,也许你需要实现java11的解决方法。