jenkinsci / poll-mailbox-trigger-plugin

A Jenkins plugin, to poll an email inbox, and trigger jobs based on new emails.
https://plugins.jenkins.io/poll-mailbox-trigger-plugin/
MIT License
41 stars 32 forks source link

Connecting with UPN to shared mailbox #35

Open kevinm90 opened 6 years ago

kevinm90 commented 6 years ago

Hi everyone,

I am having issues connecting to a shared mailbox on Exchange Server 2016. In outlook I can connect via serviceaccount@domain/mailboxname as username (which is the universal principal name approach in Exchange). Unfortunately this doesn't work in the plugin, I always receive

Error : javax.mail.AuthenticationFailedException: AUTHENTICATE failed. at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:660) 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)

Server configuration

Jenkins Version: 2.73.2 Plugin Version: 1.026

Any tips here how to resolve this?

Thanks and regards Kevin

PS: Connection to my normal user-inbox is working without any issues so far

nickgrealy commented 6 years ago

Hi @kevinm90 ,

Thanks for raising the issue. I don't actually have any experience with Exchange Server 2016, so I can't help with that. Also, you've skipped some steps when creating the new issue:

Thanks, let me know how you go.

Kind regards, Nick

kevinm90 commented 6 years ago

Hi Nick,

Can you please provide all the configuration details you're using (hide sensitive fields) and any other information which may help? (does it match the examples here?)

the complete config looks like this: host=imap.my.company.domain username=serviceuser@my.company.domain\mailboxname

folder=Inbox subjectContains= receivedXMinutesAgo=40000

mail.imaps.port=993 mail.imap.ssl.enable=true mail.imap.starttls.enable=true

So, yes it matches the example for Exchange 2013 (also it works with my personal mailbox)

Do you know if you're you able to connect to to your mail server via IMAP? (i.e. Can you independently test/connect via another IMAP mail client?)

Yes, with Outlook 2016 it is working perfectly (I configured a manual imap-connection and didn't use the automatic exchange-config-option)

Have you followed the troubleshooting section on the plugin page? (There's a section there for the very error you're having. Have you tried different credentials?)

Yes, I also tried another service-user and another shared mailbox. As I said, a personal mailbox is working, but for all central mailboxes (where I have to use the UPN-approach as username) it isn't.

Do I have to escape or encode a character in the username. e.g. the @-sign or the backslash? I already tried with double backslash, but without any luck.

Regards Kevin

nickgrealy commented 6 years ago

Hi @kevinm90 ,

Unfortunately I haven't found a solution, and don't have access to a Exchange Server 2016 instance to reproduce the issue.

I'll leave this issue open, in the hopes that someone else will be able to help resolve the problem.

Kind regards, Nick

nickgrealy commented 6 years ago

45 - perhaps this issue will be resolved by implementing EWS2.0 API?

sumit-global commented 6 years ago

@kevinm90 what exactly you mean by domain \mailboxname

kevinm90 commented 6 years ago

@sumit-global I mean the name/ID of the shared mailbox.