[SOLVED]OAuth2.0 for Shared Mailboxes

Moderator: crythias

Post Reply
chrotha
Znuny newbie
Posts: 93
Joined: 29 Jun 2018, 13:44
Znuny Version: 6.x.x/7.0.x
Real Name: Ruben Sardinha

[SOLVED]OAuth2.0 for Shared Mailboxes

Post by chrotha »

Hey everyone.

We've been testing fetching emails while using OTRS 6.4 but we bumped into a issue, while using shared mailboxes.
If we try using a password to fetch emails from that shared mailbox, it works fine, but if we use a token it return the following error:

Code: Select all

ERROR: 1 NO AUTHENTICATE failed. at /usr/local/share/perl5/Mail/IMAPClient.pm line 3309.
The oAuth2.0 Token was requested using the mailbox that's going to access the shared mailbox.

Any idea on how we can get the token to fetch from the shared mailbox?

Thanks in advance
Last edited by chrotha on 25 Oct 2022, 12:42, edited 1 time in total.
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: OAuth2.0 for Shared Mailboxes

Post by root »

Hi,

This is, like the most issues, probably a permission issue. I can tell that shared mailboxes are not problem. Maybe this Microsoft documents helps: https://learn.microsoft.com/en-us/excha ... office-365

There are inmportant details like: Which username you use? It should be the email address of the shared mailbox.

I recommend reading the documentation of your email provider to find out what's important for your setup.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
Murphy
Znuny newbie
Posts: 7
Joined: 17 Oct 2022, 13:40
Znuny Version: 6.2.2
Real Name: Martin Svec
Company: CloverDX

Re: OAuth2.0 for Shared Mailboxes

Post by Murphy »

I had similar problem on o365. On OTRS 6.0.27 username "user@domain.com\shared-mailbox" works fine. After update to znuny 6.4.3 and oauth fetching mail failed with:

Code: Select all

Message: CommunicationLog(ID:302823,AccountType:-,AccountID:-,Direction:Incoming,Transport:Email,ObjectLogType:Connection,ObjectLogID:328501)::Kernel::System::MailAccount::IMAPS => Auth error: 1 NO AUTHENTICATE failed.
You need to change username to: shared-mailbox@domain.com
chrotha
Znuny newbie
Posts: 93
Joined: 29 Jun 2018, 13:44
Znuny Version: 6.x.x/7.0.x
Real Name: Ruben Sardinha

Re: OAuth2.0 for Shared Mailboxes

Post by chrotha »

Hey everyone,

Problem is Solved using Murphy's suggestion.
Post Reply