Skip to content

Login with valid LDAP users throw ERROR: IMAP Login failed via curl: Login denied #298

@internethering

Description

@internethering

Steps to reproduce

I use a mixed setup with user_external & imap and ldap. If a valid ldap user is successfully connecting, the user_external app is throwing the error: "ERROR: IMAP Login failed via curl: Login denied"

I fixed it by adding at apps/user_external/lib/IMAP.php in function checkPassword($uid, $password) after the "Replace escaped @ symbol" code block this:

        // if uid is not an email-adress, don't use this method
        if (strpos($uid, '@') === false) {
            return false;
        }

Affected Authentication backend

IMAP

Server configuration

User External App version: 4.0.0
Nextcloud version: 33.0.3

List of activated apps:

App list
[...]
  - user_ldap: 1.24.0
[...]

Nextcloud configuration:

Config report

I only use IMAP backend

        "user_backends": [
            {
                "class": "\\OCA\\UserExternal\\IMAP",
                "arguments": [
                    "***REMOVED SENSITIVE VALUE***",
                    993,
                    "ssl"
                ]
            }
        ],

Logs

Nextcloud log (data/nextcloud.log)

Nextcloud log
{"reqId":"afoZH4ZrxGscN10vjbAkrAAAhE0","level":3,"time":"2026-05-05T18:21:55+02:00","remoteAddr":"2003:e8:e740:7f01:cfeb:a58a:5879:7dfd","user":"<ldap-user>","app":"user_external","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","scriptName":"/ocs/v2.php","message":"ERROR: IMAP Login failed via curl: Login denied","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36","version":"33.0.3.2","data":{"app":"user_external"}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions