NextCloud Mail Stops Syncing After Initial Emails

Hi NextCloud Community,

I’ve set up my mail account in NextCloud Mail using the following configuration:

Initially, my mailbox syncs correctly, and I can see my emails. However, after the first few emails load, the sync stops, and no new emails are downloaded. I’ve checked my mail server settings, and everything seems to be configured properly.

Has anyone encountered this issue before? Is there a known fix or a recommended way to properly configure NextCloud Mail with iCloud’s mail servers?

Any help would be greatly appreciated!

Thanks in advance!

No idea and since you didn’t fill out the support template we can only speculate.

You may find the Nextcloud Mail Admin Documentation - Troubleshooting section helpful to diagnose what is going on.

Ok thank you….ill fill out thanks

I’m getting the same issue.

The Basics

Summary of the issue you are facing:

After initial setup of icloud on the nextcloud email client new messages will not download. I can see that there are emails unread but cannot view them. Other email accounts (GMX, Gmail) appear uneffected

Steps to replicate it (hint: details matter!):

Setup icloud email (I’m using app passwords) with recommended settings. Wait until new messages start coming in and synchronization breaks, roughly 24 hours in my case.

Log entries

These errors show on repeat:

[mail] Error: Sync failed for 1:INBOX: IMAP error reported by server.
	POST /apps/mail/api/mailboxes/11/sync
	from 165.1.251.174 by aaron at Feb 27, 2025, 10:07:27 AM

[PHP] Error: iconv(): Detected an illegal character in input string at /var/www/nextcloud/apps/mail/lib/IMAP/Charset/Converter.php#43
	from ? by ? at Feb 27, 2025, 10:04:26 AM

[PHP] Error: fread(): SSL: Connection reset by peer at /var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket/Connection/Socket.php#190
	from ? by ? at Feb 27, 2025, 10:02:56 AM

[mail] Error: Cron mail sync failed for account 1
	from ? by ? at Feb 27, 2025, 9:30:11 AM

one of the mail sync entries:

{"reqId":"VduZ6B44SjjcFvKGGFhh","level":3,"time":"2025-02-27T09:30:11-08:00","remoteAddr":"","user":false,"app":"mail","method":"","url":"--","message":"Cron mail sync failed for account 1","userAgent":"--","version":"31.0.0.18","exception":{"Exception":"OCA\\Mail\\Exception\\ServiceException","Message":"Sync failed for 1:INBOX: IMAP error reported by server.","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php","line":133,"function":"sync","class":"OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/mail/lib/BackgroundJob/SyncJob.php","line":93,"function":"syncAccount","class":"OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\Mail\\BackgroundJob\\SyncJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":88,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":75,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":168,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php","Line":282,"Previous":{"Exception":"Horde_Imap_Client_Exception_ServerResponse","Message":"IMAP error reported by server.","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php","line":4319,"function":"_getLine","class":"Horde_Imap_Client_Socket","type":"->"},{"file":"/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php","line":4243,"function":"_sendCmdChunk","class":"Horde_Imap_Client_Socket","type":"->"},{"file":"/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php","line":2478,"function":"_sendCmd","class":"Horde_Imap_Client_Socket","type":"->"},{"file":"/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php","line":2282,"function":"_search","class":"Horde_Imap_Client_Socket","type":"->"},{"file":"/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php","line":3542,"function":"search","class":"Horde_Imap_Client_Base","type":"->"},{"file":"/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Data/Sync.php","line":229,"function":"resolveIds","class":"Horde_Imap_Client_Base","type":"->"},{"file":"/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php","line":3643,"function":"__construct","class":"Horde_Imap_Client_Data_Sync","type":"->"},{"file":"/var/www/nextcloud/apps/mail/lib/IMAP/Sync/Synchronizer.php","line":99,"function":"sync","class":"Horde_Imap_Client_Base","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/mail/lib/IMAP/Sync/Synchronizer.php","line":69,"function":"doCombinedSync","class":"OCA\\Mail\\IMAP\\Sync\\Synchronizer","type":"->"},{"file":"/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php","line":401,"function":"sync","class":"OCA\\Mail\\IMAP\\Sync\\Synchronizer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php","line":263,"function":"runPartialSync","class":"OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer","type":"->"},{"file":"/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php","line":133,"function":"sync","class":"OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/mail/lib/BackgroundJob/SyncJob.php","line":93,"function":"syncAccount","class":"OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\Mail\\BackgroundJob\\SyncJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":88,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":75,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":168,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php","Line":4620},"message":"Cron mail sync failed for account {accountId}","exception":[],"CustomMessage":"Cron mail sync failed for account 1"},"id":"67c0ab628a9d1"}

and the mail sync cron entry

{"reqId":"hnGTEtI5ZEHodObqR9M5","level":3,"time":"2025-02-27T08:25:12-08:00","remoteAddr":"","user":false,"app":"mail","method":"","url":"--","message":"Cron mail sync failed for account 1","userAgent":"--","version":"31.0.0.18","exception":{"Exception":"OCA\\Mail\\Exception\\ServiceException","Message":"Sync failed for 1:INBOX: IMAP error reported by server.","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php","line":133,"function":"sync","class":"OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/mail/lib/BackgroundJob/SyncJob.php","line":93,"function":"syncAccount","class":"OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\Mail\\BackgroundJob\\SyncJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":88,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":75,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":168,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php","Line":282,"Previous":{"Exception":"Horde_Imap_Client_Exception_ServerResponse","Message":"IMAP error reported by server.","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php","line":4319,"function":"_getLine","class":"Horde_Imap_Client_Socket","type":"->"},{"file":"/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php","line":4243,"function":"_sendCmdChunk","class":"Horde_Imap_Client_Socket","type":"->"},{"file":"/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php","line":2478,"function":"_sendCmd","class":"Horde_Imap_Client_Socket","type":"->"},{"file":"/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php","line":2282,"function":"_search","class":"Horde_Imap_Client_Socket","type":"->"},{"file":"/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php","line":3542,"function":"search","class":"Horde_Imap_Client_Base","type":"->"},{"file":"/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Data/Sync.php","line":229,"function":"resolveIds","class":"Horde_Imap_Client_Base","type":"->"},{"file":"/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php","line":3643,"function":"__construct","class":"Horde_Imap_Client_Data_Sync","type":"->"},{"file":"/var/www/nextcloud/apps/mail/lib/IMAP/Sync/Synchronizer.php","line":99,"function":"sync","class":"Horde_Imap_Client_Base","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/mail/lib/IMAP/Sync/Synchronizer.php","line":69,"function":"doCombinedSync","class":"OCA\\Mail\\IMAP\\Sync\\Synchronizer","type":"->"},{"file":"/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php","line":401,"function":"sync","class":"OCA\\Mail\\IMAP\\Sync\\Synchronizer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php","line":263,"function":"runPartialSync","class":"OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer","type":"->"},{"file":"/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php","line":133,"function":"sync","class":"OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/mail/lib/BackgroundJob/SyncJob.php","line":93,"function":"syncAccount","class":"OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\Mail\\BackgroundJob\\SyncJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":88,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":75,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":168,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php","Line":4620},"message":"Cron mail sync failed for account {accountId}","exception":[],"CustomMessage":"Cron mail sync failed for account 1"},"id":"67c0ab628abc9"}

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

I genuinely don’t know where or how to find this.

Apps

The output of occ app:list (if possible).

occ command doesn’t work on my install, but I’ve installed only office and mail apps.

Ehcorn, thank you for responding, unfortunately for me I don’t have all the skills most of the people here have. I purchased an Asustor NAS and NextCloud was one of the apps that came with. My goal was to set up an identical iCloud system that I use on my Mac platform from my iPhone iPad, Mac’s. I was looking for a turnkey system so that I could help some of my clients were in the medical community set up their own internal iCloud system to protect the patient information. But there doesn’t seem to be too many options like iCloud, Or similar to Nextcloud. If anyone on this board knows of any software that can run on a Asustor NAS or any other NAS Please let me know that’s turn key. For the issue with the emails if you know of a step-by-step process on how to fill out the Nextcloud prompts so that the email works please let me know. Thank u

Hi all,

I have the same problem. I tried many things to solve it, but no success. All other mailboxes are working fine, only iCloud is behaving in the same way like described. The initial access is fine, after the first sync the next sync will fail with “ServiceException
Sync failed for 10:INBOX: IMAP error reported by server.”.

The Basics

  • Nextcloud Server version (31.0.0):
  • Operating system and version (Debian 12):
  • Web server and version (Apache/2.4.63):
  • Reverse proxy and version (Caddy 2.9.1):
  • PHP version ( 8.3.17):
  • Is this the first time you’ve seen this error? (No):
  • When did this problem seem to first start?
    Right after setting up an iCloud mail account in Mail.
  • Installation method (AIO)
  • Are you using Cloudflare, mod_security, or similar? (Yes, tailscale is in use)

Summary of the issue you are facing:

as described, IMAP sync failes for iCloud after initial sync.

Steps to replicate it (hint: details matter!):

Log entries

root@nextcloud:~# docker exec --user www-data nextcloud-aio-nextcloud php occ mail:account:sync -vvv 10
[debug] account is up to date, skipping mailbox sync
[debug] Skipping mailbox sync for 107
[debug] Skipping mailbox sync for 104
[debug] Skipping mailbox sync for 105
[debug] Skipping mailbox sync for 103
[debug] Syncing 101
[debug] Locking mailbox 101 for new messages sync
[debug] Locking mailbox 101 for changed messages sync
[debug] Locking mailbox 101 for vanished messages sync
[debug] Running partial sync for 101
[debug] partial sync 10:Sent Items - get all known UIDs took 0s. 60/60MB memory used
[debug] Unlocking mailbox 101 from vanished messages sync
[debug] Unlocking mailbox 101 from changed messages sync
[debug] Unlocking mailbox 101 from new messages sync

In ImapToDbSynchronizer.php line 282:
                                                                 
  [OCA\Mail\Exception\ServiceException]                          
  Sync failed for 10:Sent Items: IMAP error reported by server.  
                                                                 

Exception trace:
  at /var/www/html/custom_apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php:282
 OCA\Mail\Service\Sync\ImapToDbSynchronizer->sync() at /var/www/html/custom_apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php:133
 OCA\Mail\Service\Sync\ImapToDbSynchronizer->syncAccount() at /var/www/html/custom_apps/mail/lib/Command/SyncAccount.php:88
 OCA\Mail\Command\SyncAccount->sync() at /var/www/html/custom_apps/mail/lib/Command/SyncAccount.php:72
 OCA\Mail\Command\SyncAccount->execute() at /var/www/html/3rdparty/symfony/console/Command/Command.php:326
 Symfony\Component\Console\Command\Command->run() at /var/www/html/3rdparty/symfony/console/Application.php:1078
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/3rdparty/symfony/console/Application.php:324
 Symfony\Component\Console\Application->doRun() at /var/www/html/3rdparty/symfony/console/Application.php:175
 Symfony\Component\Console\Application->run() at /var/www/html/lib/private/Console/Application.php:187
 OC\Console\Application->run() at /var/www/html/console.php:87
 require_once() at /var/www/html/occ:11

In Socket.php line 4620:
                                                
  [Horde_Imap_Client_Exception_ServerResponse]  
  IMAP error reported by server.                
                                                

Exception trace:
  at /var/www/html/custom_apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php:4620
 Horde_Imap_Client_Socket->_getLine() at /var/www/html/custom_apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php:4319
 Horde_Imap_Client_Socket->_sendCmdChunk() at /var/www/html/custom_apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php:4243
 Horde_Imap_Client_Socket->_sendCmd() at /var/www/html/custom_apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php:2478
 Horde_Imap_Client_Socket->_search() at /var/www/html/custom_apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php:2282
 Horde_Imap_Client_Base->search() at /var/www/html/custom_apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php:3542
 Horde_Imap_Client_Base->resolveIds() at /var/www/html/custom_apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Data/Sync.php:229
 Horde_Imap_Client_Data_Sync->__construct() at /var/www/html/custom_apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php:3643
 Horde_Imap_Client_Base->sync() at /var/www/html/custom_apps/mail/lib/IMAP/Sync/Synchronizer.php:99
 OCA\Mail\IMAP\Sync\Synchronizer->doCombinedSync() at /var/www/html/custom_apps/mail/lib/IMAP/Sync/Synchronizer.php:69
 OCA\Mail\IMAP\Sync\Synchronizer->sync() at /var/www/html/custom_apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php:401
 OCA\Mail\Service\Sync\ImapToDbSynchronizer->runPartialSync() at /var/www/html/custom_apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php:263
 OCA\Mail\Service\Sync\ImapToDbSynchronizer->sync() at /var/www/html/custom_apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php:133
 OCA\Mail\Service\Sync\ImapToDbSynchronizer->syncAccount() at /var/www/html/custom_apps/mail/lib/Command/SyncAccount.php:88
 OCA\Mail\Command\SyncAccount->sync() at /var/www/html/custom_apps/mail/lib/Command/SyncAccount.php:72
 OCA\Mail\Command\SyncAccount->execute() at /var/www/html/3rdparty/symfony/console/Command/Command.php:326
 Symfony\Component\Console\Command\Command->run() at /var/www/html/3rdparty/symfony/console/Application.php:1078
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/3rdparty/symfony/console/Application.php:324
 Symfony\Component\Console\Application->doRun() at /var/www/html/3rdparty/symfony/console/Application.php:175
 Symfony\Component\Console\Application->run() at /var/www/html/lib/private/Console/Application.php:187
 OC\Console\Application->run() at /var/www/html/console.php:87
 require_once() at /var/www/html/occ:11

mail:account:sync [-f|--force] [--] <account-id>

Configuration

Nextcloud

root@nextcloud:~# docker exec --user www-data nextcloud-aio-nextcloud php occ config:list system       
{
    "system": {
        "one-click-instance": true,
        "one-click-instance.user-limit": 100,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "check_data_directory_permissions": false,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "overwritehost": "***REDACTED***",
        "overwriteprotocol": "https",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "nextcloud.tail9c20fd.ts.net"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "31.0.0.18",
        "overwrite.cli.url": "https:\/\/nextcloud.tail9c20fd.ts.net\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "updatedirectory": "\/nc-updater",
        "loglevel": 2,
        "app_install_overwrite": [
            "nextcloud-aio",
            "drawio",
            "maps",
            "camerarawpreviews",
            "integration_homeassistant",
            "unsplash",
            "otpmanager",
            "dicomviewer",
            "money"
        ],
        "log_type": "file",
        "logfile": "\/var\/www\/html\/data\/nextcloud.log",
        "log_rotate_size": 10485760,
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "preview_max_x": 2048,
        "preview_max_y": 2048,
        "jpeg_quality": 60,
        "enabledPreviewProviders": {
            "0": "OC\\Preview\\Imaginary",
            "1": "OC\\Preview\\MarkDown",
            "2": "OC\\Preview\\MP3",
            "3": "OC\\Preview\\TXT",
            "4": "OC\\Preview\\OpenDocument",
            "5": "OC\\Preview\\Movie",
            "6": "OC\\Preview\\Krita",
            "7": "OC\\Preview\\ImaginaryPDF",
            "8": "OC\\Preview\\HEIC",
            "9": "OC\\Preview\\TIFF",
            "10": "OC\\Preview\\ImaginaryPDF",
            "11": "OC\\Preview\\Image",
            "23": "OC\\Preview\\ImaginaryPDF"
        },
        "enable_previews": true,
        "upgrade.disable-web": true,
        "mail_smtpmode": "smtp",
        "trashbin_retention_obligation": "auto, 30",
        "versions_retention_obligation": "auto, 30",
        "activity_expire_days": 30,
        "simpleSignUpLink.shown": false,
        "share_folder": "\/Shared",
        "one-click-instance.link": "https:\/\/nextcloud.com\/all-in-one\/",
        "upgrade.cli-upgrade-link": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/2726",
        "maintenance_window_start": 100,
        "allow_local_remote_servers": true,
        "davstorage.request_timeout": 3600,
        "documentation_url.server_logs": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/5425",
        "htaccess.RewriteBase": "\/",
        "dbpersistent": false,
        "auth.bruteforce.protection.enabled": true,
        "ratelimit.protection.enabled": true,
        "files_external_allow_create_new_local": false,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_key": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": true,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "memories.db.triggers.fcu": true,
        "memories.exiftool": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/exiftool-amd64-musl",
        "memories.vod.path": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "default_phone_region": "DE",
        "mail_smtpsecure": "ssl",
        "DOMAIN": "nextcloud.tail9c20fd.ts.net"
    }
}

Apps

root@nextcloud:~# docker exec --user www-data nextcloud-aio-nextcloud php occ app:list          
Enabled:
  - activity: 4.0.0
  - admin_audit: 1.21.0
  - app_api: 5.0.2
  - bookmarks: 15.1.0
  - bruteforcesettings: 4.0.0
  - calendar: 5.2.0
  - camerarawpreviews: 0.8.6
  - checksum: 1.2.6
  - circles: 31.0.0-dev.0
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - contacts: 7.0.4
  - contactsinteraction: 1.12.0
  - cookbook: 0.11.3
  - dashboard: 7.11.0
  - dav: 1.33.0
  - deck: 1.15.0
  - dicomviewer: 2.3.0
  - emlviewer: 1.0.11
  - epubviewer: 1.7.3
  - event_update_notification: 2.6.1
  - federatedfilesharing: 1.21.0
  - federation: 1.21.0
  - files: 2.3.1
  - files_downloadlimit: 4.0.0
  - files_emailviewer: 0.1.4
  - files_external: 1.23.0
  - files_fulltextsearch: 31.0.0
  - files_fulltextsearch_tesseract: 27.0.1
  - files_mindmap: 0.0.33
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - files_zip: 2.1.0
  - firstrunwizard: 4.0.0
  - fulltextsearch: 31.0.0
  - fulltextsearch_elasticsearch: 31.0.0
  - groupfolders: 19.0.4
  - imageconverter: 2.0.5
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - mail: 4.3.1
  - maps: 1.5.0
  - memories: 7.5.2
  - music: 2.1.2
  - nextcloud-aio: 0.7.0
  - nextcloud_announcements: 3.0.0
  - notes: 4.11.0
  - notifications: 4.0.0
  - notify_push: 1.0.0
  - oauth2: 1.19.1
  - oidc: 1.5.0
  - otpmanager: 0.5.4
  - password_policy: 3.0.0
  - passwords: 2025.2.20
  - photos: 4.0.0-dev.1
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - qownnotesapi: 25.2.0
  - recognize: 9.0.0
  - recommendations: 4.0.0
  - related_resources: 2.0.0
  - richdocuments: 8.6.3
  - secrets: 2.1.2
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - spreed: 21.0.1
  - support: 3.0.0
  - survey_client: 3.0.0
  - systemtags: 1.21.1
  - tables: 0.9.0
  - tasks: 0.16.1
  - text: 5.0.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - twofactor_totp: 13.0.0-dev.0
  - user_status: 1.11.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - whiteboard: 1.0.5
  - workflowengine: 2.13.0
Disabled:
  - assistant: 2.4.0 (installed 2.4.0)
  - audioplayer: 3.4.1 (installed 3.4.1)
  - context_chat: 4.1.0 (installed 4.1.0)
  - encryption: 2.19.0
  - files_antivirus: 6.0.0 (installed 6.0.0)
  - integration_homeassistant: 0.0.5 (installed 0.0.5)
  - integration_openai: 3.5.0 (installed 3.5.0)
  - integration_paperless: 1.0.6 (installed 1.0.6)
  - money: 0.29.1 (installed 0.29.1)
  - phonetrack: 0.8.2 (installed 0.8.2)
  - suspicious_login: 9.0.1
  - twofactor_nextcloud_notification: 5.0.0
  - unsplash: 3.0.3 (installed 3.0.3)
  - user_ldap: 1.22.0
1 Like

I have the exact same issue as the two others. One addition:

docker exec --user www-data nextcloud-aio-nextcloud php occ mail:account:sync -f

seems to help once. Whatever the mail:account:sync -f command does, works, but from the UI it clearly does something else.

1 Like

Well thank you for responding I thought I was the only one having this problem…… now the question I have is why isn’t all of this nextcloud stuff turn key to make it easy for everybody to use it even if we had to pay some money to get a version that worked this would be a game changer. Can anybody answer this question if anybody from Nextcloud is out there, please tell us why is not turnkey.

I’m having the exact same issue with my icloud account. A manual sync with the force flag does indeed work.

Purely for the sake of playing around, I commented out the bit of code which throws the exception in www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php on line 4622

            if ($server instanceof Horde_Imap_Client_Interaction_Server_Tagged) {
                /* Check for a on_error callback. If function returns true,
                 * ignore the error. */
                if (($cmd = $pipeline->getCmd($server->tag)) &&
                    is_callable($cmd->on_error) &&
                    call_user_func($cmd->on_error)) {
                    break;
                }

                #throw new Horde_Imap_Client_Exception_ServerResponse(
                #    Horde_Imap_Client_Translation::r("IMAP error reported by server. $server"),
                #    0,
                #    $server,
                #    $pipeline
                #);
            }

I’m sure this will probably cause other problems, but for now the sync via the web UI seems to be working normally now!

For people not running it in docker, maybe this an option for you (it helps me currently):

sudo -u www-data php /var/www/html/nextcloud/occ mail:account:sync -f <account_Id>

And set this up in a crontab. account_id is the ID of the mailbox.

I currently run it every 5 minutes using crontab:

*/5 * * * * sudo -u www-data php /var/www/html/nextcloud/occ mail:account:sync -f 5 >> /var/log/nextcloud_mail_sync.log 2>&1