Highlighted
Emerging Member
Posts: 52
Registered: ‎06-29-2018
Kudos: 9
Solutions: 2
Accepted Solution

UCRM IMAP Inbox using O365 Shared mailbox failing authentication

Hello,

 

I'm working on setting up UCRM and have hit an issue when attempting to add an Office365 share mailbox for the IMAP Inbox account.

 

I have the following configuration for my IMAP inbox to leverage the shared ticketing mailbox:

ServerName: outlook.office365.com
Port: 993
Email Address: ticketing@mydomain.com
Username: billing@mydomain.com/ticketing
Password: <valid password for billing@mydomain.com>
Verify SSL: Yes

Whenever I click "Test Connection" I get the following:

[E_WARNING] Authentication failed for user "billing@mydomain.com/ticketing": imap_open(): Couldn't open stream {outlook.office365.com:993/imap/ssl/validate-cert}
imap_alerts (0):
imap_errors (1):
- Can not authenticate to IMAP server: AUTHENTICATE failed.

If I update my configuration to:

Server Name: outlook.office365.com
Port: 993
Email Address: ticketing@mydomain.com
Username: billing@mydomain.com
Password: <valid password for billing@mydomain.com>
Verify SSL: Yes

Test Connection works just fine however the inbox is now reading from billing@mydomain.com rather than the shared mailbox ticketing@mydomain.com.

 

I am not sure if UCRM is having issues here or where exactly the failure is happening.  Any pointers on detailed logs to look at or provide?

 

I have gotten this working via the IMAP client on my phone so I know the server, port, username/sharedinbox, password are all ok and result in a successful IMAP connection.

 


Accepted Solutions
Ubiquiti Employee
Posts: 4,155
Registered: ‎12-10-2015
Kudos: 1471
Solutions: 315

Re: UCRM IMAP Inbox using O365 Shared mailbox failing authentication

We got a solution which could probably fix this in the next beta version 2.15 (ETA early next week)

View solution in original post


All Replies
Ubiquiti Employee
Posts: 4,155
Registered: ‎12-10-2015
Kudos: 1471
Solutions: 315

Re: UCRM IMAP Inbox using O365 Shared mailbox failing authentication

Please check your IMAP settings in your email. UCRM can just connect to an IMAP account, not to a specific folder, which is what the error message says: billing@mydomain.com/ticketing is not a valid username. If your IMAP configuration doesn't enable you to do what you need, you may consider forwarding some/all messages to another email account and let UCRM connect to that.
Emerging Member
Posts: 52
Registered: ‎06-29-2018
Kudos: 9
Solutions: 2

Re: UCRM IMAP Inbox using O365 Shared mailbox failing authentication

Forgot to swap to my work profile on last reply.

 

Thank you for the reply @UBNT-Petr!

 

For office 365 shared mailboxes billing@mydomain.com\ticketing is the valid username format.

 

This works on all other IMAP clients I have tried.  It only appears to be an issue for UCRM IMAP.  Is UCRM rejecting the username format before submitting to the service?

Ubiquiti Employee
Posts: 4,155
Registered: ‎12-10-2015
Kudos: 1471
Solutions: 315

Re: UCRM IMAP Inbox using O365 Shared mailbox failing authentication

UCRM doesn't reject any username format but from this I assume the connection or ssl verification of your IMAP server failing: imap_open(): Couldn't open stream {outlook.office365.com:993/imap/ssl/validate-cert}

Do you use a valid ssl cert? If not or if you use self-signed cert, you can set "Verify SSL certificate" to false in IMAP settings (UCRM: System > Settings > Ticketing - edit imap inbox config)
Emerging Member
Posts: 52
Registered: ‎06-29-2018
Kudos: 9
Solutions: 2

Re: UCRM IMAP Inbox using O365 Shared mailbox failing authentication

@UBNT-Petr

 

If I remover the /sharedmailbox from the username then everything works as expected.  Are there any logs I could create or gather that might be of interest?

 

Perhaps it will be easist for me to move away from a shared mailbox in o365 and use a dedicated mailbox just for ticketing.  Unless this is a scenario that you want to dig into further?

 

The reason I was trying this is that I have two different persona's for UCRM: Billing and Ticketing.  Invoices etc come from an unmonitored mailbox which I've already assigned a O365 license to be able to send / recieve email with a unique UN/PWD for UCRM billing side (billing@mydomain.com).  I was hoping to use that same license, but leverage an independent shared mailbox (ticketing@mydomain.com).  Shared mailboxes in O365 do not cost another mailbox license and can leverage an existing license.

 

If I move to a dedicated mailbox for ticketing in addition to the dedicated mailbox for billing, that means UCRM is taking up 2 O365 licenses.  I could setup the same mailbox to have both billing and ticketing aliases, but then billing records / email and tickting records / email would end up in the same inbox and I'm trying to keep them seperate for data rentention policies and other things to be different.

 

Does that make sense?

 

Let me know if you feel it's worth digging into this issue deeper otherwise I will accept your first response as the answer and just use 2 licenses for UCRM.

Ubiquiti Employee
Posts: 4,155
Registered: ‎12-10-2015
Kudos: 1471
Solutions: 315

Re: UCRM IMAP Inbox using O365 Shared mailbox failing authentication

We will try to find some time to investigate this.

Can you try to use \ instead of / ? i.e."billing@mydomain.com\ticketing"
Emerging Member
Posts: 52
Registered: ‎06-29-2018
Kudos: 9
Solutions: 2

Re: UCRM IMAP Inbox using O365 Shared mailbox failing authentication

I have tried both “/“ and “\” with the same failure results.

Ubiquiti Employee
Posts: 4,155
Registered: ‎12-10-2015
Kudos: 1471
Solutions: 315

Re: UCRM IMAP Inbox using O365 Shared mailbox failing authentication

We got a solution which could probably fix this in the next beta version 2.15 (ETA early next week)
Emerging Member
Posts: 52
Registered: ‎06-29-2018
Kudos: 9
Solutions: 2

Re: UCRM IMAP Inbox using O365 Shared mailbox failing authentication

Perfect thank you. Happy to help test any fixes!
Emerging Member
Posts: 52
Registered: ‎06-29-2018
Kudos: 9
Solutions: 2

Re: UCRM IMAP Inbox using O365 Shared mailbox failing authentication

I have confirmed this is now resolved in the 2.15.beta-1 which I upgraded to. I can now leverage shared mailboxes with UCRM ticketing. Thank you so much for resolving this issue!
Ubiquiti Employee
Posts: 4,155
Registered: ‎12-10-2015
Kudos: 1471
Solutions: 315

Re: UCRM IMAP Inbox using O365 Shared mailbox failing authentication

Good to hear that, thanks for letting us know.
New Member
Posts: 2
Registered: a week ago

Re: UCRM IMAP Inbox using O365 Shared mailbox failing authentication

I'm having this exact same issue with using an Office365 Shared mailbox. I tried switching to the beta stream running 2.16.0-beta4, but the issue still persists.

 

E_WARNING] Authentication failed for user "*****@**************.com.au\helpdesk": imap_open(): Couldn't open stream {outlook.office365.com:993/imap/ssl/novalidate-cert} imap_alerts (0): imap_errors (1): - Can not authenticate to IMAP server: AUTHENTICATE failed.

Emerging Member
Posts: 52
Registered: ‎06-29-2018
Kudos: 9
Solutions: 2

Re: UCRM IMAP Inbox using O365 Shared mailbox failing authentication

[ Edited ]

Hello @codemonkey76, This continues to work for me on v1.0.0-alpha2 (same CRM module as 2.16.0-beta4 so I believe). You want to ensure that your "\" is correct. It should be in the format of:
"*****@**************.com.au/helpdesk" rather than "*****@**************.com.au\helpdesk"