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

Moderator: crythias

Post Reply
FSF
Znuny newbie
Posts: 40
Joined: 08 Dec 2022, 12:13
Znuny Version: 6.0.37
Real Name: Frederic

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

Post by FSF »

Hello,

This post is a follow-up to my issues with Znuny, which has not been functioning since this post:
viewtopic.php?t=44351

I contacted Microsoft support, who were able to resolve the connection issue with Oauth2, so now the token is successfully renewed.

However, the problem now is that znuny cannot read the email inbox reserved for it.

I therefore have two alerts in the logs:

Code: Select all

OTRS-otrs.Console.pl-Maint::PostMaster::MailAccountFetch-38

CommunicationLog(ID:1280474,AccountType:-,AccountID:-,Direction:Incoming,Transport:Email,ObjectLogType:Connection,ObjectLogID:2309412)::Kernel::System::MailAccount::IMAPS => IMAPS: Can't connect to outlook.office365.com: Unable to connect to outlook.office365.com: IO::Socket::IP configuration failed
Capture100.jpg
and

Code: Select all

OTRS-otrs.Console.pl-Maint::PostMaster::MailAccountFetch-38
Error while retrieving the messages 'IMAPS': Could not select: 
Capture101.jpg
I therefore thought there might be a connectivity issue between the server hosting znuny and the Office servers.

Here are the results of the

Code: Select all

openssl s_client -connect outlook.office365.com:993 -crlf
test.

Code: Select all

root@helpdesk:~# openssl s_client -connect outlook.office365.com:993
CONNECTED(00000003)
depth=2 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
verify return:1
depth=1 C = US, O = DigiCert Inc, CN = DigiCert Cloud Services CA-1
verify return:1
depth=0 C = US, ST = Washington, L = Redmond, O = Microsoft Corporation, CN = outlook.com
verify return:1
---
Certificate chain
 0 s:C = US, ST = Washington, L = Redmond, O = Microsoft Corporation, CN = outlook.com
   i:C = US, O = DigiCert Inc, CN = DigiCert Cloud Services CA-1
   a:PKEY: rsaEncryption, 2048 (bit); sigalg: RSA-SHA256
   v:NotBefore: Mar 29 00:00:00 2025 GMT; NotAfter: Mar 28 23:59:59 2026 GMT
 1 s:C = US, O = DigiCert Inc, CN = DigiCert Cloud Services CA-1
   i:C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
   a:PKEY: rsaEncryption, 2048 (bit); sigalg: RSA-SHA256
   v:NotBefore: Sep 25 00:00:00 2020 GMT; NotAfter: Sep 24 23:59:59 2030 GMT
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIIp...
...lRQ1Nhc=
-----END CERTIFICATE-----
subject=C = US, ST = Washington, L = Redmond, O = Microsoft Corporation, CN = outlook.com
issuer=C = US, O = DigiCert Inc, CN = DigiCert Cloud Services CA-1
---
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: ECDH, secp384r1, 384 bits
---
SSL handshake has read 4000 bytes and written 485 bytes
Verification: OK
---
New, TLSv1.2, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES256-GCM-SHA384
    Session-ID: B22D0000A7186388B348C1DA6EE9848E51F34C6A921C3D0B87EEB7B20971233A
    Session-ID-ctx:
    Master-Key: AD9......48
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1759390410
    Timeout   : 7200 (sec)
    Verify return code: 0 (ok)
    Extended master secret: yes
---
* OK The Microsoft Exchange IMAP4 service is ready. [Rg.......A==]
So everything is fine on that side.

Microsoft had me change the Oauth2 API permissions as follows:
Capture105.jpg
And that's all the help they can give me, so they asked me to contact Znuny support for further assistance.

That's where I am today.

Can anyone help me, because I really don't know what to do anymore.

Thank you in advance.
You do not have the required permissions to view the files attached to this post.
FSF
Znuny newbie
Posts: 40
Joined: 08 Dec 2022, 12:13
Znuny Version: 6.0.37
Real Name: Frederic

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

Post by FSF »

Nobody can help me ? :-?
root
Administrator
Posts: 4281
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

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

Post by root »

Hi,

"Can't connect" usually indicates that there is not network connection from the client (your Znuny server) to the IMAP server. Have you verified and ruled this out?

- 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 ?
FSF
Znuny newbie
Posts: 40
Joined: 08 Dec 2022, 12:13
Znuny Version: 6.0.37
Real Name: Frederic

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

Post by FSF »

Hello,

If there were a connection problem, my server would not tell me that it is able to connect to the Microsoft server, as indicated by the test below.

Code: Select all

helpdesk:~# openssl s_client -connect outlook.office365.com:993
CONNECTED(00000003)
depth=2 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
verify return:1
depth=1 C = US, O = DigiCert Inc, CN = DigiCert Cloud Services CA-1
verify return:1
depth=0 C = US, ST = Washington, L = Redmond, O = Microsoft Corporation, CN = outlook.com
verify return:1
---
Certificate chain
 0 s:C = US, ST = Washington, L = Redmond, O = Microsoft Corporation, CN = outlook.com
   i:C = US, O = DigiCert Inc, CN = DigiCert Cloud Services CA-1
   a:PKEY: rsaEncryption, 2048 (bit); sigalg: RSA-SHA256
   v:NotBefore: Mar 29 00:00:00 2025 GMT; NotAfter: Mar 28 23:59:59 2026 GMT
 1 s:C = US, O = DigiCert Inc, CN = DigiCert Cloud Services CA-1
   i:C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
   a:PKEY: rsaEncryption, 2048 (bit); sigalg: RSA-SHA256
   v:NotBefore: Sep 25 00:00:00 2020 GMT; NotAfter: Sep 24 23:59:59 2030 GMT
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIIpzCCB4+gAwIBAgIQB+z6tYDgaDDj7FgOPB1HZTANBgkqhkiG9w0BAQsFADBL
MQswCQYDVQQGEwJV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QDAEgw
RgIhAM0xMmUWjpa1b00NLgvQ2jfRY/fuFWE5owMdTkcUvTFVAiEA1iBUiAffUyNX
q0O0da8bRrSSI4NhjJRe9iuZkImu6LMAdgBkEcRspBLsp4kcogIuALyrTygH1B41
J6vq/tUDyX3N8AAAAZXjKwSuAAAEAwBHMEUCIQCVMHnLO/4/cmo2HxLsC/eH+/O4
y3a29wJqYoL0+id4FwIgcqGRvIcBzS0jYvjq42ashXgNhQ0dslfAm33yUc6uBToA
dgBJnJtp3h187Pw23s2HZKa4W68Kh4AZ0VVS++nrKd34wwAAAZXjKwS/AAAEAwBH
MEUCIQD1HLlWwVT4cU5DHmc/7AqzlMssmhEfXigh9AtwmiCXIwIgeQDd3HdNi+cT
qnpwLvib86/3jpmJAEwm74Xv0xKxBqIwDQYJKoZIhvcNAQELBQADggEBAHaleLbu
DJfhddrx+vWi/+Z/XuqKlGpZchx/zh7hUmLMDvlIHVGBt8DICYS+kBEclUVLU9MC
uoaTFNQX8Xhn+1aLx23bF59ojaCauwMPaNENHX2inpxrvRvEs08Vg9ZEXzOZ884/
nKr+oCcwzTlHJ9Y7F4EYXNqDZHyG+pF7L9e4l91hXPkUDfY3+gMMKl0IOw7a69Cx
9ijcAhrTez/SWovVPB8UELJTLJeyfBP4yQiTKuHnRjg0+KD9wf3m6M8K4DHGozDU
WeDxWUZXTOwjIZLmvWil8CkurZF4yB1Ry6TrHXocVkm59FrHnlnSVjZmDL0rKP2M
rZYcg1VZlRQ1Nhc=
-----END CERTIFICATE-----
subject=C = US, ST = Washington, L = Redmond, O = Microsoft Corporation, CN = outlook.com
issuer=C = US, O = DigiCert Inc, CN = DigiCert Cloud Services CA-1
---
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: ECDH, secp384r1, 384 bits
---
SSL handshake has read 4000 bytes and written 485 bytes
Verification: OK
---
New, TLSv1.2, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES256-GCM-SHA384
    Session-ID: 680500001DF72CB0840C9B9763C6D5998EDD6648440F5F426A25ABC17581715E
    Session-ID-ctx:
    Master-Key: 78E155321112BF45BCE756ED8DAEF3E06E1C67479E4EBF397E3BF0AE88AA5683BA5B8F6957DD602F363D5CCCFB386109
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1760597471
    Timeout   : 7200 (sec)
    Verify return code: 0 (ok)
    Extended master secret: yes
---
* OK The Microsoft Exchange IMAP4 service is ready. [RgBSADAAUAAyADgAMQBDAEEAMAAwADYANgAuAEQARQBVAFAAMgA4ADEALgBQAFIATwBEAC4ATwBVAFQATABPAE8ASwAuAEMATwBNAA==]
Am I mistaken?
root
Administrator
Posts: 4281
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

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

Post by root »

Hi,

Nah, you're right. I just stopped reading after that text, " can't connect.

IMAPS: Could not select might also be caused by a "broken" OAuth2 token and/or missing permissions.

- 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