Skip to content

fix(imap): align greeting CAPABILITY list with explicit CAPABILITY command - #309

Open
dineth-nimnaka wants to merge 4 commits into
OpenGovMail:mainfrom
dineth-nimnaka:fix/align-greeting-capability-list
Open

dineth-nimnaka wants to merge 4 commits into
OpenGovMail:mainfrom
dineth-nimnaka:fix/align-greeting-capability-list

Conversation

@dineth-nimnaka

Copy link
Copy Markdown
Contributor

📌 Description

Aligns the capabilities advertised in the server greeting with the explicit CAPABILITY command response by reusing auth.BuildCapabilities as the single source of truth.


🔍 Changes Made

  • Exported buildCapabilities as BuildCapabilities in internal/server/auth/auth.go so it can be shared across packages.
  • Removed the separate/duplicate greetingCapabilities function in internal/server/server.go.
  • Updated plain connection and SSL/TLS connection greetings to use auth.BuildCapabilities, ensuring NAMESPACE, UNSELECT, and all future capabilities stay in sync across greeting and explicit command responses.

✅ Checklist (Email System)

  • Core IMAP commands tested (LOGIN, CAPABILITY, LIST, SELECT, FETCH, LOGOUT).
  • Authentication is tested.
  • Docker build & run validated.
  • Configuration loading verified for default and custom paths.
  • Persistent storage with Docker volume verified.
  • Error handling and logging verified
  • Documentation updated (README, config samples).

🧪 Testing Instructions

To test the server, use the instructions in the README in the test directory.

  1. Connect to Raven via plain socket (port 143) and observe the initial * OK [CAPABILITY ...] greeting.
  2. Send CAPABILITY command and compare the capability list; verify they are aligned (including NAMESPACE and UNSELECT).
  3. Connect via TLS/SSL and repeat to verify both TLS states match.

📷 Screenshots / Logs (if applicable)

N/A


⚠️ Notes for Reviewers

Refactored greeting to use auth.BuildCapabilities directly to eliminate code duplication and avoid capability drift in the future.

@CLAassistant

CLAassistant commented Oct 8, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@greptile-apps

greptile-apps Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5 Tier: apex

[Medium impact] The PR appears safe to merge with no outstanding findings.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Plain["Plain greeting"] --> Builder["auth.BuildCapabilities"]
    TLS["TLS greeting"] --> Builder
    Command["CAPABILITY command"] --> Builder
    Builder --> List["Shared capability list"]
Loading

Reviews (4) · Last reviewed commit: "fix(lint): remove unused oauthSASLReady ..." · Reviewed by Greptile

Comment thread internal/server/server.go Outdated
@maneesha-xyz

Copy link
Copy Markdown
Collaborator

Hi @dineth-nimnaka we have made some changes to our CLA. We need contributors to sign it again. Please let me know if there is any issue.

@dineth-nimnaka

Copy link
Copy Markdown
Contributor Author

Signed the updated CLA! @maneesha-xyz

Comment thread internal/server/handlers_test.go Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK] Greeting CAPABILITY list differs from explicit CAPABILITY command list

3 participants