Horde_Imap_Client_Exception

Hi Iā€™m facing problems, and I canā€™t find a solution. first the refresh of mails take sometimes a long time to be done.
install on openmediavault, with swag on docker
Second, I have these logs :
ā€˜ā€™'Horde_Imap_Client_Exception Error when communicating with the mail server.

  1. /config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.phpLigne 4560
Horde_Imap_Client_Socket_Connection_Socket->read
()
  1. /config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.phpLigne 623
Horde_Imap_Client_Socket->_getLine
()
  1. /config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.phpLigne 375
Horde_Imap_Client_Socket->_connect
()
  1. /config/www/nextcloud/apps/mail/lib/IMAP/ImapClientRateLimitingDecorator.phpLigne 73
Horde_Imap_Client_Socket->_login
(
  "*** sensitive parameters replaced ***"
)
  1. /config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.phpLigne 853
OCA\Mail\IMAP\ImapClientRateLimitingDecorator->_login
(
  "*** sensitive parameters replaced ***"
)
  1. /config/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.phpLigne 222
Horde_Imap_Client_Base->login
(
  "*** sensitive parameters replaced ***"
)
  1. /config/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.phpLigne 137
OCA\Mail\Service\Sync\ImapToDbSynchronizer->sync
(
  "*** sensitive parameters replaced ***"
)
  1. /config/www/nextcloud/apps/mail/lib/BackgroundJob/SyncJob.phpLigne 111
OCA\Mail\Service\Sync\ImapToDbSynchronizer->syncAccount
(
  "*** sensitive parameters replaced ***"
)
  1. /app/www/public/lib/public/BackgroundJob/Job.phpLigne 81
OCA\Mail\BackgroundJob\SyncJob->run
()
  1. /app/www/public/lib/public/BackgroundJob/TimedJob.phpLigne 102
OCP\BackgroundJob\Job->start
()
  1. /app/www/public/lib/public/BackgroundJob/TimedJob.phpLigne 92
OCP\BackgroundJob\TimedJob->start
()
  1. /app/www/public/cron.phpLigne 152
OCP\BackgroundJob\TimedJob->execute
()

ā€˜ā€™ā€™

{
 "reqId": "IokJX6PEJXQudgtnFAtE",
 "level": 3,
 "time": "2024-03-27T09:20:39+00:00",
 "remoteAddr": "",
 "user": "--",
 "app": "mail",
 "method": "",
 "url": "--",
 "message": "Cron mail sync failed for account 2",
 "userAgent": "--",
 "version": "28.0.3.2",
 "exception": {
   "Exception": "Horde_Imap_Client_Exception",
   "Message": "Error when communicating with the mail server.",
   "Code": 28,
   "Trace": [
     {
       "file": "/config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php",
       "line": 4560,
       "function": "read",
       "class": "Horde_Imap_Client_Socket_Connection_Socket",
       "type": "->"
     },
     {
       "file": "/config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php",
       "line": 623,
       "function": "_getLine",
       "class": "Horde_Imap_Client_Socket",
       "type": "->"
     },
     {
       "file": "/config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php",
       "line": 375,
       "function": "_connect",
       "class": "Horde_Imap_Client_Socket",
       "type": "->"
     },
     {
       "file": "/config/www/nextcloud/apps/mail/lib/IMAP/ImapClientRateLimitingDecorator.php",
       "line": 73,
       "function": "_login",
       "class": "Horde_Imap_Client_Socket",
       "type": "->",
       "args": [
         "*** sensitive parameters replaced ***"
       ]
     },
     {
       "file": "/config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php",
       "line": 853,
       "function": "_login",
       "class": "OCA\\Mail\\IMAP\\ImapClientRateLimitingDecorator",
       "type": "->",
       "args": [
         "*** sensitive parameters replaced ***"
       ]
     },
     {
       "file": "/config/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
       "line": 222,
       "function": "login",
       "class": "Horde_Imap_Client_Base",
       "type": "->",
       "args": [
         "*** sensitive parameters replaced ***"
       ]
     },
     {
       "file": "/config/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
       "line": 137,
       "function": "sync",
       "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
       "type": "->",
       "args": [
         "*** sensitive parameters replaced ***"
       ]
     },
     {
       "file": "/config/www/nextcloud/apps/mail/lib/BackgroundJob/SyncJob.php",
       "line": 111,
       "function": "syncAccount",
       "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
       "type": "->",
       "args": [
         "*** sensitive parameters replaced ***"
       ]
     },
     {
       "file": "/app/www/public/lib/public/BackgroundJob/Job.php",
       "line": 81,
       "function": "run",
       "class": "OCA\\Mail\\BackgroundJob\\SyncJob",
       "type": "->"
     },
     {
       "file": "/app/www/public/lib/public/BackgroundJob/TimedJob.php",
       "line": 102,
       "function": "start",
       "class": "OCP\\BackgroundJob\\Job",
       "type": "->"
     },
     {
       "file": "/app/www/public/lib/public/BackgroundJob/TimedJob.php",
       "line": 92,
       "function": "start",
       "class": "OCP\\BackgroundJob\\TimedJob",
       "type": "->"
     },
     {
       "file": "/app/www/public/cron.php",
       "line": 152,
       "function": "execute",
       "class": "OCP\\BackgroundJob\\TimedJob",
       "type": "->"
     }
   ],
   "File": "/config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket/Connection/Socket.php",
   "Line": 241,
   "message": "Cron mail sync failed for account {accountId}",
   "exception": {
     "details": null,
     "logged": false,
     "raw_msg": "Error when communicating with the mail server."
   },
   "CustomMessage": "Cron mail sync failed for account 2"
 },
 "id": "6603e4f0c36b8"
}

here what Iā€™ve done in my config.php :
ā€˜ā€™ā€™
ā€˜allow_local_remote_serversā€™ => true,
ā€˜app.mail.imap.timeoutā€™ => 25,
ā€˜app.mail.smtp.timeoutā€™ => 5,
ā€˜ā€™ā€™

Iā€™ve searched for a solution but canā€™ty find itā€¦ Sorry for my english level.

looks rather complicatedā€¦ i think it would help if you would try to explain your goal in detail.

awwwā€¦ and itā€™s always important to get some more informations out about your installation itself as well as your server environment - the underlaying template isnā€™t there for just torturing our users but it would hopefully convey some needed informations to the ppl who want to help.

hi thx for reply.
iā€™m not sure i understandā€¦ the environement is : ā€œinstall on openmediavault, with swag on dockerā€ swag and nextcloud are install on docker. What can I tell more ?
I donā€™t understand the ā€œunderlaying templateā€ and the ā€œpplā€ā€¦
I gave all the logs, and I think itā€™is precise.
My goal is to not have errors, and have nextcloud mail ruuning without lags.
What do you want to know more ?
Sorry for my english level

OK sorry I wasā€™t precise enough.

I wanted to know what you want to achieve here? Whatā€™s your point?
Plus: which versions do you run? Nextcloud? PhP? Swag? OMV?
BTW: What is ā€œswagā€ exactly?

I donā€™t think itā€™s a nextcloud problem but more a problem of your setup.

ok thanks. I understand now, my bad.
Debian 12
Openmediavault 7.0.4
Nextcloud 28.0.4
php 8.1 or 8.2 (not sure how i verify this)
Swag is a reverse proxy, I use nginx too

I think so but donā€™t understand what it is.

I have this log appears yesterday :

RelatedResourceProviderNotFound Exception thrown: OCA\RelatedResources\Exceptions\RelatedResourceProviderNotFound
{
  "reqId": "IhsWTUxjizTINNNG3mVl",
  "level": 3,
  "time": "2024-04-01T17:06:25+00:00",
  "remoteAddr": "192.168.x.xx",
  "user": "Marjorie",
  "app": "related_resources",
  "method": "GET",
  "url": "/ocs/v2.php/apps/related_resources/related/account?itemId=xxxxx&resourceType=deck&limit=5&format=json",
  "message": "Exception thrown: OCA\\RelatedResources\\Exceptions\\RelatedResourceProviderNotFound",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0",
  "version": "28.0.3.2",
  "exception": {
    "Exception": "OCA\\RelatedResources\\Exceptions\\RelatedResourceProviderNotFound",
    "Message": "",
    "Code": 0,
    "Trace": [
      {
        "file": "/config/www/nextcloud/apps/related_resources/lib/Service/RelatedService.php",
        "line": 173,
        "function": "getRelatedResourceProvider",
        "class": "OCA\\RelatedResources\\Service\\RelatedService",
        "type": "->"
      },
      {
        "file": "/config/www/nextcloud/apps/related_resources/lib/Service/RelatedService.php",
        "line": 127,
        "function": "retrieveRelatedToItem",
        "class": "OCA\\RelatedResources\\Service\\RelatedService",
        "type": "->"
      },
      {
        "file": "/config/www/nextcloud/apps/related_resources/lib/Controller/ApiController.php",
        "line": 107,
        "function": "getRelatedToItem",
        "class": "OCA\\RelatedResources\\Service\\RelatedService",
        "type": "->"
      },
      {
        "file": "/app/www/public/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 230,
        "function": "getRelatedResources",
        "class": "OCA\\RelatedResources\\Controller\\ApiController",
        "type": "->"
      },
      {
        "file": "/app/www/public/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 137,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/app/www/public/lib/private/AppFramework/App.php",
        "line": 184,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/app/www/public/lib/private/Route/Router.php",
        "line": 315,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/app/www/public/ocs/v1.php",
        "line": 65,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/app/www/public/ocs/v2.php",
        "line": 23,
        "args": [
          "/app/www/public/ocs/v1.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/config/www/nextcloud/apps/related_resources/lib/Service/RelatedService.php",
    "Line": 605,
    "message": "",
    "exception": [],
    "CustomMessage": "Exception thrown: OCA\\RelatedResources\\Exceptions\\RelatedResourceProviderNotFound"
  },
  "id": "660be1f8d5530"
}

maybe it helps

try disabling it first and then see if the error has gone. plus: if your mail got faster

what do you want me to disable ?

try disabling app related resources from your admin menu

Ok I do this and tell you. Thx

I have this error appears :

[mail] Erreur: Could not fetch stats of mailbox 77. IMAP error: Error when communicating with the mail server.
	POST /apps/mail/api/mailboxes/77/sync
	de 192.168.x.xx par xxxx Ć  5 avr. 2024, 10:59:53
    /config/www/nextcloud/apps/mail/lib/Controller/MailboxesController.phpLigne 155

    OCA\Mail\Service\Sync\SyncService->syncMailbox(
      "*** sensitive parameters replaced ***"
    )

    /app/www/public/lib/private/AppFramework/Http/Dispatcher.phpLigne 230

    OCA\Mail\Controller\MailboxesController->sync(
      "*** sensitive parameters replaced ***"
    )

    /app/www/public/lib/private/AppFramework/Http/Dispatcher.phpLigne 137

    OC\AppFramework\Http\Dispatcher->executeController()

    /app/www/public/lib/private/AppFramework/App.phpLigne 184

    OC\AppFramework\Http\Dispatcher->dispatch()

    /app/www/public/lib/private/Route/Router.phpLigne 315

    OC\AppFramework\App::main()

    /app/www/public/lib/base.phpLigne 1069

    OC\Route\Router->match()

    /app/www/public/index.phpLigne 39

    OC::handleRequest()

CausƩ par Horde_Imap_Client_Exception Error when communicating with the mail server.
{
  "reqId": "qxfq2iTfGEoVDpyHf0wh",
  "level": 3,
  "time": "2024-04-05T08:59:53+00:00",
  "remoteAddr": "192.168.x.xx",
  "user": "xxxxxx",
  "app": "mail",
  "method": "POST",
  "url": "/apps/mail/api/mailboxes/77/sync",
  "message": "Could not fetch stats of mailbox 77. IMAP error: Error when communicating with the mail server.",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0",
  "version": "28.0.3.2",
  "exception": {
    "Exception": "OCA\\Mail\\Exception\\ServiceException",
    "Message": "Could not fetch stats of mailbox 77. IMAP error: Error when communicating with the mail server.",
    "Code": 28,
    "Trace": [
      {
        "file": "/config/www/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",
        "line": 132,
        "function": "syncStats",
        "class": "OCA\\Mail\\IMAP\\MailboxSync",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/config/www/nextcloud/apps/mail/lib/Controller/MailboxesController.php",
        "line": 155,
        "function": "syncMailbox",
        "class": "OCA\\Mail\\Service\\Sync\\SyncService",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/app/www/public/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 230,
        "function": "sync",
        "class": "OCA\\Mail\\Controller\\MailboxesController",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/app/www/public/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 137,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/app/www/public/lib/private/AppFramework/App.php",
        "line": 184,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/app/www/public/lib/private/Route/Router.php",
        "line": 315,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/app/www/public/lib/base.php",
        "line": 1069,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/app/www/public/index.php",
        "line": 39,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/config/www/nextcloud/apps/mail/lib/IMAP/MailboxSync.php",
    "Line": 169,
    "Previous": {
      "Exception": "Horde_Imap_Client_Exception",
      "Message": "Error when communicating with the mail server.",
      "Code": 28,
      "Trace": [
        {
          "file": "/config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php",
          "line": 4560,
          "function": "read",
          "class": "Horde_Imap_Client_Socket_Connection_Socket",
          "type": "->"
        },
        {
          "file": "/config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php",
          "line": 623,
          "function": "_getLine",
          "class": "Horde_Imap_Client_Socket",
          "type": "->"
        },
        {
          "file": "/config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php",
          "line": 375,
          "function": "_connect",
          "class": "Horde_Imap_Client_Socket",
          "type": "->"
        },
        {
          "file": "/config/www/nextcloud/apps/mail/lib/IMAP/ImapClientRateLimitingDecorator.php",
          "line": 73,
          "function": "_login",
          "class": "Horde_Imap_Client_Socket",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php",
          "line": 853,
          "function": "_login",
          "class": "OCA\\Mail\\IMAP\\ImapClientRateLimitingDecorator",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php",
          "line": 1613,
          "function": "login",
          "class": "Horde_Imap_Client_Base",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/config/www/nextcloud/apps/mail/lib/IMAP/FolderMapper.php",
          "line": 141,
          "function": "status",
          "class": "Horde_Imap_Client_Base",
          "type": "->"
        },
        {
          "file": "/config/www/nextcloud/apps/mail/lib/IMAP/MailboxSync.php",
          "line": 166,
          "function": "getFoldersStatusAsObject",
          "class": "OCA\\Mail\\IMAP\\FolderMapper",
          "type": "->"
        },
        {
          "file": "/config/www/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",
          "line": 132,
          "function": "syncStats",
          "class": "OCA\\Mail\\IMAP\\MailboxSync",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/config/www/nextcloud/apps/mail/lib/Controller/MailboxesController.php",
          "line": 155,
          "function": "syncMailbox",
          "class": "OCA\\Mail\\Service\\Sync\\SyncService",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/app/www/public/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 230,
          "function": "sync",
          "class": "OCA\\Mail\\Controller\\MailboxesController",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/app/www/public/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 137,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/app/www/public/lib/private/AppFramework/App.php",
          "line": 184,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/app/www/public/lib/private/Route/Router.php",
          "line": 315,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::"
        },
        {
          "file": "/app/www/public/lib/base.php",
          "line": 1069,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->"
        },
        {
          "file": "/app/www/public/index.php",
          "line": 39,
          "function": "handleRequest",
          "class": "OC",
          "type": "::"
        }
      ],
      "File": "/config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket/Connection/Socket.php",
      "Line": 241
    },
    "message": "Could not fetch stats of mailbox 77. IMAP error: Error when communicating with the mail server.",
    "exception": [],
    "CustomMessage": "Could not fetch stats of mailbox 77. IMAP error: Error when communicating with the mail server."
  },
  "id": "660fbd8eb09b4"
}

And this one :

 TypeError OCA\Mail\Controller\PreferencesController::__construct(): Argument #3 ($UserId) must be of type string, null given

    OCA\Mail\Controller\PreferencesController->__construct()
/app/www/public/lib/private/AppFramework/Utility/SimpleContainer.phpLigne 83

ReflectionClass->newInstanceArgs()

/app/www/public/lib/private/AppFramework/Utility/SimpleContainer.phpLigne 128

OC\AppFramework\Utility\SimpleContainer->buildClass()

/app/www/public/lib/private/AppFramework/Utility/SimpleContainer.phpLigne 146

OC\AppFramework\Utility\SimpleContainer->resolve()

/app/www/public/lib/private/AppFramework/DependencyInjection/DIContainer.phpLigne 468

OC\AppFramework\Utility\SimpleContainer->query()

/app/www/public/lib/private/AppFramework/DependencyInjection/DIContainer.phpLigne 440

OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()

/app/www/public/lib/private/AppFramework/App.phpLigne 163

OC\AppFramework\DependencyInjection\DIContainer->query()

/app/www/public/lib/private/Route/Router.phpLigne 315

OC\AppFramework\App::main()

/app/www/public/lib/base.phpLigne 1069

OC\Route\Router->match()

/app/www/public/index.phpLigne 39

OC::handleRequest()
{
  "reqId": "xxxxxxxxxxxxxx",
  "level": 3,
  "time": "2024-04-05T09:08:29+00:00",
  "remoteAddr": "192.168.x.xx",
  "user": "--",
  "app": "index",
  "method": "PUT",
  "url": "/apps/mail/api/preferences/start-mailbox-id",
  "message": "OCA\\Mail\\Controller\\PreferencesController::__construct(): Argument #3 ($UserId) must be of type string, null given",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0",
  "version": "28.0.3.2",
  "exception": {
    "Exception": "TypeError",
    "Message": "OCA\\Mail\\Controller\\PreferencesController::__construct(): Argument #3 ($UserId) must be of type string, null given",
    "Code": 0,
    "Trace": [
      {
        "function": "__construct",
        "class": "OCA\\Mail\\Controller\\PreferencesController",
        "type": "->"
      },
      {
        "file": "/app/www/public/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 83,
        "function": "newInstanceArgs",
        "class": "ReflectionClass",
        "type": "->"
      },
      {
        "file": "/app/www/public/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 128,
        "function": "buildClass",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/app/www/public/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 146,
        "function": "resolve",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/app/www/public/lib/private/AppFramework/DependencyInjection/DIContainer.php",
        "line": 468,
        "function": "query",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/app/www/public/lib/private/AppFramework/DependencyInjection/DIContainer.php",
        "line": 440,
        "function": "queryNoFallback",
        "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
        "type": "->"
      },
      {
        "file": "/app/www/public/lib/private/AppFramework/App.php",
        "line": 163,
        "function": "query",
        "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
        "type": "->"
      },
      {
        "file": "/app/www/public/lib/private/Route/Router.php",
        "line": 315,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/app/www/public/lib/base.php",
        "line": 1069,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/app/www/public/index.php",
        "line": 39,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/config/www/nextcloud/apps/mail/lib/Controller/PreferencesController.php",
    "Line": 45,
    "message": "OCA\\Mail\\Controller\\PreferencesController::__construct(): Argument #3 ($UserId) must be of type string, null given",
    "exception": [],
    "CustomMessage": "OCA\\Mail\\Controller\\PreferencesController::__construct(): Argument #3 ($UserId) must be of type string, null given"
  },
  "id": "660fbfa4cb219"
}

The app still lag, some folder take more than ten seconds to open.

and still this error

 Horde_Imap_Client_Exception Error when communicating with the mail server.
Cron mail sync failed for account 4 

Any ideas ?

I keep having those erros :

 Horde_Imap_Client_Exception Error when communicating with the mail server.
Cron mail sync failed for account 4 
    /config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.phpLigne 4560

    Horde_Imap_Client_Socket_Connection_Socket->read()

    /config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.phpLigne 623

    Horde_Imap_Client_Socket->_getLine()

    /config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.phpLigne 375

    Horde_Imap_Client_Socket->_connect()

    /config/www/nextcloud/apps/mail/lib/IMAP/ImapClientRateLimitingDecorator.phpLigne 73

    Horde_Imap_Client_Socket->_login(
      "*** sensitive parameters replaced ***"
    )

    /config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.phpLigne 853

    OCA\Mail\IMAP\ImapClientRateLimitingDecorator->_login(
      "*** sensitive parameters replaced ***"
    )

    /config/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.phpLigne 222

    Horde_Imap_Client_Base->login(
      "*** sensitive parameters replaced ***"
    )

    /config/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.phpLigne 137

    OCA\Mail\Service\Sync\ImapToDbSynchronizer->sync(
      "*** sensitive parameters replaced ***"
    )

    /config/www/nextcloud/apps/mail/lib/BackgroundJob/SyncJob.phpLigne 111

    OCA\Mail\Service\Sync\ImapToDbSynchronizer->syncAccount(
      "*** sensitive parameters replaced ***"
    )

    /app/www/public/lib/public/BackgroundJob/Job.phpLigne 81

    OCA\Mail\BackgroundJob\SyncJob->run()

    /app/www/public/lib/public/BackgroundJob/TimedJob.phpLigne 102

    OCP\BackgroundJob\Job->start()

    /app/www/public/lib/public/BackgroundJob/TimedJob.phpLigne 92

    OCP\BackgroundJob\TimedJob->start()

    /app/www/public/cron.phpLigne 152

    OCP\BackgroundJob\TimedJob->execute()
{
  "reqId": "l1bO81SE5sVrdEzOkXeY",
  "level": 3,
  "time": "2024-04-10T15:27:19+00:00",
  "remoteAddr": "",
  "user": "--",
  "app": "mail",
  "method": "",
  "url": "--",
  "message": "Cron mail sync failed for account 4",
  "userAgent": "--",
  "version": "28.0.3.2",
  "exception": {
    "Exception": "Horde_Imap_Client_Exception",
    "Message": "Error when communicating with the mail server.",
    "Code": 28,
    "Trace": [
      {
        "file": "/config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php",
        "line": 4560,
        "function": "read",
        "class": "Horde_Imap_Client_Socket_Connection_Socket",
        "type": "->"
      },
      {
        "file": "/config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php",
        "line": 623,
        "function": "_getLine",
        "class": "Horde_Imap_Client_Socket",
        "type": "->"
      },
      {
        "file": "/config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php",
        "line": 375,
        "function": "_connect",
        "class": "Horde_Imap_Client_Socket",
        "type": "->"
      },
      {
        "file": "/config/www/nextcloud/apps/mail/lib/IMAP/ImapClientRateLimitingDecorator.php",
        "line": 73,
        "function": "_login",
        "class": "Horde_Imap_Client_Socket",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php",
        "line": 853,
        "function": "_login",
        "class": "OCA\\Mail\\IMAP\\ImapClientRateLimitingDecorator",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/config/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
        "line": 222,
        "function": "login",
        "class": "Horde_Imap_Client_Base",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/config/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
        "line": 137,
        "function": "sync",
        "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/config/www/nextcloud/apps/mail/lib/BackgroundJob/SyncJob.php",
        "line": 111,
        "function": "syncAccount",
        "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/app/www/public/lib/public/BackgroundJob/Job.php",
        "line": 81,
        "function": "run",
        "class": "OCA\\Mail\\BackgroundJob\\SyncJob",
        "type": "->"
      },
      {
        "file": "/app/www/public/lib/public/BackgroundJob/TimedJob.php",
        "line": 102,
        "function": "start",
        "class": "OCP\\BackgroundJob\\Job",
        "type": "->"
      },
      {
        "file": "/app/www/public/lib/public/BackgroundJob/TimedJob.php",
        "line": 92,
        "function": "start",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      },
      {
        "file": "/app/www/public/cron.php",
        "line": 152,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      }
    ],
    "File": "/config/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket/Connection/Socket.php",
    "Line": 241,
    "message": "Cron mail sync failed for account {accountId}",
    "exception": {
      "details": null,
      "logged": false,
      "raw_msg": "Error when communicating with the mail server."
    },
    "CustomMessage": "Cron mail sync failed for account 4"
  },
  "id": "6616b55558e74"

If someone has an idea, it will be great, cause I canā€™t find anything on the net to resolve thisā€¦

what kind of mailserver do you have? do you run it yourself, perhaps?

the mail server is mailo.com, I donā€™t run it myself

would you mind giving me a screenshot of your setup of your ā€œemailserverā€ in your admin-account? https://put.yoururl.here/settings/admin

from nextcloud ?

of course from your nextcloud