Skip to content

Support SASL-IR for AUTHENTICATE PLAIN - #297

Merged
Aravinda-HWK merged 3 commits into
mainfrom
296-support-sasl-ir-for-all-authenticate-mechanisms
Aug 19, 2026
Merged

Support SASL-IR for AUTHENTICATE PLAIN#297
Aravinda-HWK merged 3 commits into
mainfrom
296-support-sasl-ir-for-all-authenticate-mechanisms

Conversation

@maneesha-xyz

Copy link
Copy Markdown
Collaborator

Summary

  • Advertise SASL-IR whenever TLS is active, decoupled from OAuth configuration (previously only shown when OAuth was set up).
  • AUTHENTICATE PLAIN now accepts the initial response inline on the command line, skipping the + continuation round trip. This matches existing OAUTHBEARER/XOAUTH2 behavior.
  • = as the inline argument is treated as an explicit zero-length response, distinct from omitting the argument entirely.
  • * cancellation only applies to the continuation-fallback path, not to an inline argument (there's no prompt to cancel).

Closes #296.

Test plan

  • go test ./... passes
  • New unit tests: TestAuthenticatePlainSASLIRInline, TestAuthenticatePlainSASLIRExplicitEmpty
  • Updated capability_test.go to assert SASL-IR gating on TLS, not OAuth
  • New end-to-end integration test: TestIMAPServerToClient_AuthenticatePlainInlineIR (real TLS handshake, real DB-backed auth)
  • Manually verified against a real Nextcloud Mail client

@maneesha-xyz maneesha-xyz linked an issue Aug 19, 2026 that may be closed by this pull request
@maneesha-xyz maneesha-xyz self-assigned this Aug 19, 2026
@maneesha-xyz maneesha-xyz added the enhancement New feature or request label Aug 19, 2026

@Aravinda-HWK Aravinda-HWK left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aravinda-HWK
Aravinda-HWK merged commit da9fa42 into main Aug 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support SASL-IR for all AUTHENTICATE mechanisms

2 participants