Repository navigation
Conversation
Some IMAP servers advertise mechanisms (e.g. GSSAPI) that libcurl picks first but cannot complete, so the login fails although PLAIN or DIGEST-MD5 would work. An optional 7th argument is passed to CURLOPT_LOGIN_OPTIONS so the admin can pin the mechanism; existing configurations are unaffected. Fixes nextcloud#153 AI-assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Petr Klima <qaxi@seznam.cz>
Author
|
Next attempt :-) @martinschniewind, @lazki, @damnms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #153, supersedes #176, #196 and #236 (same idea, rebased on current master, single signed-off commit, with tests).
Some servers advertise mechanisms libcurl prefers but cannot complete (e.g. GSSAPI without Kerberos credentials), so login fails although PLAIN would work:
With
curl --login-options "AUTH=PLAIN"the same login succeeds; this PR exposes that option.An optional 7th argument is passed to CURLOPT_LOGIN_OPTIONS so the admin can pin the mechanism; existing configurations are unaffected.
Fixes #153
Supersedes #176, #196 and #236 (same idea, rebased on current master, single signed-off commit, with tests).
Changes proposed in this pull request:
loginOptions, passed toCURLOPT_LOGIN_OPTIONS(e.g.AUTH=PLAIN,AUTH=DIGEST-MD5). Unset or empty → behaviour unchanged, so existing configurations keep working.js/assets.tests/unit/IMAPTest.php); curl execution moved to a smallexecuteCurl()method so it can be stubbed, the same pattern asWebDavAuth::fetchUrl().Tested locally:
composer lint,composer cs:check, unit (46) and integration (17) tests on Nextcloud 32 / PHP 8.3,npm ci && npm run buildon Node 24 (no further asset changes).Suggested changelog line:
Add optional login options (e.g. AUTH=DIGEST-MD5) for IMAP backendAssisted-by: Claude Opus 5.5 noreply@anthropic.com
Signed-off-by: Petr Klima qaxi@seznam.cz