Which user causes "Horde_Imap_Client_Exception Mail server denied authentication"

Hi,

I have a lot of users on my Nextcloud and I have a lot of log entries where the mail app says “Horde_Imap_Client_Exception Mail server denied authentication”. See the complete log entry further down in this message.

Unfortunately I do not find a hint in the stacktrace and in the raw log entry about the mail account or the Nextcloud user that causes this problem. So I am unable to contact the person causing this issue or looking in oc_mail_accounts for the account that is throwing this exception.

Any hints how I can solve this and get more information?

Andreas

 Horde_Imap_Client_Exception Mail server denied authentication.

    /var/www/nextcloud/server/apps/mail/lib/IMAP/ImapClientRateLimitingDecorator.phpZeile 73

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

    /var/www/nextcloud/server/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.phpZeile 853

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

    /var/www/nextcloud/server/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.phpZeile 2510

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

    /var/www/nextcloud/server/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.phpZeile 2493

    Horde_Imap_Client_Base->_fetchWrapper()

    /var/www/nextcloud/server/apps/mail/lib/IMAP/MessageMapper.phpZeile 884

    Horde_Imap_Client_Base->fetch()

    /var/www/nextcloud/server/apps/mail/lib/IMAP/PreviewEnhancer.phpZeile 87

    OCA\Mail\IMAP\MessageMapper->getBodyStructureData()

    /var/www/nextcloud/server/apps/mail/lib/Service/PreprocessingService.phpZeile 83

    OCA\Mail\IMAP\PreviewEnhancer->process()

    /var/www/nextcloud/server/apps/mail/lib/BackgroundJob/PreviewEnhancementProcessingJob.phpZeile 93

    OCA\Mail\Service\PreprocessingService->process()

    /var/www/nextcloud/server/lib/public/BackgroundJob/Job.phpZeile 81

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

    /var/www/nextcloud/server/lib/public/BackgroundJob/TimedJob.phpZeile 102

    OCP\BackgroundJob\Job->start()

    /var/www/nextcloud/server/lib/public/BackgroundJob/TimedJob.phpZeile 92

    OCP\BackgroundJob\TimedJob->start()

    /var/www/nextcloud/server/cron.phpZeile 152

    OCP\BackgroundJob\TimedJob->execute()

Roh-Protokoll Eintrag

{
  "reqId": "txC092czVyGPsz3p4StG",
  "level": 2,
  "time": "2024-06-12T14:06:45+02:00",
  "remoteAddr": "",
  "user": "--",
  "app": "mail",
  "method": "",
  "url": "--",
  "message": "Could not fetch structure detail data to enhance message previews: Mail server denied authentication.",
  "userAgent": "--",
  "version": "28.0.6.1",
  "exception": {
    "Exception": "Horde_Imap_Client_Exception",
    "Message": "Mail server denied authentication.",
    "Code": 102,
    "Trace": [
      {
        "file": "/var/www/nextcloud/server/apps/mail/lib/IMAP/ImapClientRateLimitingDecorator.php",
        "line": 73,
        "function": "_login",
        "class": "Horde_Imap_Client_Socket",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/server/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": "/var/www/nextcloud/server/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php",
        "line": 2510,
        "function": "login",
        "class": "Horde_Imap_Client_Base",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/server/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php",
        "line": 2493,
        "function": "_fetchWrapper",
        "class": "Horde_Imap_Client_Base",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/server/apps/mail/lib/IMAP/MessageMapper.php",
        "line": 884,
        "function": "fetch",
        "class": "Horde_Imap_Client_Base",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/server/apps/mail/lib/IMAP/PreviewEnhancer.php",
        "line": 87,
        "function": "getBodyStructureData",
        "class": "OCA\\Mail\\IMAP\\MessageMapper",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/server/apps/mail/lib/Service/PreprocessingService.php",
        "line": 83,
        "function": "process",
        "class": "OCA\\Mail\\IMAP\\PreviewEnhancer",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/server/apps/mail/lib/BackgroundJob/PreviewEnhancementProcessingJob.php",
        "line": 93,
        "function": "process",
        "class": "OCA\\Mail\\Service\\PreprocessingService",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/server/lib/public/BackgroundJob/Job.php",
        "line": 81,
        "function": "run",
        "class": "OCA\\Mail\\BackgroundJob\\PreviewEnhancementProcessingJob",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/server/lib/public/BackgroundJob/TimedJob.php",
        "line": 102,
        "function": "start",
        "class": "OCP\\BackgroundJob\\Job",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/server/lib/public/BackgroundJob/TimedJob.php",
        "line": 92,
        "function": "start",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/server/cron.php",
        "line": 152,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      }
    ],
    "File": "/var/www/nextcloud/server/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php",
    "Line": 572,
    "message": "Could not fetch structure detail data to enhance message previews: Mail server denied authentication.",
    "exception": {
      "details": null,
      "logged": false,
      "raw_msg": "Mail server denied authentication."
    },
    "CustomMessage": "Could not fetch structure detail data to enhance message previews: Mail server denied authentication."
  },
  "id": "6669990e5d224"
}

Did you configure Nextcloud mail settings properly to access the IMAP mailserver?
Nextcloud mail only is an IMAP mailclient, but not a server.

Unfortunatelly you did not provide the support template with all neccessary information, you were asked for at creation of your posting

It is not my mail account. I’m the sysadmin and this is one of the users. But which one?

1 Like

HI
I also have this problem that I’m looking for the user who probably use the wrong Mail login and therefore causes the error message: “Horde_Imap_Client_Exception Authentication failed.”
“Failed to get structural detail data to improve message preview: Authentication failed.”

and then

“Horde_Imap_Client_Exception Authentication failed.
“Failed to get structural detail data to improve message preview: Authentication failed.”

Is there already a solution? How do I locate the culprit?

Thanks in advance