简体   繁体   English

从 Jenkins 发送扩展 email 通知时出错

[英]Error While Sending Extended email notification from Jenkins

i have configured extended email notification in Jenkins configure system, and created a new job and configured editable email notification, once the build is completed, email is not sent and getting the following in console Not sent to the following valid addresses: user@domain.com i have configured extended email notification in Jenkins configure system, and created a new job and configured editable email notification, once the build is completed, email is not sent and getting the following in console Not sent to the following valid addresses: user@domain.com

and here is the debug log这是调试日志

RSET
DEBUG SMTP: EOF: [EOF]
DEBUG SMTP: MessagingException while sending, THROW: 
com.sun.mail.smtp.SMTPSendFailedException: 451 5.7.3 STARTTLS is required to send mail [PN********6.INDPRD01.PROD.OUTLOOK.COM]

    at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2374)
    at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1808)
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1285)
    at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:541)
    at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:446)
    at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:354)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
    at hudson.model.Build$BuildExecution.cleanUp(Build.java:187)
    at hudson.model.Run.execute(Run.java:1954)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
Not sent to the following valid addresses: user@domain.com
SMTPSendFailedException message: 451 5.7.3 STARTTLS is required to send mail [P******06.INDPRD01.PROD.OUTLOOK.COM]

QUIT
DEBUG SMTP: EOF: [EOF]

Here is the screenshot how i configured email notification in Configure System:这是我如何在配置系统中配置 email 通知的屏幕截图: 系统 - 电子邮件配置

Just configure this in Jenkins options file:只需在 Jenkins 选项文件中配置它:

JENKINS_JAVA_OPTIONS : -Djava.awt.headless=true -Dmail.smtp.starttls.enable=true
JENKINS_OPTS : -Dmail.smtp.starttls.enable=true

Add this Java argument in Jenkins.xml file for Windows or in /etc/default/jenkins for Ubuntu: Add this Java argument in Jenkins.xml file for Windows or in /etc/default/jenkins for Ubuntu:

-Dmail.smtp.starttls.enable=true

Alternatively, you can try to change the SMTP port from 587 to 465. Use SSL should be true in this case.或者,您可以尝试将 SMTP 端口从 587 更改为 465。在这种情况下,使用 SSL 应该是正确的。

Reference:参考:
Jenkins SMTP TLS Jenkins SMTP TLS
https://superuser.com/questions/879361/how-to-configure-jenkins-email-notifications-through-outlook https://superuser.com/questions/879361/how-to-configure-jenkins-email-notifications-through-outlook

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM