詹金斯(Jenkins):poll-mailbox-trigger-plugin和SMTP [英] Jenkins : poll-mailbox-trigger-plugin and SMTP

查看:251
本文介绍了詹金斯(Jenkins):poll-mailbox-trigger-plugin和SMTP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使用poll-mailbox-trigger插件让Jenkins基于电子邮件进行构建

I am unable to get Jenkins to build based on an email using the poll-mailbox-trigger plugin

我在电子邮件通知中的设置如下

My setup in E-mail Notification is as follows

  • SMTP服务器:myExchangeServerHostName
  • 默认用户电子邮件后缀:@ companyName.com
  • 使用SMTP身份验证:True
  • 用户名:DOMAIN \ user
  • 密码:aboveUserPassword
  • 使用SSL:错误
  • SMTP端口:587
  • 回复地址:
  • 字符集:UTF-8

从这里我可以成功发送一封测试电子邮件给自己,然后我会收到它.

From here I can successfully send a test email to myself and I receive it.

在我的构建中,轮询邮箱触发器"设置如下

In my build the Poll Mailbox Trigger settings are as follows

  • 主机:myExchangeServerHostName
  • 用户名:DOMAIN \ user
  • 密码:aboveUserPassword
  • 高级电子邮件属性:
    • mail.imaps.port = 587
    • mail.imap.ssl.enable = true
    • mail.imap.starttls.enable = true
    • Host: myExchangeServerHostName
    • Username: DOMAIN\user
    • Password: aboveUserPassword
    • Advanced Email Properties:
      • mail.imaps.port=587
      • mail.imap.ssl.enable=true
      • mail.imap.starttls.enable=true

      测试此连接时,我得到

      连接到邮箱... 错误:javax.mail.MessagingException:无法识别的SSL消息,纯文本连接? 嵌套的异常是: javax.net.ssl.SSLException:无法识别的SSL消息,纯文本连接? com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:665)

      Connecting to the mailbox... Error : javax.mail.MessagingException: Unrecognized SSL message, plaintext connection?; nested exception is: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:665)

      我尝试过

      • mail.imap.ssl.enable = false
      • 使用电子邮件地址代替域\用户
      • 添加mail.imaps.ssl.trust = *

      以上似乎都没有任何作用.

      None of the above seem to make any difference.

      推荐答案

      SMTP协议用于发送和中继邮件.使用此协议,无法从特定邮箱中检索邮件. IMAP和POP3协议可以检索邮件.因此,您必须获得对IMAP或POP3服务器的访问权限才能检索邮件. jenkins的轮询邮箱触发器插件尝试通过IMAP存储连接到邮箱.如果邮件服务器在Exchange服务器中使用HTTPS协议,则可以使用Microsoft EWS托管api编写powershell实用程序,以检索邮件并将该实用程序插入jenkins.另外,Powershell脚本也可以包含在批处理脚本中,然后可以包含在jenkins中.

      SMTP protocol is for sending and relaying mails. With this protocol one cannot retrieve mails from a particular mailbox. Whereas IMAP and POP3 protocols can retrieve mails.Therefore you will have to obtain access to the IMAP or POP3 server in order to retrieve mails. The poll mailbox trigger plugin of jenkins tries to connect to mailbox via IMAP store. If the mail server is using HTTPS protocol like in an Exchange server, you can write a powershell utility using Microsoft EWS managed api, to retrieve mails and plug that utility into jenkins. Also, Powershell scripts can be included in batch scripts as well which can then be included in jenkins.

      这篇关于詹金斯(Jenkins):poll-mailbox-trigger-plugin和SMTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆