nextcloud / mail

💌 Mail app for Nextcloud
https://apps.nextcloud.com/apps/mail
GNU Affero General Public License v3.0
831 stars 257 forks source link

Imap account with thousands of folders/mails not shown #8028

Open pongraczi opened 1 year ago

pongraczi commented 1 year ago

Steps to reproduce

  1. Set up the imap account, save it, tested the credentials succeed.
  2. Starting mail app just waiting for a very very very very long time (10+ minutes), nothing appears, even folders, nothing.
  3. horde_imap.log shows successfully completed tasks, up to bye bye.

Expected behavior

After setup the account, mail app just start and show some emails, as the same application in the same server with different imap account with a few emails just work.

Actual behavior

  1. horde_imap.log filled with successfully completed tasks, like this:
    Monitoring the horde_imap.log shows commands running as expected:

C: 559 UID FETCH 7605 (BODY.PEEK[2] BODY.PEEK[1] BODY.PEEK[2.MIME] BODY.PEEK[1.MIME]) S: * 555 FETCH (UID 7605 BODY[2] {26319} S: [LITERAL DATA: 26319 bytes] S: BODY[1] {1571} S: [LITERAL DATA: 1571 bytes] S: BODY[2.MIME] {80} S: [LITERAL DATA: 80 bytes] S: BODY[1.MIME] {96} S: [LITERAL DATA: 96 bytes] S: ) S: 559 OK Completed (0.001 sec)

Command 559 took 0.0841 seconds.

C: 1891 STATUS user/xxxx/yyyy/Archives/2020 (MESSAGES RECENT UIDNEXT UIDVALIDITY UNSEEN) S: * STATUS user/xxxx/yyyy/Archives/2020 (MESSAGES 0 RECENT 0 UIDNEXT 1 UIDVALIDITY 1668461269 UNSEEN 0) S: 1891 OK Completed

  1. Task number just goes up to 14000+.
  2. The app has no any output (devtools console, nextcloud.log, horde_imap.log) which could show any error.
  3. The screen usually was like this (except the 42, which only appeared after I changed the imap account from user1 -> user2 with a few emails only, which was working -> change back to user1 -> still seems not working.

Kijelölés_265

  1. based on the imap server log and horde_imap.log (and horde_smtp.log and horde_sieve.log) the credentials are ok, mail app fetched the valid sieve script, connected successfully to the smtps and successfully fetched huge number of emails.

Mail app version

2.2.3

Mailserver or service

Cyrus imap 3.6.0

Operating system

Linux Debian

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database

MariaDB

Additional info

Logs:

Connection starts with this:

>> Wed, 15 Feb 2023 11:40:02 +0000
>> Connection to: imap://imap.target.tld:993/
>> Server connection took 0.3328 seconds.
S: * OK [CAPABILITY IMAP4rev1 LITERAL+ ID ENABLE AUTH=PLAIN SASL-IR] cyrus36 Cyrus IMAP 3.6.0-Debian-3.6.0-1+b1 server ready
C: 1 AUTHENTICATE PLAIN [INITIAL CLIENT RESPONSE (username: user1)]
S: 1 OK [CAPABILITY IMAP4rev1 LITERAL+ ID ENABLE ACL ANNOTATE-EXPERIMENT-1 BINARY CATENATE CHILDREN CONDSTORE CREATE-SPECIAL-USE ESEARCH ESORT LIST-EXTENDED LIST-MYRIGHTS LIST-STATUS MAILBOX-REFERRALS METADATA MOVE MULTIAPPEND NAMESPACE OBJECTID PREVIEW QRESYNC QUOTA RIGHTS=kxten SAVEDATE SEARCH=FUZZY SORT SORT=DISPLAY SPECIAL-USE STATUS=SIZE THREAD=ORDEREDSUBJECT THREAD=REFERENCES UIDPLUS UNSELECT URLAUTH URLAUTH=BINARY WITHIN DIGEST=SHA1 LIST-METADATA NO_ATOMIC_RENAME SCAN SORT=MODSEQ SORT=UID THREAD=REFS X-CREATEDMODSEQ X-REPLICATION X-SIEVE-MAILBOX XLIST XMOVE LOGINDISABLED XCONVERSATIONS COMPRESS=DEFLATE X-QUOTA=STORAGE X-QUOTA=MESSAGE X-QUOTA=X-ANNOTATION-STORAGE X-QUOTA=X-NUM-FOLDERS IDLE APPENDLIMIT=4294967295] Success (tls protection) SESSIONID=<cyrus-1676461203-26396-1-12715663925575521765>
>> Command 1 took 0.0496 seconds.
>> CACHE: Using the OCA\Mail\Cache\Cache storage driver.
C: 2 ENABLE QRESYNC
C: 3 NAMESPACE
S: * ENABLED CONDSTORE QRESYNC
S: 2 OK Completed
>> Command 2 took 0.0418 seconds.
S: * NAMESPACE (("INBOX/" "/")) (("user/" "/")) (("" "/"))
S: 3 OK Completed
>> Command 3 took 0.085 seconds.
C: 4 LIST () "" (*) RETURN (SUBSCRIBED SPECIAL-USE)
S: * LIST (\Subscribed \HasChildren) "/" INBOX
S: * LIST (\Subscribed \HasNoChildren) "/" INBOX/Archive
.....
S: 4 OK Completed (0.570 secs 14312 calls)
>> Command 4 took 0.7383 seconds.

Lot of LIST command, seems every subscribed mailboxes, including shared folders completed, see above.

After that a lot of STATUS command happened, seems all:

C: 5 STATUS INBOX (MESSAGES RECENT UIDNEXT UIDVALIDITY UNSEEN)
S: * STATUS INBOX (MESSAGES 8729 RECENT 0 UIDNEXT 23108 UIDVALIDITY 1606248051 UNSEEN 40)
S: 5 OK Completed
>> Command 5 took 0.0448 seconds.
C: 6 STATUS INBOX/Archive (MESSAGES RECENT UIDNEXT UIDVALIDITY UNSEEN)
S: * STATUS INBOX/Archive (MESSAGES 0 RECENT 0 UIDNEXT 1 UIDVALIDITY 1615624245 UNSEEN 0)
S: 6 OK Completed
>> Command 6 took 0.0421 seconds.
....
Up to the end or page reload, depending my patience.......

And so on.

Breaking news:

Summary

Is it an expected behaviour?

pongraczi commented 1 year ago

Image was missing:

Kijelölés_265