Skip to content

feat(auth): implement XOAUTH2-based SMTP authentication with client email authorization#277

Merged
Aravinda-HWK merged 3 commits into
OpenGovMail:mainfrom
Aravinda-HWK:276-task-implement-xoauth2-based-smtp-authentication-with-config-driven-sender-authorization
Jun 6, 2026
Merged

feat(auth): implement XOAUTH2-based SMTP authentication with client email authorization#277
Aravinda-HWK merged 3 commits into
OpenGovMail:mainfrom
Aravinda-HWK:276-task-implement-xoauth2-based-smtp-authentication-with-config-driven-sender-authorization

Conversation

@Aravinda-HWK

Copy link
Copy Markdown
Collaborator

📌 Description

This PR is to update SASL service to support M2M application authentication support(client_credentials).


🔍 Changes Made

  • Add new config file to email addresses for each application.
  • Support to client_credentials authentication

✅ 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.


📷 Screenshots / Logs (if applicable)


⚠️ Notes for Reviewers

…mail authorization

Co-authored-by: Copilot <copilot@github.com>
@Aravinda-HWK Aravinda-HWK self-assigned this Apr 25, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds sender authorization for OAuth client_credentials grants using a JSON mapping of client IDs to allowed emails. It updates the Claims struct and SASL server to enforce these restrictions. Feedback suggests passing the Claims struct by pointer to properly update the session identity and removing redundant string trimming to clean up the implementation.

Comment thread internal/sasl/server.go Outdated
Comment thread internal/sasl/server.go Outdated
Comment thread internal/sasl/server.go

@maneeshaxyz maneeshaxyz 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 and others added 2 commits May 23, 2026 18:56
…tication-with-config-driven-sender-authorization
…inter to Claims and improve email normalization
@Aravinda-HWK
Aravinda-HWK merged commit f0b0736 into OpenGovMail:main Jun 6, 2026
6 checks passed
@Aravinda-HWK
Aravinda-HWK deleted the 276-task-implement-xoauth2-based-smtp-authentication-with-config-driven-sender-authorization branch June 6, 2026 06:44
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] Implement XOAUTH2-Based SMTP Authentication with Config-Driven Sender Authorization

2 participants