简体   繁体   English

詹金斯电子邮件配置

[英]Jenkins email configuration

Hi I have the following email configuaration for my jenkins.嗨,我的詹金斯有以下电子邮件配置。 I can't get it to test the configuration for email我无法测试电子邮件的配置

SMTP SERVER: smtp.gmail.com SMTP 服务器:smtp.gmail.com

Default user e-mail suffix: @gmail.com默认用户电子邮件后缀:@gmail.com

Use SMTP Authentication: checked使用 SMTP 身份验证:选中

username: "my full gmail id:用户名:“我的完整 Gmail id:

password: "my gmail id password"密码:“我的gmail id密码”

Use SSL: Checked使用 SSL:已检查

SMTP Port: 465 SMTP 端口:465

reply to address: noreply@gmail.com回复地址:noreply@gmail.com

Charset: UTF8字符集:UTF8

Test email recipient: "my full email id"测试电子邮件收件人:“我的完整电子邮件 ID”

Can someone tell me why i still get the following error when i test configuration.有人能告诉我为什么我在测试配置时仍然收到以下错误。 I am using a windows 8 machine and tomcat as my server我使用 Windows 8 机器和 tomcat 作为我的服务器

Failed to send out e-mail

javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
nested exception is:
java.net.ConnectException: Connection timed out: connect

at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)

at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638

Your exception says, that there is no SMTP server on 465 port您的例外是465端口上没有 SMTP 服务器

Uncheck SSL and use post 587取消选中 SSL 并使用 post 587

The main problem is that Google has deactivated this feature with your account password to gain more security.主要问题是谷歌已使用您的帐户密码停用此功能以获得更高的安全性。 If you want to use your google, you should do the following:如果你想使用你的谷歌,你应该执行以下操作:

  • Turn on Two-step authentication from your google account settings从您的 Google 帐户设置中启用两步验证
  • Generate an "application password"生成“应用密码”
  • Use your account and the generated app password as Jenkins SMTP Authentication使用您的帐户和生成的应用程序密码作为 Jenkins SMTP 身份验证

  • Do NOT fill SMTP Port !不要填写 SMTP 端口!

I guess your are facing the same problem as I do.我想你和我面临着同样的问题。

I have searched around, and finally, it is the mcafee, which blocked the connection.找了一圈,最后是mcafee,把连接屏蔽了。

You may using some other antivirus software, may also cause the same issue.您可能使用了其他一些杀毒软件,也可能会导致同样的问题。 So, check it, edit the trust center or something similar.所以,检查它,编辑信任中心或类似的东西。

For me, I just get mcafee removed -- this is also not a easy work.对我来说,我只是删除了 mcafee —— 这也不是一件容易的事。 I really really hate mcafee !我真的很讨厌mcafee!

Give your full gmail id at "System Admin e-mail address" under Manage Jenkins -> configurations.在“管理 Jenkins”->“配置”下的“系统管理员电子邮件地址”中提供您的完整 gmail id。

This might help as well.这也可能有帮助。

https://www.safaribooksonline.com/library/view/jenkins-the-definitive/9781449311155/ch04s08.html https://www.safaribooksonline.com/library/view/jenkins-the-definitive/9781449311155/ch04s08.html

I couldn't get Jenkins to send email from my Windows machine.我无法让 Jenkins 从我的 Windows 机器发送电子邮件。 It turned out that McAfee was blocking the emails.结果是 McAfee 阻止了电子邮件。 This is what I did to solve the problem:这是我为解决问题所做的工作:
- Right click on "McAfee” - 右键单击​​“迈克菲”
- Select ”VirusScanConsole…” - 选择“VirusScanConsole...”
- Right click on ”Access Protection” and select ”Properties” - 右键单击​​“访问保护”并选择“属性”
- Select “Anti-virus Standard Protection” - 选择“防病毒标准保护”
- Edit “Prevent mass mailing worms from sending mail” - 编辑“防止群发邮件蠕虫发送邮件”
- Add the following to the list of “Processes to exclude:” - 将以下内容添加到“要排除的进程”列表中:
* java.exe, java.exe :::, * java.exe, java.exe :::,

The key is to add java rather than jenkins.关键是添加java而不是jenkins。

I found two reasons causing the timeout and have my emails working now.我发现了两个导致超时的原因,现在我的电子邮件可以正常工作。 First I was on my office LAN.首先我在我的办公室局域网上。 Second I was using a free email service for testing.其次,我使用免费的电子邮件服务进行测试。

1) Just to test, I got off of my office LAN by using my Mobile Internet instead. 1) 只是为了测试,我使用我的移动互联网离开了我的办公室局域网。 You can get around this by setting an exception in your firewall and/or System Protection software (eg. system center endpoint protection), if you have the privileges on your machine.如果您在您的机器上拥有特权,您可以通过在防火墙和/或系统保护软件(例如系统中心端点保护)中设置例外来解决此问题。 if you must use Jenkins in Enterprise networks.如果您必须在企业网络中使用 Jenkins。

2) If you are using free email services like yahoo or gmail for just testing out Jenkins notification facility, make sure to enable support for less secure apps ( https://www.google.com/settings/security/lesssecureapps ) as this also prevents Jenkins from sending mail notifications. 2) 如果您使用 yahoo 或 gmail 等免费电子邮件服务来测试 Jenkins 通知工具,请确保启用对不太安全的应用程序的支持 ( https://www.google.com/settings/security/lesssecureapps ),因为这也是阻止 Jenkins 发送邮件通知。 Yahoo must have similar link to turn on support for less secure apps.雅虎必须有类似的链接才能启用对不太安全的应用程序的支持。

After the above two steps, I could now get all notifications from my test PC on which I've configured Jenkins!!在上述两个步骤之后,我现在可以从我配置了 Jenkins 的测试 PC 上获取所有通知!! Hope this helps!希望这可以帮助!

I had the same issue and it was my Avast antivirus which was causing this error.我遇到了同样的问题,是我的 Avast 防病毒软件导致了此错误。 For Avast users, go to Protection section and click on Core shields, click on Mail Shield and disable scan outbound emails(SMTP) and then you are good to go.对于 Avast 用户,请转到“保护”部分并单击“核心防护”,然后单击“邮件防护”并禁用扫描出站电子邮件 (SMTP),然后您就可以开始使用了。

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

相关问题 Jenkins电子邮件配置 - 测试电子邮件配置成功但用户未收到电子邮件 - Jenkins email configuration - Test email configuration succeeds but email is not received by user 无法测试jenkins电子邮件通知配置 - Failing to test jenkins email notification configuration Jenkins SMTP Email 配置验证失败 - Jenkins SMTP Email configuration fails verification Jenkins用户配置“扩展电子邮件作业监视”,但无可用配置 - Jenkins user configure “Extended Email Job Watching”, but No configuration available 如何重置 Jenkins 电子邮件扩展插件发件人配置? - How to reset Jenkins email extension plugin sender configuration? Jenkins email-ext插件“ ghost”配置问题 - Jenkins email-ext plugin “ghost” configuration issue 詹金斯配置 - Jenkins configuration Jenkins多配置构建-如何在Email-Ext(可编辑电子邮件通知)中指定多配置轴的值? - Jenkins Multi-Configuration Build - How do I specify the value of a multi-configuration axis in Email-Ext (Editable Email Notification)? 使用预发送脚本(Groovy脚本)的Jenkins Ext电子邮件通知配置 - Jenkins Ext Email Notification configuration using pre-send script (groovy script) 如何在 jenkins 管道中编写 email 配置以发送不同的构建成功和构建失败信息集? - How to write email configuration in jenkins pipeline to send different set of information for build success and build failure?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM