Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instable connection to local hosted IMAP server #10199

Open
Geryishere opened this issue Sep 29, 2024 · 6 comments
Open

Instable connection to local hosted IMAP server #10199

Geryishere opened this issue Sep 29, 2024 · 6 comments

Comments

@Geryishere
Copy link

Steps to reproduce

  1. Nextcloud is installed on own LXD container.
  2. I use XEAMS installed on another LXD container as local hosted IMAP server .
  3. Connection between Nextcloud Mail as client and Xeams as local host IMAP server is established without problems.
  4. SMTP Server connection is WEB.de SMTP server.
  5. After synchronising the email account on nextcloud mail with local IMAP, the IMAP server connection breaks down shortly after.
  6. In order to fetch the emails again, synchronising needs to be done manually (by reloading nextcloud mail).
  7. Then however, the IMAP connection breaks down again.

Expected behavior

The connection between Nextcloud Mail as email client and XEAMS used as local hosted IMAP server should be stable without interruptions.

Actual behavior

"reqId": "tXsefM4Jl5KSf6J64r6C",
"level": 2,
"time": "2024-09-28T12:07:41+02:00",
"remoteAddr": "77.109..*",
"user": "Gery",
"app": "mail",
"method": "POST",
"url": "/apps/mail/api/mailboxes/31/sync",
"message": "Mailbox UID validity changed. Wiping cache and performing full sync for 31",
"userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
"version": "28.0.9.1",
"data": {
"app": "mail"
},
"id": "66f7d5ce65aca"

[PHP] Error: Undefined array key "uidvalidity" at /var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php#4066
POST /apps/mail/api/mailboxes/95/sync
from 77.109..* by Gery at 28 Sept 2024, 11:32:53

"reqId": "pJdPemv2GN1DcQAjq51W",
"level": 3,
"time": "2024-09-28T11:32:53+02:00",
"remoteAddr": "77.109..*",
"user": "Gery",
"app": "PHP",
"method": "POST",
"url": "/apps/mail/api/mailboxes/95/sync",
"message": "Undefined array key "uidvalidity" at /var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php#4066",
"userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
"version": "29.0.7.1",
"data": {
"app": "PHP"
},
"id": "66f7cdb1a0f34"

Mail app version

3.7.8

Mailserver or service

XEAMS hosted locally in the same network as nextcloud

Operating system

Ubuntu 22.04.5 LTS on LXD container

PHP engine version

PHP 8.3

Web server

Nginx

Database

PostgreSQL

Additional info

The same problem exists with Nextcloud Mail app in other Nextcloud versions (Nextcloud 27 and 28) running Apache2.

@Geryishere Geryishere changed the title Instable connection to local hosted SMTP server Instable connection to local hosted IMAP server Sep 29, 2024
@ChristophWurst
Copy link
Member

Mailbox UID validity changed.

This is a very rare event. We'll have to check if the code is still doing the right thing.

@Geryishere
Copy link
Author

This event happens for ALL locally self hosted IMAP (mail)sever within the same network as Nextcloud. Only external (commercial) IMAP mailserver such as Google, GXM etc. are not affected.

@kesselb
Copy link
Contributor

kesselb commented Oct 16, 2024

Could you please turn on the debug mode: https:/nextcloud/mail/blob/main/doc/admin.md#logging

This will create a file "horde_imap.log" in your datadirectory with the imap traffic. If you spot the error in your logs again, then please post the related lines for the timeframe from horde_imap.log here.

Watch out for credentials or other information, the horde* logfiles are not redacted.

@kesselb kesselb self-assigned this Oct 16, 2024
@Geryishere
Copy link
Author

I had just installed mail version 3.7.9 before I got advice to create a file "horde_imap.log". I still experience the same behaviour as before: Undefined array key "uidvalidity".
I will record error messages in horde_imap.log as suggested and then post it here.

@Geryishere
Copy link
Author

I have generated the "horde_imap.log". This is the outcome:

Wed, 16 Oct 2024 20:13:10 +0000
Connection to: imap://192.168../
Server connection took 0.0002 seconds.
S: * OK Synametrics IMAP4rev1 server ready 10/16/24 10:13 PM
C: 1 CAPABILITY
S: * CAPABILITY IMAP4rev1 IDLE
S: 1 OK CAPABILITY completed
Command 1 took 0.0003 seconds.
C: 2 LOGIN @Local [PASSWORD]
S: 2 OK LOGIN completed
Command 2 took 0.0003 seconds.
C: 3 CAPABILITY
S: * CAPABILITY IMAP4rev1 IDLE
S: 3 OK CAPABILITY completed
Command 3 took 0.0002 seconds.
C: 4 EXAMINE INBOX
S: * FLAGS (\Seen \Deleted)
S: * 1 EXISTS
S: * OK [UIDNEXT 41] Predicted next UID
S: * 0 RECENT
S: * OK [PERMANENTFLAGS (\Deleted \Seen)]
S: 4 OK [READ-ONLY] SELECT completed
Command 4 took 0.0012 seconds.
C: 5 UID SEARCH ALL
S: * SEARCH 40
S: 5 OK UID completed
Command 5 took 0.0004 seconds.
C: 6 UID FETCH 40 (UID)
S: * 1 FETCH (UID 40)
S: 6 OK UID FETCH completed
Command 6 took 0.0005 seconds.
C: 7 UID FETCH 40 (ENVELOPE FLAGS INTERNALDATE BODY.PEEK[HEADER])
S: * 1 FETCH (UID 40 ENVELOPE ("Wed, 16 Oct 2024 22:10:36 +0200" "Testemail" (("=?utf-8?B?Ry4gSGVnZW5kw7ZyZmVy?=" NIL "" ".com")) (("=?utf-8?B?Ry4gSGVnZW5kw7ZyZmVy?=" NIL "" ".com")) (("=?utf-8?B?Ry4gSGVnZW5kw7ZyZmVy?=" NIL "
" ".com")) ((NIL NIL "**********" ".com")) NIL NIL NIL "<000001db2007$78e97fb0$6abc7f10$@**********@***.com>") FLAGS () INTERNALDATE "16-Oct-2024 22:12:25 +0200" BODY[HEADER] {8231}
S: [LITERAL DATA: 8231 bytes]
S: )
S: 7 OK UID FETCH completed
Command 7 took 0.004 seconds.


Wed, 16 Oct 2024 20:13:10 +0000
Connection to: imap://192.168../
Server connection took 0.0003 seconds.
S: * OK Synametrics IMAP4rev1 server ready 10/16/24 10:13 PM
C: 1 CAPABILITY
S: * CAPABILITY IMAP4rev1 IDLE
S: 1 OK CAPABILITY completed
Command 1 took 0.0003 seconds.
C: 2 LOGIN *****@Local [PASSWORD]
S: 2 OK LOGIN completed
Command 2 took 0.0003 seconds.
C: 3 CAPABILITY
S: * CAPABILITY IMAP4rev1 IDLE
S: 3 OK CAPABILITY completed
Command 3 took 0.0002 seconds.
CACHE: Using the OCA\Mail\Cache\Cache storage driver.
C: 4 STATUS INBOX (MESSAGES RECENT UIDNEXT UIDVALIDITY UNSEEN)
S: * STATUS "INBOX" (MESSAGES 1 RECENT 0 UIDNEXT 41 UIDVALIDITY 10 UNSEEN 1)
S: 4 OK STATUS COMPLETED
Command 4 took 0.0006 seconds.
C: 5 LOGOUT
S: * BYE IMAP4rev1 IDLE Server logging out
S: 5 OK LOGOUT completed
Command 5 took 0.0059 seconds.
C: 8 LOGOUT
S: * BYE IMAP4rev1 IDLE Server logging out
S: 8 OK LOGOUT completed
Command 8 took 0.0032 seconds.

@Geryishere
Copy link
Author

Just to add the current error check in nextcloud.log:

"16 Oct 2024, 22:13:10"
Warning mail
Mailbox UID validity changed. Wiping cache and performing full sync for 162
Error PHP
Undefined array key "uidvalidity" at /var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php#4066

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants