Outlook connectivity with Jenkins

Hi Team,

We are trying to integrate a mailbox to read the mails from a platform for some specific alerts.
We have installed the Poll Mailbox Trigger plugin.

The configuration we are making are as follows:
Host: outlook.office365.com
Username: XXXXXX
Password: XXXXXX

And when we tested the connection, we received the following error:
Connecting to the mailbox…
Error : javax.mail.MessagingException: Connection reset;
nested exception is:
java.net.SocketException: Connection reset
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:665)
at javax.mail.Service.connect(Service.java:295)
at javax.mail.Service.connect(Service.java:176)
at org.jenkinsci.plugins.pollmailboxtrigger.mail.MailReader.connect(MailReader.java:58)
at org.jenkinsci.plugins.pollmailboxtrigger.PollMailboxTrigger.checkForEmails(PollMailboxTrigger.java:238)
at org.jenkinsci.plugins.pollmailboxtrigger.PollMailboxTrigger$PollMailboxTriggerDescriptor.doTestConnection(PollMailboxTrigger.java:584)
at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212)
at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)
at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:535)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)
at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:280)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)
at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:280)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)

Can anyone please suggest how can we resolve this?

Kind Regards!

1 Like

Hello @Pragati and welcome to this community :wave:

Are you able to make a connection (thanks to a shell command, or with a mail client) on the machine that hosts the Jenkins controller and/or agent to your mail server?
Are they any firewalls/proxies/network appliances between your Jenkins installation and your mail server?

Thanks.

Hi @poddingue ,

Thank you for your inputs! Much appreciated.
Yes, we are able to connect to outlook as we are able to send notification to MS Teams for Job completion statuses.
We think it’s the security restrictions by the organization that is not allowing us to connect to the mail box.

I have opened a ticket within the organization for this. Let’s see if we are able to connect then.

Kind Regards.

1 Like

Thanks for your feedback. :pray:

Hi @Pragati is this issue resolved for you. Right now I am too facing the same issue. Office365 connector working fine but Email to outlook mail box not working.
Looks like Microsoft now supports only OAuth 2.0 based authentication. Any input will be helpful here.

1 Like