客户端无权在 Jenkins 中作为此发件人发送

Posted

技术标签:

【中文标题】客户端无权在 Jenkins 中作为此发件人发送【英文标题】:Client does not have permissions to send as this sender in Jenkins 【发布时间】:2017-10-30 11:58:09 【问题描述】:

我安装了 Jenkins(Jenkins 版本 2.46.2)并且我已经在 Manage Jenkins -> Configure System -> Email Notification 中配置了 SMTP 服务器。 测试邮件工作正常。但在工作电子邮件通知中不起作用。

Error message as : Error sending to the following VALID addresses

我检查了 Jenkins 日志文件。

550 5.7.60 SMTP; Client does not have permissions to send as this sender [KL1PR03MB1749.apcprd03.prod.outlook.com]
DEBUG SMTP: got response code 550, with response: 550 5.7.60 SMTP; Client does not have permissions to send as this sender [KL1PR03MB1749.apcprd03.prod.outlook.com]

RSET
250 2.0.0 Resetting
com.sun.mail.smtp.SMTPSendFailedException: 550 5.7.60 SMTP; Client does not have permissions to send as this sender [KL1PR03MB1749.apcprd03.prod.outlook.com]

    at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2057)
    at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1862)
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1100)
    at javax.mail.Transport.send0(Transport.java:195)
    at javax.mail.Transport.send(Transport.java:124)
    at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:357)
    at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:322)
    at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:230)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
    at hudson.model.Build$BuildExecution.cleanUp(Build.java:196)
    at hudson.model.Run.execute(Run.java:1775)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:405)
QUIT

如何解决这个问题?

【问题讨论】:

【参考方案1】:

您需要在管理 Jenkins -> 配置系统下设置“系统管理员电子邮件地址”。这是该页面上的 Jenkins Location 标题下!

看看下面的线程。 How can I set the Sender's address in Jenkins?

【讨论】:

我已经在系统管理员电子邮件地址中设置了它。那么只有测试邮件才会成功

以上是关于客户端无权在 Jenkins 中作为此发件人发送的主要内容,如果未能解决你的问题,请参考以下文章

jenkins自动发送邮件配置

在java中将电子邮件作为附件发送

消息总线:发件人必须等待来自多个收件人的确认

Jenkins邮件配置

DMARC:ESP 主机作为报告中的发件人

如何使用 SMTP 发送邮件并在 Outlook 发件箱中查看邮件?