Skip to content

Allow custom visible From address for JMAP submissions#26

Merged
cwinters8 merged 8 commits into
mainfrom
codex/find-how-to-customize-email-from-address
Jun 4, 2026
Merged

Allow custom visible From address for JMAP submissions#26
cwinters8 merged 8 commits into
mainfrom
codex/find-how-to-customize-email-from-address

Conversation

@cwinters8

Copy link
Copy Markdown
Owner

Motivation

  • Support contact-form and similar workflows by letting callers set the message's visible From header to the form submitter while choosing an authenticated JMAP identity for the submission.
  • Align behavior with JMAP (RFC 8621) where Email headers and EmailSubmission identityId are separate, and servers may enforce permissions on which identity may use which visible From.

Description

  • Add SendEmailWithIdentity(from, to, subject, body, identityEmail, isHTML) and make existing SendEmail delegate to it after validating a default From address.
  • Add Email.SubmitWithIdentityEmail and Email.SubmitWithIdentityID helpers so EmailSubmission/set can be created with a caller-provided identityId, and factor post-submit mailbox/keyword updates into updateAfterSubmit.
  • Keep SubmitCall payload using the provided identityId so EmailSubmission/set follows JMAP requirements, and add validation to Submit for missing From addresses.
  • Add unit tests in objects/emails/submit_unit_test.go and document the new API and contact-form usage in README.md.

Testing

  • Ran go test ./objects/emails -run 'TestSubmitCallUsesProvidedIdentity|TestSubmitRequiresFromAddressForDefaultIdentity' and the targeted unit tests passed.
  • Ran go test ./... which fails in this environment because integration tests require a .env and a valid Fastmail/JMAP session token, causing external-authentication-related failures.

Codex Task

@cwinters8 cwinters8 marked this pull request as ready for review June 3, 2026 21:04

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eaee9d6dee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/test.yml
@cwinters8

Copy link
Copy Markdown
Owner Author

@codex are we ready to merge

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4a962b3372

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread objects/emails/submit_test.go
@cwinters8 cwinters8 merged commit b7d551f into main Jun 4, 2026
1 check passed
@cwinters8 cwinters8 deleted the codex/find-how-to-customize-email-from-address branch June 4, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant