简体   繁体   English

Jenkins email-ext 插件不发送邮件

[英]Jenkins email-ext plugin not sending mail

I have Jenkins version 1.480.3 installed on my machine and Email-Extention Plugin 2.30.2.我的机器上安装了 Jenkins 版本 1.480.3 和电子邮件扩展插件 2.30.2。

Test mail from "Manage Jenkins" section works fine.来自“管理詹金斯”部分的测试邮件工作正常。 When I add editable email notification to my jobs, I am not receiving it.当我向我的工作添加可编辑的 email 通知时,我没有收到它。

Also tried configuring "Triggers" in editable email notification advanced section.还尝试在可编辑的 email 通知高级部分中配置“触发器”。 That also didn work.那也没有用。 Console logs of build shows email has been triggered.构建的控制台日志显示 email 已被触发。

Can someone help me on how to debug this?有人可以帮我调试吗?

At first you have to create a template http://url-to-jenkins/emailexttemplates/ .首先,您必须创建一个模板http://url-to-jenkins/emailexttemplates/ In the field "Project Recipient List" you can add some emails (comma separated).“项目收件人列表”字段中,您可以添加一些电子邮件(逗号分隔)。 You can also insert global variables ( Manage Jenkins > Configure System > Global properties ) with:您还可以插入全局变量(管理 Jenkins > 配置系统 > 全局属性):

${ENV, var="PATH"}

在此处输入图片说明

The "Advanced Settings..." option provides a trigger management, just add "Recipient List" and now you should get some emails by Jenkins. “高级设置...”选项提供了触发器管理,只需添加“收件人列表”,现在您应该会收到 Jenkins 的一些电子邮件。

在此处输入图片说明

It appears that, in some version Extended E-mail Notification become own SMTP Server configuration.看来,在某些版本中,扩展电子邮件通知成为自己的 SMTP 服务器配置。 So check your configuration under "Manage Jenkins" -> "Configure System" -> "Extended E-mail Notification" and make sure that fields "SMTP Server" and " Default user E-mail suffix" are filled properly.因此,请检查“管理 Jenkins”->“配置系统”->“扩展电子邮件通知”下的配置,并确保正确填写“SMTP 服务器”和“默认用户电子邮件后缀”字段。

Make sure also that the configuration is consistent with "Manage Jenkins" -> "Configure System" -> E-mail Notification.还要确保配置与“管理Jenkins”->“配置系统”->电子邮件通知一致。

TL;DR TL; 博士

Fill out fields "SMTP Server" and " Default user E-mail suffix" under "Manage Jenkins" -> "Configure System" -> "Extended E-mail Notification"在“Manage Jenkins”->“Configure System”->“Extended E-mail Notification”下填写字段“SMTP Server”和“Default user E-mail suffix”

Wasted few days.浪费了几天。

Also tried to Downgrade the email-ext plugin to 2.25 but this Doesn't help.还尝试将 email-ext 插件降级到 2.25,但这无济于事。

Test mail sended, In Console Log was Sending email to: mymail But stiil have no messages.测试邮件已发送,在控制台日志中正在发送电子邮件至: mymail但仍然没有消息。

I found solution that help me....我找到了对我有帮助的解决方案......

I used gmail.我用过gmail。 So I Verifeid my gmail account via cellphone, than I fill Security Settings and gave Access to my account from unreliable sources.因此,我通过手机验证了我的 gmail 帐户,然后填写了安全设置并从不可靠的来源授予了对我帐户的访问权限。

Then I fill that mail into Use SMTP Authentication in Global Settings.然后我将该邮件填入全局设置中的使用 SMTP 身份验证

That worked for me :)这对我有用:)

Check if you have SSL enabled under SMTP Auth settings.检查您是否在 SMTP 身份验证设置下启用了 SSL。 For me, I was able to see a successful trigger, but email was never sent.对我来说,我能够看到一个成功的触发器,但从未发送过电子邮件。

在此处输入图片说明

将 email-ext 插件降级到 2.25

This is a long shot.这是一个长镜头。 But chrome was auto filling my SMTP Authentication password, so when I changed any setting and clicked save, the password would also be overwritten.但是 chrome 会自动填充我的 SMTP 身份验证密码,所以当我更改任何设置并单击保存时,密码也会被覆盖。

Hopefully I can save someone else a headache!希望我能救别人一个头痛!

Short Description of problem that I was facing:我面临的问题的简短描述:

When I was sending test mail from Manage Jenkins -> Configure System -> E-mail Notification, I was able to successfully send and receive emails but there is no such option to test email in Extended E-mail Notification tab当我从 Manage Jenkins -> Configure System -> E-mail Notification 发送测试邮件时,我能够成功发送和接收电子邮件,但在扩展电子邮件通知选项卡中没有这样的选项来测试电子邮件

While running a job, when I was sending email in post-build step via E-mail plugin, I was able to successfully send and receive emails but with same settings, I was getting following error on sending mail via Extended E-mail:在运行作业时,当我在后期构建步骤中通过电子邮件插件发送电子邮件时,我能够成功发送和接收电子邮件,但使用相同的设置,我在通过扩展电子邮件发送邮件时遇到以下错误:

MessagingException message: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8  https://support.google.com/mail/?p=BadCredentials 

I went almost crazy searching for resolution of this issue.我几乎疯狂地寻找这个问题的解决方案。 I tried every resolution mentioned on this page but no success.我尝试了此页面上提到的所有解决方案,但没有成功。 I even tried downgrading the plugin to 2.25 but I was still getting error when sending email via Extended E-mail plugin.我什至尝试将插件降级到 2.25,但在通过扩展电子邮件插件发送电子邮件时仍然出现错误。 Everywhere on internet also the only solution mentioned to solve this problem was to "Allow less secure apps" and to check if credentials are valid, which in my case were valid since I was able to successfully send mail via normal email plugin.在互联网上的任何地方也提到解决这个问题的唯一解决方案是“允许安全性较低的应用程序”并检查凭据是否有效,在我的情况下是有效的,因为我能够通过普通的电子邮件插件成功发送邮件。

After struggling for a few days, I finally found the silly thing that was causing this issue.经过几天的挣扎,我终于找到了导致这个问题的愚蠢的事情。 I had to type-in email ids into each and every box in: Manage Jenkins -> Configure System -> Extended E-mail Notification.我必须在以下每个框中输入电子邮件 ID:管理 Jenkins -> 配置系统 -> 扩展电子邮件通知。 Copy-pasting email ids or domain names is causing this annoying and time taking issue.复制粘贴电子邮件 ID 或域名会导致这个烦人且耗时的问题。 So, in case if you fall in such a situation, please make sure you have handwritten email ids in each column and not copy pasted.因此,如果您遇到这种情况,请确保您在每列中都有手写的电子邮件 ID,而不是复制粘贴。

Following configurations for "Extended E-mail Notification" worked for me: “扩展电子邮件通知”的以下配置对我有用:

Email Extension Plugin : 2.69
SMTP server : smtp.gmail.com
Default user E-mail suffix: <left this blank>
Enabled Use SMTP Authentication
User Name: <email id of account through which email is to be sent>
Password: <Password of account through which email is to be sent>
Advanced Email Properties : <left this blank>
Use SSL : Enabled
SMTP port: 465
Charset: UTF-8

Also, I had enabled less secure apps.此外,我启用了安全性较低的应用程序。

Hope this saves someone's time!!希望这可以节省某人的时间!!

Sometime after 2.66, if the From field is not set in the project, it doesn't seem to be falling back to the system email address.在 2.66 之后的某个时候,如果项目中没有设置 From 字段,它似乎不会回退到系统电子邮件地址。 I believe this ticket is tracking the issue.我相信这张票正在跟踪这个问题。 https://issues.jenkins-ci.org/browse/JENKINS-63522 https://issues.jenkins-ci.org/browse/JENKINS-63522

我花了几个小时试图解决这个问题,我已经实现了这里提到的所有内容,但对我不起作用,对我有用的解决方案是卸载插件并重新安装!

i performed the following action (after hours and hours of investigation) and at the end it worked for me.我执行了以下操作(经过数小时的调查),最后它对我有用。

  1. Unistalled the Extended mail plug in.卸载扩展邮件插件。

  2. Deleted from.jenksins the plugIn (it remains also after Unistall).从 .jenksins 插件中删除(卸载后它仍然存在)。

  3. Reinstalled the Extended mail plug In and enabled it.重新安装扩展邮件插件并启用它。

  4. Restart Jenkins.重启Jenkins。

  5. In the Jenkins Configure System, in the Extended E-mail Notification section, I set a new credential access to my gmail account (also the previous credential stored were correct but i preferred to generate a new one with a different description).在 Jenkins 配置系统中,在扩展电子邮件通知部分,我设置了一个新的凭据访问我的 gmail 帐户(之前存储的凭据也是正确的,但我更愿意生成一个具有不同描述的新凭据)。

  6. And then... Finally afteer several time on this matter it works for me..然后......终于在这个问题上经过几次之后它对我有用......

Try to use Extended E-mail Notification > Enable Debug Mode (selected).尝试使用Extended E-mail Notification > Enable Debug Mode (已选择)。 It will show you more logs in the Job Run Console section.它将在作业运行控制台部分向您显示更多日志。

In my case, it showed me in the logs that credentials copied from regular email-ext ( AK_AWS_SES_CREDENTIALS/****** (Migrated from email-ext username/password) ) were not able to connect to AWS SES SMTP service.就我而言,它在日志中显示从常规email-ext ( AK_AWS_SES_CREDENTIALS/****** (Migrated from email-ext username/password) ) 复制的凭据无法连接到 AWS SES SMTP 服务。

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

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