Conversation
The inline path already did this from the first envelope recipient. The S3 path returned the object unchanged, so apps that route on that header dropped mail whose inbox address was only on the SMTP envelope. Co-authored-by: Cursor <cursoragent@cursor.com>
mail.destination is the visible To and Cc. A BCC whose inbox address is only the envelope recipient was labeled with the To header, so routing missed the inbox. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
SNSNotification#message_contentprependsX-Original-Tofrom the first SES envelope recipient when the message is inline in the SNS payload. When the receipt action is S3, it returned the object bytes with no header.Action Mailbox apps (Chatwoot included) match the inbox on
To,Cc, orX-Original-To. Group and BCC copies often have the inbox address only inmail.destination. Those messages were stored and then discarded.Both paths now use the same prefix. The S3 request spec expects the stored raw email to start with that header.
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.
Test plan
message_contenton the S3 fixture returnsX-Original-To: recipient@example.complus the object bodyMailparses that header from the prepended stringreceives an inbound email with data in s3(local Ruby 4 + json 3 cannot encode the request;quirks_modeis raised by the test client before the app runs)Made with Cursor