Exchange Online / O365 : End of support for POP/IMAP

Moderator: crythias

Post Reply
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by jojo »

yes, we currently evaluating the possibility to create a communication channel for this for upcomming OTRS 8
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
vernum
Znuny newbie
Posts: 9
Joined: 23 May 2018, 11:04
Znuny Version: 4.0.5

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by vernum »

What do you mean by "evaluating" ?

IMO, there is many company which use OTRS with O365 mailbox, if you do not implement OAuth 2.0, we will need to find another ticketing solution, or OTRS is for the moment the best we tested ( about 8 software tested ).
wurzel
Znuny guru
Posts: 3224
Joined: 08 Jul 2010, 22:25
Znuny Version: x.x.x
Real Name: Florian

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by wurzel »

Hi,

usually OTRS works fine with local MTA/MDA. So no need for IMAP/POP3

Flo
OTRS 8 SILVER (Prod)
OTRS 8 auf Debian 11 (Test)
Znuny 7.x latest version testing auf Debian 11

-- Ich beantworte keine Forums-Fragen PN - No PN please

I won't answer to unfriendly users any more. A greeting and regards are just polite.
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by jojo »

Evaluating means that we are checking the possibilities to implement such a solution. As OTRS 8 will be released at this time it will be most likely a solution in or for OTRS 8
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by crythias »

wurzel wrote: 18 Oct 2019, 14:57 usually OTRS works fine with local MTA/MDA. So no need for IMAP/POP3
This is correct. Once you go procmail you probably won't even think about pop/imap. It's really easy to create an Office365 connector/rule that relays to your OTRS deployment as a smarthost. Plus you get instant tickets.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
tek
Znuny newbie
Posts: 10
Joined: 21 Oct 2015, 14:46
Znuny Version: 4.0.13

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by tek »

Hello,
I have OTRS version 6 which accesses a mailbox on Office 365 in IMAP. I discover today that it will soon be impossible.
I don't quite understand what you mean by: OTRS works fine with local MTA / MDA. So no need for IMAP / POP3
Can you give me some food for thought?
Otrs 5 - Mysql 5 - Centos 7
wurzel
Znuny guru
Posts: 3224
Joined: 08 Jul 2010, 22:25
Znuny Version: x.x.x
Real Name: Florian

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by wurzel »

Hi,

you have to use the local mailserver on you linux host and forward all mails to the host.
https://doc.otrs.com/doc/manual/admin/6 ... eiving-cmd

Flo
OTRS 8 SILVER (Prod)
OTRS 8 auf Debian 11 (Test)
Znuny 7.x latest version testing auf Debian 11

-- Ich beantworte keine Forums-Fragen PN - No PN please

I won't answer to unfriendly users any more. A greeting and regards are just polite.
josy1024
Znuny newbie
Posts: 5
Joined: 08 Nov 2012, 17:53
Znuny Version: 3.1.10
Real Name: Josef Lahmer
Company: gugler gmbh

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by josy1024 »

a reference design would be nice for procmail or getmail o365?

i'm not sure if its so practical to setup a complete mailserver only for one inbox???

it's also design rule, because otrs needs public ip for using as a standalone mail server.
OTRS 3.1.X, OTRS::ITSM 3.1.6 , auth-openldap, customer-openldap, FAQ, Iphone, centos, mysql 5.5
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by root »

josy1024 wrote: 19 Aug 2020, 14:59 i'm not sure if its so practical to setup a complete mailserver only for one inbox???
Hi,

It's only a 10-minute task for an experienced Linux admin. And, with procmail there is no INBOX.

- 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 ?
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by jojo »

"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by root »

vernum wrote: 18 Oct 2019, 12:22 Hi,

I didn't find another topic on this subject : Microsoft will stop the support of POP and IMAP protocols to pull emails.

Does OTRS will support OAuth 2.0 before October 13th 2020 ? Do you have a roadmap on this ?

https://developer.microsoft.com/en-us/g ... customers/
Hi,

Don't know if OTRS will support this, but for the ((OTRS)) Community Edition, version 6, there is a commercial add-on available.

- 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 ?
finalbeta
Znuny newbie
Posts: 11
Joined: 12 Jul 2018, 12:19
Znuny Version: 5.1.1.1.1

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by finalbeta »

I'm adding to an old conversation, I know.
But it's still relevant.

Microsoft Posted an update on this on Friday.
https://techcommunity.microsoft.com/t5/ ... -p/2772210

Effective October 1, 2022, we will begin to permanently disable Basic Auth in all tenants, regardless of usage (with the exception of SMTP Auth, which can still be re-enabled after that).

Using a smarthost is not a valid option due to technical requirements in our setup, but it might be the way to go for some.

Seems Znuny supports it only as a plugin if you take a support contract.
https://www.znuny.com/en/add-ons/oauth2 ... l-accounts.

Possible alternatives exist , Requires you to buy the plugin (but possibly at no actual cost).
Last edited by finalbeta on 11 Jan 2022, 14:11, edited 1 time in total.
zzz
Znuny superhero
Posts: 888
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by zzz »

We also offer an OAuth 2.0 Add-on for Microsoft 365/Google Workspace accounts for Znuny and OTRS CE: https://efflux.de/en/add-ons/8/OAuth+2.0/

We actually made the add-on for the OTOBO project as an open-source contribution. The last link you've posted @finalbeta seems to be a copy of our add-on (at least according to the screenshots; can't tell about the actual source code).

— Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
finalbeta
Znuny newbie
Posts: 11
Joined: 12 Jul 2018, 12:19
Znuny Version: 5.1.1.1.1

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by finalbeta »

FYI.
We ended up using http://davmail.sourceforge.net/
This simply allows a connection using Basic authentication (that Zuny supports) and it translates it to Modern authentication.
Supports Imap / SMTP
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by root »

Hi,

OAuth 2.0 for IMAP/SMTP will come for Znuny (not LTS). LTS users should upgrade or use a support contract via Znuny to access this feature.

- 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 ?
dvandorp
Znuny newbie
Posts: 7
Joined: 17 Mar 2020, 12:05
Znuny Version: 7.0.14
Real Name: Danny van Dorp
Company: SNV Netherlands Development Organisation

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by dvandorp »

In Znuny 6.3, native support for oauth2 is added. I have setup an app registration in Azure and this app registration is working with the mailaccount-oauth2-10.0.1.opm plugin from https://otobo.de and can fetch mail.
If I configure the exact same app registration, only with a different redirect url so it goes to otrs/get-oauth2-token-by-authorization-code.pl I do get a token etc. but when I configure a mailbox to use this config I immediately get an authentication error.

What else needs to be configured to get it to work?
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by root »

dvandorp wrote: 21 Mar 2022, 17:22 In Znuny 6.3, native support for oauth2 is added. I have setup an app registration in Azure and this app registration is working with the mailaccount-oauth2-10.0.1.opm plugin from https://otobo.de and can fetch mail.
If I configure the exact same app registration, only with a different redirect url so it goes to otrs/get-oauth2-token-by-authorization-code.pl I do get a token etc. but when I configure a mailbox to use this config I immediately get an authentication error.

What else needs to be configured to get it to work?
Hi,

Are your system configurations setting FQND and HttpType correct? Often the last mention is not set to https. Znuny uses these settings to form a proper callback URL

- 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 ?
dvandorp
Znuny newbie
Posts: 7
Joined: 17 Mar 2020, 12:05
Znuny Version: 7.0.14
Real Name: Danny van Dorp
Company: SNV Netherlands Development Organisation

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by dvandorp »

Dear Roy,

Thank you for getting back.
Yes, I have set the httptype to https and the fqdn is also correct. Actually before it wasn't set to https and then you indeed don't get a token because it errors out when trying to get it.
I do get a token so that part works correctly. It is only when I fetch the mail I get the authentication error right away.
The app registration however does have access to the particular shared mailboxes because it is already working as we speak with the plugin module that is provided by Intalio (https://www.intalioservices.com/product ... unt-oauth2) on otrs 6.0.31
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by root »

Hi,

Tweo more question:

1.) Have you configured the mail account to use OAuth?
2.) Please fetch the mailbox manually via shell with this command and post the result:

Code: Select all

bin/otrs.Console.pl Maint::PostMaster::MailAccountFetch --debug --mail-account-id x
Pleas replace the x with the database id of the mailbox account and check the output for personal data

- 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 ?
uffIT
Znuny newbie
Posts: 9
Joined: 22 Mar 2022, 09:20
Znuny Version: 6.3.1
Real Name: Alessio Minacapelli

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by uffIT »

Hello,
Apparentely I have the same issue with O365.
I tried your command and the output is:

Code: Select all

Spawning child process to fetch incoming messages from mail accounts...

outlook.office365.com (IMAPS)...
IMAPS: Connection to outlook.office365.com closed.

Started at Tue Mar 22 08:36:41 2022
Using Mail::IMAPClient version 3.42 on perl 5.030000
Connecting with IO::Socket::SSL PeerAddr outlook.office365.com PeerPort 993 Proto tcp Timeout 600 Debug 1 SSL_verify_mode 0
Connected to outlook.office365.com
Read:   * OK The Microsoft Exchange IMAP4 service is ready. 
Sending: 1 AUTHENTICATE XOAUTH2
Sent 24 bytes
Read:   +
Sending: [Redact: Count=1 Showcredentials=OFF]
Sent 2858 bytes
Read:   1 OK AUTHENTICATE completed.
Sending: 2 SELECT INBOX
Sent 16 bytes
Read:   2 BAD User is authenticated but not connected.
ERROR: 2 BAD User is authenticated but not connected. at /usr/share/perl5/Mail/IMAPClient.pm line 1378.
        Mail::IMAPClient::__ANON__("2 BAD User is authenticated but not connected.\x{d}\x{a}") called at /usr/share/perl5/Mail/IMAPClient.pm line 1414
        Mail::IMAPClient::_get_response(Mail::IMAPClient=HASH(0x5573e6f6ba90), 2, undef) called at /usr/share/perl5/Mail/IMAPClient.pm line 1340
        Mail::IMAPClient::_imap_command_do(Mail::IMAPClient=HASH(0x5573e6f6ba90), "SELECT INBOX") called at /usr/share/perl5/Mail/IMAPClient.pm line 1238
        Mail::IMAPClient::_imap_command(Mail::IMAPClient=HASH(0x5573e6f6ba90), "SELECT INBOX") called at /usr/share/perl5/Mail/IMAPClient.pm line 854
        Mail::IMAPClient::select(Mail::IMAPClient=HASH(0x5573e6f6ba90), "INBOX") called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 301
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 305
        Kernel::System::MailAccount::IMAP::__ANON__("select", "INBOX") called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 331
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 345
        Kernel::System::MailAccount::IMAP::_Fetch(Kernel::System::MailAccount::IMAPS=HASH(0x5573e5e7cf10), "DispatchingBy", "Queue", "QueueID", 5, "Type", "IMAPS", "Password", ...) called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 157
        Kernel::System::MailAccount::IMAP::Fetch(Kernel::System::MailAccount::IMAPS=HASH(0x5573e5e7cf10), "ChangeTime", "2022-03-22 08:35:57", "Login", "mailer\@tiemme.com", "********ConfigID", 6, "Debug", ...) called at /opt/znuny-6.3.1/Kernel/System/MailAccount.pm line 649
        Kernel::System::MailAccount::MailAccountFetch(Kernel::System::MailAccount=HASH(0x5573e5e19ca8), "ValidID", 1, "Trusted", 1, "Host", "outlook.office365.com", "IMAPFolder", ...) called at /opt/znuny-6.3.1/Kernel/System/Console/Command/Maint/PostMaster/MailAccountFetch.pm line 173
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/Console/Command/Maint/PostMaster/MailAccountFetch.pm line 165
        Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch::Run(Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch=HASH(0x5573e2cad338)) called at /opt/znuny-6.3.1/Kernel/System/Console/BaseCommand.pm line 460
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/Console/BaseCommand.pm line 454
        Kernel::System::Console::BaseCommand::Execute(Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch=HASH(0x5573e2cad338), "--debug", "--mail-account-id", 1) called at /opt/znuny-6.3.1/Kernel/System/Console/InterfaceConsole.pm line 81
        Kernel::System::Console::InterfaceConsole::Run(Kernel::System::Console::InterfaceConsole=HASH(0x5573e2cac530), "Maint::PostMaster::MailAccountFetch", "--debug", "--mail-account-id", 1) called at bin/otrs.Console.pl line 37
ERROR: 2 BAD User is authenticated but not connected. at /usr/share/perl5/Mail/IMAPClient.pm line 1288.
        Mail::IMAPClient::_imap_command(Mail::IMAPClient=HASH(0x5573e6f6ba90), "SELECT INBOX") called at /usr/share/perl5/Mail/IMAPClient.pm line 854
        Mail::IMAPClient::select(Mail::IMAPClient=HASH(0x5573e6f6ba90), "INBOX") called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 301
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 305
        Kernel::System::MailAccount::IMAP::__ANON__("select", "INBOX") called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 331
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 345
        Kernel::System::MailAccount::IMAP::_Fetch(Kernel::System::MailAccount::IMAPS=HASH(0x5573e5e7cf10), "DispatchingBy", "Queue", "QueueID", 5, "Type", "IMAPS", "Password", ...) called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 157
        Kernel::System::MailAccount::IMAP::Fetch(Kernel::System::MailAccount::IMAPS=HASH(0x5573e5e7cf10), "ChangeTime", "2022-03-22 08:35:57", "Login", "mailer\@tiemme.com", "********ConfigID", 6, "Debug", ...) called at /opt/znuny-6.3.1/Kernel/System/MailAccount.pm line 649
        Kernel::System::MailAccount::MailAccountFetch(Kernel::System::MailAccount=HASH(0x5573e5e19ca8), "ValidID", 1, "Trusted", 1, "Host", "outlook.office365.com", "IMAPFolder", ...) called at /opt/znuny-6.3.1/Kernel/System/Console/Command/Maint/PostMaster/MailAccountFetch.pm line 173
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/Console/Command/Maint/PostMaster/MailAccountFetch.pm line 165
        Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch::Run(Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch=HASH(0x5573e2cad338)) called at /opt/znuny-6.3.1/Kernel/System/Console/BaseCommand.pm line 460
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/Console/BaseCommand.pm line 454
        Kernel::System::Console::BaseCommand::Execute(Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch=HASH(0x5573e2cad338), "--debug", "--mail-account-id", 1) called at /opt/znuny-6.3.1/Kernel/System/Console/InterfaceConsole.pm line 81
        Kernel::System::Console::InterfaceConsole::Run(Kernel::System::Console::InterfaceConsole=HASH(0x5573e2cac530), "Maint::PostMaster::MailAccountFetch", "--debug", "--mail-account-id", 1) called at bin/otrs.Console.pl line 37
ERROR: OTRS-otrs.Console.pl-Maint::PostMaster::MailAccountFetch-42 Perl: 5.30.0 OS: linux Time: Tue Mar 22 08:36:45 2022

 Message: Error while retrieving the messages 'IMAPS': Could not select:


 Traceback (3591712):
   Module: Kernel::System::MailAccount::IMAP::_Fetch Line: 347
   Module: Kernel::System::MailAccount::IMAP::Fetch Line: 157
   Module: Kernel::System::MailAccount::MailAccountFetch Line: 649
   Module: (eval) Line: 173
   Module: Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch::Run Line: 165
   Module: (eval) Line: 460
   Module: Kernel::System::Console::BaseCommand::Execute Line: 454
   Module: Kernel::System::Console::InterfaceConsole::Run Line: 81
   Module: bin/otrs.Console.pl Line: 37

Sending: 3 CLOSE
Sent 9 bytes
Read:   3 BAD User is authenticated but not connected.
        * BYE Connection closed. 14
ERROR: 3 BAD User is authenticated but not connected. at /usr/share/perl5/Mail/IMAPClient.pm line 1378.
        Mail::IMAPClient::__ANON__("3 BAD User is authenticated but not connected.\x{d}\x{a}") called at /usr/share/perl5/Mail/IMAPClient.pm line 1414
        Mail::IMAPClient::_get_response(Mail::IMAPClient=HASH(0x5573e6f6ba90), 3, undef) called at /usr/share/perl5/Mail/IMAPClient.pm line 1340
        Mail::IMAPClient::_imap_command_do(Mail::IMAPClient=HASH(0x5573e6f6ba90), "CLOSE") called at /usr/share/perl5/Mail/IMAPClient.pm line 1238
        Mail::IMAPClient::_imap_command(Mail::IMAPClient=HASH(0x5573e6f6ba90), "CLOSE") called at /usr/share/perl5/Mail/IMAPClient.pm line 2369
        Mail::IMAPClient::close(Mail::IMAPClient=HASH(0x5573e6f6ba90)) called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 301
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 305
        Kernel::System::MailAccount::IMAP::__ANON__("close") called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 521
        Kernel::System::MailAccount::IMAP::_Fetch(Kernel::System::MailAccount::IMAPS=HASH(0x5573e5e7cf10), "DispatchingBy", "Queue", "QueueID", 5, "Type", "IMAPS", "Password", ...) called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 157
        Kernel::System::MailAccount::IMAP::Fetch(Kernel::System::MailAccount::IMAPS=HASH(0x5573e5e7cf10), "ChangeTime", "2022-03-22 08:35:57", "Login", "mailer\@tiemme.com", "********ConfigID", 6, "Debug", ...) called at /opt/znuny-6.3.1/Kernel/System/MailAccount.pm line 649
        Kernel::System::MailAccount::MailAccountFetch(Kernel::System::MailAccount=HASH(0x5573e5e19ca8), "ValidID", 1, "Trusted", 1, "Host", "outlook.office365.com", "IMAPFolder", ...) called at /opt/znuny-6.3.1/Kernel/System/Console/Command/Maint/PostMaster/MailAccountFetch.pm line 173
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/Console/Command/Maint/PostMaster/MailAccountFetch.pm line 165
        Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch::Run(Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch=HASH(0x5573e2cad338)) called at /opt/znuny-6.3.1/Kernel/System/Console/BaseCommand.pm line 460
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/Console/BaseCommand.pm line 454
        Kernel::System::Console::BaseCommand::Execute(Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch=HASH(0x5573e2cad338), "--debug", "--mail-account-id", 1) called at /opt/znuny-6.3.1/Kernel/System/Console/InterfaceConsole.pm line 81
        Kernel::System::Console::InterfaceConsole::Run(Kernel::System::Console::InterfaceConsole=HASH(0x5573e2cac530), "Maint::PostMaster::MailAccountFetch", "--debug", "--mail-account-id", 1) called at bin/otrs.Console.pl line 37
ERROR: * BYE Connection closed. 14 at /usr/share/perl5/Mail/IMAPClient.pm line 1429.
        Mail::IMAPClient::_get_response(Mail::IMAPClient=HASH(0x5573e6f6ba90), 3, undef) called at /usr/share/perl5/Mail/IMAPClient.pm line 1340
        Mail::IMAPClient::_imap_command_do(Mail::IMAPClient=HASH(0x5573e6f6ba90), "CLOSE") called at /usr/share/perl5/Mail/IMAPClient.pm line 1238
        Mail::IMAPClient::_imap_command(Mail::IMAPClient=HASH(0x5573e6f6ba90), "CLOSE") called at /usr/share/perl5/Mail/IMAPClient.pm line 2369
        Mail::IMAPClient::close(Mail::IMAPClient=HASH(0x5573e6f6ba90)) called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 301
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 305
        Kernel::System::MailAccount::IMAP::__ANON__("close") called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 521
        Kernel::System::MailAccount::IMAP::_Fetch(Kernel::System::MailAccount::IMAPS=HASH(0x5573e5e7cf10), "DispatchingBy", "Queue", "QueueID", 5, "Type", "IMAPS", "Password", ...) called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 157
        Kernel::System::MailAccount::IMAP::Fetch(Kernel::System::MailAccount::IMAPS=HASH(0x5573e5e7cf10), "ChangeTime", "2022-03-22 08:35:57", "Login", "mailer\@tiemme.com", "********ConfigID", 6, "Debug", ...) called at /opt/znuny-6.3.1/Kernel/System/MailAccount.pm line 649
        Kernel::System::MailAccount::MailAccountFetch(Kernel::System::MailAccount=HASH(0x5573e5e19ca8), "ValidID", 1, "Trusted", 1, "Host", "outlook.office365.com", "IMAPFolder", ...) called at /opt/znuny-6.3.1/Kernel/System/Console/Command/Maint/PostMaster/MailAccountFetch.pm line 173
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/Console/Command/Maint/PostMaster/MailAccountFetch.pm line 165
        Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch::Run(Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch=HASH(0x5573e2cad338)) called at /opt/znuny-6.3.1/Kernel/System/Console/BaseCommand.pm line 460
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/Console/BaseCommand.pm line 454
        Kernel::System::Console::BaseCommand::Execute(Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch=HASH(0x5573e2cad338), "--debug", "--mail-account-id", 1) called at /opt/znuny-6.3.1/Kernel/System/Console/InterfaceConsole.pm line 81
        Kernel::System::Console::InterfaceConsole::Run(Kernel::System::Console::InterfaceConsole=HASH(0x5573e2cac530), "Maint::PostMaster::MailAccountFetch", "--debug", "--mail-account-id", 1) called at bin/otrs.Console.pl line 37
ERROR: * BYE Connection closed. 14 at /usr/share/perl5/Mail/IMAPClient.pm line 1288.
        Mail::IMAPClient::_imap_command(Mail::IMAPClient=HASH(0x5573e6f6ba90), "CLOSE") called at /usr/share/perl5/Mail/IMAPClient.pm line 2369
        Mail::IMAPClient::close(Mail::IMAPClient=HASH(0x5573e6f6ba90)) called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 301
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 305
        Kernel::System::MailAccount::IMAP::__ANON__("close") called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 521
        Kernel::System::MailAccount::IMAP::_Fetch(Kernel::System::MailAccount::IMAPS=HASH(0x5573e5e7cf10), "DispatchingBy", "Queue", "QueueID", 5, "Type", "IMAPS", "Password", ...) called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 157
        Kernel::System::MailAccount::IMAP::Fetch(Kernel::System::MailAccount::IMAPS=HASH(0x5573e5e7cf10), "ChangeTime", "2022-03-22 08:35:57", "Login", "mailer\@tiemme.com", "********ConfigID", 6, "Debug", ...) called at /opt/znuny-6.3.1/Kernel/System/MailAccount.pm line 649
        Kernel::System::MailAccount::MailAccountFetch(Kernel::System::MailAccount=HASH(0x5573e5e19ca8), "ValidID", 1, "Trusted", 1, "Host", "outlook.office365.com", "IMAPFolder", ...) called at /opt/znuny-6.3.1/Kernel/System/Console/Command/Maint/PostMaster/MailAccountFetch.pm line 173
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/Console/Command/Maint/PostMaster/MailAccountFetch.pm line 165
        Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch::Run(Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch=HASH(0x5573e2cad338)) called at /opt/znuny-6.3.1/Kernel/System/Console/BaseCommand.pm line 460
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/Console/BaseCommand.pm line 454
        Kernel::System::Console::BaseCommand::Execute(Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch=HASH(0x5573e2cad338), "--debug", "--mail-account-id", 1) called at /opt/znuny-6.3.1/Kernel/System/Console/InterfaceConsole.pm line 81
        Kernel::System::Console::InterfaceConsole::Run(Kernel::System::Console::InterfaceConsole=HASH(0x5573e2cac530), "Maint::PostMaster::MailAccountFetch", "--debug", "--mail-account-id", 1) called at bin/otrs.Console.pl line 37
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by root »

uffIT wrote: 22 Mar 2022, 09:44 Hello,
Apparentely I have the same issue with O365.
I tried your command and the output is:
Are you using a shared mailbox? If yes, do you use the proper user name scheme (Username@DomainName\SharedMailbox@DomainName)?

How often do you fetch the e-mails? Sometimes MS tend to push chatty clients away, this might happen if you fetch interval is less than 5 minutes.

- 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 ?
dvandorp
Znuny newbie
Posts: 7
Joined: 17 Mar 2020, 12:05
Znuny Version: 7.0.14
Real Name: Danny van Dorp
Company: SNV Netherlands Development Organisation

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by dvandorp »

Dear Roy,

First of all, I really appreciate the help!

I have configured one mailbox in our test environment and it uses oauth. I will attach a few screendumps with config info.

I ran the mail fetch code without the --mail-account-id part.Because there is only one account in the system:

otrs@OTRSTEST:~$ /opt/otrs/bin/otrs.Console.pl Maint::PostMaster::MailAccountFetch --debug

Spawning child process to fetch incoming messages from mail accounts...

outlook.office365.com (POP3TLS)...
Net::POP3>>> Net::POP3(3.13)
Net::POP3>>> Net::Cmd(3.13)
Net::POP3>>> Exporter(5.74)
Net::POP3>>> IO::Socket::IP(0.41)
Net::POP3>>> IO::Socket(1.48)
Net::POP3>>> IO::Handle(1.48)
Net::POP3=GLOB(0x55d2df959810)<<< +OK The Microsoft Exchange POP3 service is ready. [QQBNADAAUABSADAAMQBDAEEAMAAxADYAMwAuAGUAdQByAHAAcgBkADAAMQAuAHAAcgBvAGQALgBlAHgAYwBoAGEAbgBnAGUAbABhAGIAcwAuAGMAbwBtAA==]
Net::POP3=GLOB(0x55d2df959810)>>> STLS
Net::POP3=GLOB(0x55d2df959810)<<< +OK Begin TLS negotiation.
Net::POP3::_SSL=GLOB(0x55d2df959810)>>> AUTH XOAUTH2 dXNlcj16bnVueXRlc3RAc252Lm9yZwFhdXRoPUJlYXJlciBleUowZVhBaU9pSktWMVFpTENKdWIyNWpaU0k2SWpsME5WVnpkaTFEYzI1TFkyMW5VbGRQVnpRMlEwZHJNbFk0WVdSdE5WVm1jR1k1V25kb2FqTkpZVlVpTENKaGJHY2lPaUpTVXpJMU5pSXNJbmcxZENJNkltcFRNVmh2TVU5WFJHcGZOVEoyWW5kSFRtZDJVVTh5Vm5wTll5SXNJbXRwWkNJNkltcFRNVmh2TVU5WFJHcGZOVEoyWW5kSFRtZDJVVTh5Vm5wTll5SjkuZXlKaGRXUWlPaUpvZEhSd2N6b3ZMMjkxZEd4dmIyc3ViMlptYVdObExtTnZiU0lzSW1semN5STZJbWgwZEhCek9pOHZjM1J6TG5kcGJtUnZkM011Ym1WMEx6UTBZamszTURNd0xXRTNNemN0TkRRMk1TMDRNMk13TFRSbU5UYzFZekl3T1dNME15OGlMQ0pwWVhRaU9qRTJORGM1TXpVM05UY3NJbTVpWmlJNk1UWTBOemt6TlRjMU55d2laWGh3SWpveE5qUTNPVFF3TXpFNUxDSmhZMk4wSWpvd0xDSmhZM0lpT2lJeElpd2lZV2x2SWpvaVFWWlJRWEV2T0ZSQlFVRkJPVWxaVTA4eFUySklOMkZCYlZSck1rWm1Ua2hVVjNsSFluUlhia1ZDZDNOSGVGZzNlSHBsTkhBd05GSk9OWFpyUW1sdmFsSnNSM3BhVDIxWVJUQmtSbWszWjNReGExZ3JjSE5xVFU5NFRWUXJWRU00WWxSNlFuZGxiRkpMTUZOT1NYWkJTakExYXpGc01GVTlJaXdpWVcxeUlqcGJJbkIzWkNJc0ltMW1ZU0pkTENKaGNIQmZaR2x6Y0d4aGVXNWhiV1VpT2lJZ1QxUlNVeTFQWVhWMGFDMVFUMUF6VkV4VElpd2lZWEJ3YVdRaU9pSmlaREV6T1RjelppMDRZbUpoTFRRek16a3RPRFZpTmkxbU1EYzBaREZpT1RCaE9HSWlMQ0poY0hCcFpHRmpjaUk2SWpFaUxDSmxibVp3YjJ4cFpITWlPbHRkTENKbVlXMXBiSGxmYm1GdFpTSTZJblpoYmlCRWIzSndJaXdpWjJsMlpXNWZibUZ0WlNJNklrUmhibTU1SWl3aWFYQmhaR1J5SWpvaU1qQXVNVEF4TGpFeE5DNHhPVElpTENKdVlXMWxJam9pUkc5eWNDd2dSR0Z1Ym5rZ2RtRnVJaXdpYjJsa0lqb2laV0l4TWpoaVlqUXRNR0ZrWmkwME5UUTVMV0ZoTlRRdE4ySTRaVFEwWVdFME1EZGtJaXdpYjI1d2NtVnRYM05wWkNJNklsTXRNUzAxTFRJeExUUXdOamMzTXpVMU5UVXRNVFl4TmpJNE5EUXdOQzB4TURBMk1UUTNOVFEzTFRFM01EazFJaXdpY0hWcFpDSTZJakV3TURNM1JrWkZPRFkyUkRVeE1VVWlMQ0p5YUNJNklqQXVRVkZ6UVUxSVF6VlNSR1Z1V1ZWVFJIZEZPVmhZUTBOalVYZEpRVUZCUVVGQlVFVlFlbWRCUVVGQlFVRkJRVUZNUVVrd0xpSXNJbk5qY0NJNklrbE5RVkF1UVdOalpYTnpRWE5WYzJWeUxrRnNiQ0JOWVdsc0xsSmxZV1JYY21sMFpTQk5ZV2xzTGxKbFlXUlhjbWwwWlM1VGFHRnlaV1FnVFdGcGJDNVRaVzVrSUUxaGFXd3VVMlZ1WkM1VGFHRnlaV1FnVUU5UUxrRmpZMlZ6YzBGelZYTmxjaTVCYkd3Z1UwMVVVQzVUWlc1a0lpd2ljMmxrSWpvaU9UQmpORGc1WmprdE4yUmhNaTAwWmpObUxUZzJOemd0TlRObU5XTTBZalZtTVRVMUlpd2ljM1ZpSWpvaU4ycHdOV1JEYmxOYU5WSlpOSGd5TTJWTGVHOVFNVnBpYWpkdlMzUkxVekppYm1sc1JGRnRlVWQ0Y3lJc0luUnBaQ0k2SWpRMFlqazNNRE13TFdFM016Y3RORFEyTVMwNE0yTXdMVFJtTlRjMVl6SXdPV00wTXlJc0luVnVhWEYxWlY5dVlXMWxJam9pWkhaaGJtUnZjbkJBYzI1MkxtOXlaeUlzSW5Wd2JpSTZJbVIyWVc1a2IzSndRSE51ZGk1dmNtY2lMQ0oxZEdraU9pSjRhME15ZVhoYWRVcHJZVXhUU1hSTWFHbHJSRUZCSWl3aWRtVnlJam9pTVM0d0lpd2lkMmxrY3lJNld5STNZbVUwTkdNNFlTMWhaR0ZtTFRSbE1tRXRPRFJrTmkxaFlqSTJORGxsTURoaE1UTWlMQ0l6WVRKak5qSmtZaTAxTXpFNExUUXlNR1F0T0dRM05DMHlNMkZtWm1WbE5XUTVaRFVpTENJMk9UQTVNVEkwTmkweU1HVTRMVFJoTlRZdFlXRTBaQzB3TmpZd056VmlNbUUzWVRnaUxDSm1NREl6Wm1RNE1TMWhOak0zTFRSaU5UWXRPVFZtWkMwM09URmhZekF5TWpZd016TWlMQ0pqTkdVek9XSmtPUzB4TVRBd0xUUTJaRE10T0dNMk5TMW1ZakUyTUdSaE1EQTNNV1lpTENKbU1qaGhNV1kxTUMxbU5tVTNMVFExTnpFdE9ERTRZaTAyWVRFeVpqSmhaalppTm1NaUxDSm1aR1EzWVRjMU1TMWlOakJpTFRRME5HRXRPVGcwWXkwd01qWTFNbVpsT0daaE1XTWlMQ0k1WWpnNU5XUTVNaTB5WTJRekxUUTBZemN0T1dRd01pMWhObUZqTW1RMVpXRTFZek1pTENKaU1HWTFORFkyTVMweVpEYzBMVFJqTlRBdFlXWmhNeTB4WldNNE1ETm1NVEpsWm1VaUxDSTBaRFpoWXpFMFppMHpORFV6TFRReFpEQXRZbVZtT1MxaE0yVXdZelUyT1RjM00yRWlMQ0ptWlRrek1HSmxOeTAxWlRZeUxUUTNaR0l0T1RGaFppMDVPR016WVRRNVlUTTRZakVpTENJMk1tVTVNRE01TkMwMk9XWTFMVFF5TXpjdE9URTVNQzB3TVRJeE56Y3hORFZsTVRBaUxDSXlPVEl6TW1Oa1ppMDVNekl6TFRReVptUXRZV1JsTWkweFpEQTVOMkZtTTJVMFpHVWlMQ0kzTWprNE1qZGxNeTA1WXpFMExUUTVaamN0WW1JeFlpMDVOakE0WmpFMU5tSmlZamdpTENKaU56bG1ZbVkwWkMwelpXWTVMVFEyT0RrdE9ERTBNeTAzTm1JeE9UUmxPRFUxTURraVhYMC5tWnRTUEtFcDhaQ3ZocWR6N0dodlpyUnJpOE4wWWNVa0otekRpdUxkM3c5Qk5vdTdXb2JnUXlaU3ZLeEFUcktWS21saVVoMFdNbVNyUEJuVjdsSVhCeHgxTS0wNEI0Y2tIcHExQ0oyNXdiX2kyM0N3dmJzZWIwTDVDQUlSNlIxV1Q1NVM4cXlpZWIyTGRVMVY1WnNaem9sYXFkeXBaSE5LaTFJTlc4bHFiWHNqMW40ZDlFTllmU3Q5aTFxQUgtNmxzZ0pqWlVicnBSU0ZGNnZ4SkJ1bkYtVmh4Z0JKek1FWTlqT3BuWGZvc0phMWxDaER6eWJEM0ZWX05hSjBtZHRwdzN1WmdKUDVJZXY5eGFqZm1pdUxhTklGdlFaQ0ZHbnRpYUd6dUQ2QWN5SFJvWFNkblFCUGRBYzdEZjZqdGpBZDJjRFF5TlZVci1mSHpkcWtDeHM1UUEBAQ==
Net::POP3::_SSL=GLOB(0x55d2df959810)<<< -ERR Protocol error. Connection is closed. 10
Net::POP3::_SSL=GLOB(0x55d2df959810)>>> QUIT
[Tue Mar 22 08:24:32 2022] otrs.Console.pl: Use of uninitialized value in numeric eq (==) at /usr/local/share/perl/5.26.1/Net/POP3.pm line 367.
ERROR: OTRS-otrs.Console.pl-Maint::PostMaster::MailAccountFetch-21 Perl: 5.26.1 OS: linux Time: Tue Mar 22 08:24:32 2022

Message: CommunicationLog(ID:12,AccountType:-,AccountID:-,Direction:Incoming,Transport:Email,ObjectLogType:Connection,ObjectLogID:12)::Kernel::System::MailAccount::POP3TLS => POP3TLS: Auth for user znunytest@snv.org/outlook.office365.com failed!

Traceback (21917):
Module: Kernel::System::CommunicationLog::_LogError Line: 535
Module: Kernel::System::CommunicationLog::ObjectLog Line: 303
Module: Kernel::System::MailAccount::POP3::Fetch Line: 264
Module: Kernel::System::MailAccount::MailAccountFetch Line: 649
Module: (eval) Line: 173
Module: Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch::Run Line: 165
Module: (eval) Line: 460
Module: Kernel::System::Console::BaseCommand::Execute Line: 454
Module: Kernel::System::Console::InterfaceConsole::Run Line: 81
Module: /opt/otrs/bin/otrs.Console.pl Line: 37

Done.
You do not have the required permissions to view the files attached to this post.
uffIT
Znuny newbie
Posts: 9
Joined: 22 Mar 2022, 09:20
Znuny Version: 6.3.1
Real Name: Alessio Minacapelli

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by uffIT »

root wrote: 22 Mar 2022, 10:32
Are you using a shared mailbox? If yes, do you use the proper user name scheme (Username@DomainName\SharedMailbox@DomainName)?

How often do you fetch the e-mails? Sometimes MS tend to push chatty clients away, this might happen if you fetch interval is less than 5 minutes.

- Roy
Thanks for the quick answer!
The mailbox is not a shared mailbox, The fetch interval is 2 minutes, and It has never caused a problem with "password athentication".
If i change it to password method it works right away (and it's been working flawless in the past year).
uffIT
Znuny newbie
Posts: 9
Joined: 22 Mar 2022, 09:20
Znuny Version: 6.3.1
Real Name: Alessio Minacapelli

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by uffIT »

Hello,
I tried to use a shared mailbox with the proper username scheme you suggested.
Now the error is different:

Code: Select all

$ bin/otrs.Console.pl Maint::PostMaster::MailAccountFetch --debug --mail-account-id 1

Spawning child process to fetch incoming messages from mail accounts...

outlook.office365.com (IMAPS)...
Started at Thu Mar 24 10:48:40 2022
Using Mail::IMAPClient version 3.42 on perl 5.030000
Connecting with IO::Socket::SSL PeerAddr outlook.office365.com PeerPort 993 Proto tcp Timeout 600 Debug 1 SSL_verify_mode 0
Connected to outlook.office365.com
Read:   * OK The Microsoft Exchange IMAP4 service is ready. [WgBSADAAUAAyADcAOABDAEEAMAAxADUAMAAuAEMASABFAFAAMgA3ADgALgBQAFIATwBEAC4ATwBVAFQATABPAE8ASwAuAEMATwBNAA==]
Sending: 1 AUTHENTICATE XOAUTH2
Sent 24 bytes
Read:   +
Sending: [Redact: Count=1 Showcredentials=OFF]
Sent 2882 bytes
Read:   1 NO AUTHENTICATE failed.
ERROR: 1 NO AUTHENTICATE failed. at /usr/share/perl5/Mail/IMAPClient.pm line 3309.
        Mail::IMAPClient::authenticate(Mail::IMAPClient=HASH(0x5646e4cd9840), "XOAUTH2", CODE(0x5646e4cd96d8)) called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 124
        Kernel::System::MailAccount::IMAP::Connect(Kernel::System::MailAccount::IMAPS=HASH(0x5646e3be9a60), "Host", "outlook.office365.com", "Login", "mailer\@tiemme.com\\ticket\@tiemme.com", "Password", "********", "AuthenticationType", ...) called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 257
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 260
        Kernel::System::MailAccount::IMAP::_Fetch(Kernel::System::MailAccount::IMAPS=HASH(0x5646e3be9a60), "********ConfigID", 6, "UserID", 1, "CreateTime", "2018-11-22 11:30:36", "Password", ...) called at /opt/znuny-6.3.1/Kernel/System/MailAccount/IMAP.pm line 157
        Kernel::System::MailAccount::IMAP::Fetch(Kernel::System::MailAccount::IMAPS=HASH(0x5646e3be9a60), "Debug", 1, "AuthenticationType", "oauth2_token", "Host", "outlook.office365.com", "IMAPFolder", ...) called at /opt/znuny-6.3.1/Kernel/System/MailAccount.pm line 649
        Kernel::System::MailAccount::MailAccountFetch(Kernel::System::MailAccount=HASH(0x5646e3b86ae8), "Host", "outlook.office365.com", "IMAPFolder", "INBOX", "AuthenticationType", "oauth2_token", "Password", ...) called at /opt/znuny-6.3.1/Kernel/System/Console/Command/Maint/PostMaster/MailAccountFetch.pm line 173
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/Console/Command/Maint/PostMaster/MailAccountFetch.pm line 165
        Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch::Run(Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch=HASH(0x5646e31c2bc0)) called at /opt/znuny-6.3.1/Kernel/System/Console/BaseCommand.pm line 460
        eval {...} called at /opt/znuny-6.3.1/Kernel/System/Console/BaseCommand.pm line 454
        Kernel::System::Console::BaseCommand::Execute(Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch=HASH(0x5646e31c2bc0), "--debug", "--mail-account-id", 1) called at /opt/znuny-6.3.1/Kernel/System/Console/InterfaceConsole.pm line 81
        Kernel::System::Console::InterfaceConsole::Run(Kernel::System::Console::InterfaceConsole=HASH(0x5646e31bbd18), "Maint::PostMaster::MailAccountFetch", "--debug", "--mail-account-id", 1) called at bin/otrs.Console.pl line 37
ERROR: OTRS-otrs.Console.pl-Maint::PostMaster::MailAccountFetch-42 Perl: 5.30.0 OS: linux Time: Thu Mar 24 10:48:40 2022

 Message: CommunicationLog(ID:1253855,AccountType:-,AccountID:-,Direction:Incoming,Transport:Email,ObjectLogType:Connection,ObjectLogID:1263842)::Kernel::System::MailAccount::IMAPS => Auth error: 1 NO AUTHENTICATE failed.


 Traceback (3816262):
   Module: Kernel::System::CommunicationLog::_LogError Line: 535
   Module: Kernel::System::CommunicationLog::ObjectLog Line: 303
   Module: Kernel::System::MailAccount::IMAP::_Fetch Line: 275
   Module: Kernel::System::MailAccount::IMAP::Fetch Line: 157
   Module: Kernel::System::MailAccount::MailAccountFetch Line: 649
   Module: (eval) Line: 173
   Module: Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch::Run Line: 165
   Module: (eval) Line: 460
   Module: Kernel::System::Console::BaseCommand::Execute Line: 454
   Module: Kernel::System::Console::InterfaceConsole::Run Line: 81
   Module: bin/otrs.Console.pl Line: 37
As before, the password method is working as expected.
uffIT
Znuny newbie
Posts: 9
Joined: 22 Mar 2022, 09:20
Znuny Version: 6.3.1
Real Name: Alessio Minacapelli

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by uffIT »

Hello,
Was anyone able to make oauth work with o365 ?
I still cannot make it work :(
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by root »

uffIT wrote: 28 Apr 2022, 11:56 Hello,
Was anyone able to make oauth work with o365 ?
I still cannot make it work :(
Hi,

Yes, all the time. Most root causes for issues were the mailbox like some money saving ideas of shared mailboxes etc. Use a regular mailbox, enabled imap for this account and this is it.

What are the scopes of the permissions you configure in O365?

- 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 ?
uffIT
Znuny newbie
Posts: 9
Joined: 22 Mar 2022, 09:20
Znuny Version: 6.3.1
Real Name: Alessio Minacapelli

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by uffIT »

As stated in my previous posts it's not working weather is a regular mailbox or a shared one...with different error.

Znuny seems to obtain a valid token.

In o365 user's preferences I've enabled all protocols, and in the "Api permissions" I've added thees permissions:

email
IMAP.AccessAsUser.All
offline_access
POP.AccessAsUser.All
SMTP.Send

Is there any other configuration needed on the o365 side?
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by root »

uffIT wrote: 28 Apr 2022, 12:43 As stated in my previous posts it's not working weather is a regular mailbox or a shared one...with different error.

Znuny seems to obtain a valid token.

In o365 user's preferences I've enabled all protocols, and in the "Api permissions" I've added thees permissions:

email
IMAP.AccessAsUser.All
offline_access
POP.AccessAsUser.All
SMTP.Send

Is there any other configuration needed on the o365 side?

Hm,

This is what I use for testing (and with customer):
2022-04-28 at 1.27 PM.png
Maybe this helps.

- Roy
You do not have the required permissions to view the files attached to this post.
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 ?
uffIT
Znuny newbie
Posts: 9
Joined: 22 Mar 2022, 09:20
Znuny Version: 6.3.1
Real Name: Alessio Minacapelli

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by uffIT »

Hi,
I've replicated your config but still no win :(

I think I'd give up by now ...I've followed many tutorials on how to configure the o365 for oauth and imap connection but nothing seem to work.

Surely there is something that I'm not aware of in the api configuration...but I can't spot it.

Thank you very much for your help anyway.
teabee
Znuny newbie
Posts: 1
Joined: 30 Jun 2022, 18:43
Znuny Version: Znuny 6.3.1
Real Name: Tibor Bánfalvi
Company: Assonant

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by teabee »

Hello guys,

I'm strugling with the same problem. Oauth token seems to be valid in Znuny, API permissions are set in Azure AD, but when I run Maint::PostMaster::MailAccountFetch I receive " User is authenticated but not connected" as mentioned earlier. Unfortunatelly IMAP and SMTP doesn't work with Basic Authentication (normal password) in our O365 tenant for 2 days so we are pushed toward to Oauth2.

I appreciate any help or idea
uffIT
Znuny newbie
Posts: 9
Joined: 22 Mar 2022, 09:20
Znuny Version: 6.3.1
Real Name: Alessio Minacapelli

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by uffIT »

Unfortunately I've not found a solution yet.
It's becoming critical since the deadline is coming for us...
I fear we are in a dead end :/
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Exchange Online / O365 : End of support for POP/IMAP

Post by root »

Hi,

The resoultion was/is when the message "2 BAD User is authenticated but not connected." comes up to authorize the token with the user credentials of the password or for shared mailboxes a delegated user.

- 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 ?
Post Reply