Skip to content

fix: reply-all no longer CCs your own send-as alias#6

Closed
drebaglioni wants to merge 2 commits into
mainfrom
drebaglioni/cherry-91-replyall-alias
Closed

fix: reply-all no longer CCs your own send-as alias#6
drebaglioni wants to merge 2 commits into
mainfrom
drebaglioni/cherry-91-replyall-alias

Conversation

@drebaglioni

Copy link
Copy Markdown
Owner

Summary

Cherry-picks upstream ankitvgupta/mail-app#91 by @buzali.

When reply-all is used on an email addressed to one of your send-as aliases, extractReplyInfo doesn't know the alias belongs to you and includes it in CC — you end up CC'ing yourself. This filters the selected From alias out of CC at state-level (via useEffect on from) so:

  • CC chips in the UI never show your own alias during compose
  • hasAnyRecipient guards see the correct filtered CC
  • Undo-send restoration doesn't put the alias back into CC

Other aliases are intentionally left alone (you may want to send yourself at a different alias).

Changes

  • src/renderer/hooks/useComposeForm.ts — +12 lines, one useEffect that strips the current from alias from cc.

Test plan

  • Configure a send-as alias in Gmail settings; send yourself a message to that alias.
  • Hit reply-all → confirm your alias is NOT in the CC chip row.
  • Pick a different From alias in the compose dropdown → CC updates to remove the newly selected From if present.
  • Send + undo-send → on restore, CC still excludes the alias.

Notes

  • Pre-existing on origin/main: 26 unit tests fail in archive-ready.spec.ts, calendaring-agent.spec.ts, and email-analyzer.spec.ts — unrelated to this change. Worth triaging separately.
  • npx tsc --noEmit
  • npm run lint

buzali added 2 commits April 18, 2026 14:42
When reply-all is used on an email addressed to a send-as alias,
extractReplyInfo doesn't know the alias belongs to the current user
and includes it in the CC list. The user ends up CC'ing themselves.

Filter the selected From address out of CC in buildSendOptions, where
both values are known. Other aliases are left alone since they may be
intentional recipients (e.g. emailing yourself at a different alias).
Move the from-alias CC filtering from buildSendOptions (send-time) to
a useEffect on `from` changes. This fixes:

- CC chips in the UI showing the user's own alias during compose
- hasAnyRecipient guards using unfiltered cc (Devin review)
- Undo-send restoring the alias back into CC (Greptile review)
@drebaglioni
drebaglioni deleted the drebaglioni/cherry-91-replyall-alias branch June 23, 2026 01:28
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.

2 participants