Allow custom visible From address for JMAP submissions#26
Conversation
There was a problem hiding this comment.
💡 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".
|
@codex are we ready to merge |
There was a problem hiding this comment.
💡 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".
Motivation
Fromheader to the form submitter while choosing an authenticated JMAP identity for the submission.Emailheaders andEmailSubmissionidentityIdare separate, and servers may enforce permissions on which identity may use which visibleFrom.Description
SendEmailWithIdentity(from, to, subject, body, identityEmail, isHTML)and make existingSendEmaildelegate to it after validating a defaultFromaddress.Email.SubmitWithIdentityEmailandEmail.SubmitWithIdentityIDhelpers soEmailSubmission/setcan be created with a caller-providedidentityId, and factor post-submit mailbox/keyword updates intoupdateAfterSubmit.SubmitCallpayload using the providedidentityIdsoEmailSubmission/setfollows JMAP requirements, and add validation toSubmitfor missingFromaddresses.objects/emails/submit_unit_test.goand document the new API and contact-form usage inREADME.md.Testing
go test ./objects/emails -run 'TestSubmitCallUsesProvidedIdentity|TestSubmitRequiresFromAddressForDefaultIdentity'and the targeted unit tests passed.go test ./...which fails in this environment because integration tests require a.envand a valid Fastmail/JMAP session token, causing external-authentication-related failures.Codex Task