Skip to content

fix: keep incoming email To recipients in reply CC - #71

Open
iamsivin wants to merge 3 commits into
mainfrom
fix/CW-8153
Open

iamsivin wants to merge 3 commits into
mainfrom
fix/CW-8153

Conversation

@iamsivin

@iamsivin iamsivin commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

When an incoming email is sent to the inbox and to other people, replying from Chatwoot leaves those other people out. For example, if a customer emails hello@team.com and engineering@team.com, the reply goes to the customer but engineering@team.com is not added to CC.

Replying used to add the email's other To recipients to CC. That was added in #41 for chatwoot/chatwoot#8925. #43 accidentally replaced the incoming email's To list with an empty list, so those recipients were dropped. This PR reads the real To list again.

CC also skips:

  • the inbox and forward-to addresses in any letter case (e.g. HELLO@team.com), so the reply does not CC the inbox itself
  • addresses already in To, so the sender is not listed twice when they put their own address on the To line

Bumps the version to 0.0.58.

Linear: https://linear.app/chatwoot/issue/CW-8153

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T02:54:33.210223Z f1efbb4 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

size-limit report 📦

Path Size
dist/utils.cjs.production.min.js 13.3 KB (+0.2% 🔺)
dist/utils.esm.js 12.71 KB (+0.3% 🔺)

@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

cc.push(...emailAttributes.to);

P2 Badge Exclude reply senders from imported To recipients

When an incoming message also lists its sender in email.to—for example, from: ['sender@example.com'] and to: [inboxEmail, 'sender@example.com']—this appends that address to cc even though it was already placed in to. Deduplication occurs only within each array, so the result contains the same recipient in both headers, which can cause duplicate delivery or rejection by email providers. Filter the incoming To recipients against the reply's To list before adding them to CC.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@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: f1efbb4d4b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/email.ts Resolved

@sony-mathew sony-mathew 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.

lgtm

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.

3 participants