Login with valid LDAP users throw ERROR: IMAP Login failed via curl: Login denied
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- php
- Domain
- authentication
Research direction
Start in apps/user_external/lib/IMAP.php at checkPassword($uid, $password), focusing on the escaped-@ handling and how non-email LDAP usernames reach IMAP authentication. Reproduce the mixed user_external and LDAP setup described in the issue, then verify that valid LDAP users no longer produce an IMAP Login denied error.
Written by the indexing model from the issue text.
Description
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"}}
- Dominant language
- JavaScript
- Stars
- 120
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextcloud/user_external
-
NC 35 compatibility Open0. Needs triage enhancement
Difficulty 3/5 1-2 days Newbie friendliness 35/100
nextcloud/user_external#311 · 1 comment · 2 reactions ·
-
0. Needs triage bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
nextcloud/user_external#310 · 2 comments ·
-
v4.0.0 released! Open
Difficulty 1/5 Under an hour Newbie friendliness 20/100
nextcloud/user_external#295 · 3 reactions ·
-
0. Needs triage bug
Difficulty 3/5 1-2 days Newbie friendliness 52/100
nextcloud/user_external#281 · 6 comments · 3 reactions ·
-
two IMAP servers Open
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
nextcloud/user_external#278 · 1 reaction ·
All issues in nextcloud/user_external
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·
-
client-controller-update ta-bot-triage team-money-movement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MetaMask/metamask-mobile#36594 ·