Skip to content

fix(compose): reply to sent message recipients - #692

Merged
maathimself merged 3 commits into
maathimself:mainfrom
salmonumbrella:fix/sent-reply-recipients-upstream
Oct 28, 2026
Merged

maathimself merged 3 commits into
maathimself:mainfrom
salmonumbrella:fix/sent-reply-recipients-upstream

Conversation

@salmonumbrella

Copy link
Copy Markdown
Contributor

Summary

Replying to a sent message now addresses its original recipients instead of the sender. Reproduced on current main: send from [email protected] to [email protected], open the Sent copy, and click Reply. Before this change, To contains the owner; afterwards, it contains the original recipient.

Fix-sent-message-replies-addressing-the-sender.mp4

Changes

  • Share recipient selection between normal Reply and mobile swipe Reply. Sent messages use external To recipients, then Cc; Reply All adds the remaining recipients without duplicates. Self-only notes still work, and Bcc is never added.
  • Keep received-message Reply-To behavior and account-specific alias selection.
  • Return the actual reply sender separately from the conversation's display sender, and include the stored reply metadata in search results.

One commit based on current main. No migrations or new dependencies.

Testing

  • Reproduced before the fix: the compose utility regression suite fails on main, then passes all 43 tests with this patch.
  • Linux, Node 22, PostgreSQL 16: backend npm test -- --maxWorkers=2 --testTimeout=30000 passes 3,939 tests (2 existing optional tests skipped), including the real PostgreSQL sender projection regression.
  • Linux, Node 22: frontend npm test passes all 4,073 tests.
  • Backend/frontend lint, plugin boundary, syntax check, production build and production dependency audits at the high-severity threshold pass.
  • Regression coverage includes sent To/Cc selection, aliases, received Reply-To, conversation sender identity, search metadata, Reply/Reply All toggling and mobile swipe without a body fetch.

The demo uses fictional data and illustrates the behavior; it is not a live-provider test.

Closes #691
Refs #667


Contributor License Agreement

By submitting this pull request I confirm that:

  • I have read and agree to the Contributor License Agreement.
  • My contribution is my own original work (or I have identified any third-party material and confirmed it is compatible with the CLA).
  • I have the right to submit this contribution under the terms of the CLA.

salmonumbrella and others added 2 commits October 26, 2026 15:50
…ress

A message from one of the account's own addresses replied to its external
To or Cc, and otherwise to itself, ignoring Reply-To. A contact form that
sends from and to the site's own address with the visitor in Reply-To then
replied to the site instead of the visitor, which worked before.

With no external To or Cc, the first external Reply-To address is now the
reply target, before falling back to the account's own To or Cc. External
To recipients still win over a team Reply-To on a sent copy.
@maathimself

Copy link
Copy Markdown
Owner

Thanks, this fixes #691. One regression we found in review and fixed on your branch: when From is one of the account's own addresses and there are no external recipients, Reply-To was ignored, so a contact-form style message (From: me, To: me, Reply-To: visitor) replied to me instead of the visitor. Owned-sender replies now use an external Reply-To before falling back to self, with a test for that shape. Two follow-ups we noted but left out of this PR: Sent copies from "Send as" or delegated addresses still reply to the sender, and Forward from a threaded row still credits the oldest sender.

# Conflicts:
#	frontend/src/utils/composeFromMessage.js

@maathimself maathimself left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Approved: reviewed and tested, see the comment above.

@maathimself
maathimself merged commit f9a217a into maathimself:main Oct 28, 2026
2 checks passed
Monkey7539 added a commit to Monkey7539/mailflow that referenced this pull request Oct 28, 2026
Brings in upstream 0441d23 (42 commits): 4.1.0, Reply with AI from a
conversation and with an instruction (maathimself#577), replying to a sent
message's recipients (maathimself#692), the conversation bar and cards drawn from
the reading pane's buttons (maathimself#650), a moved message's new uid found
without COPYUID, read-state and count fixes (maathimself#701), and the scheduled
send follow-ups, among others.

Conflicts:
- ConversationPane.jsx: upstream rebuilt the conversation bar as icon
  buttons above the message list and removed ThreadBtn, so dev's old
  bar goes. Dev's two changes to it move into the new bar: no Snooze
  button without a snooze target, and the picker's Change snooze time
  action.
- ComposeModal.render.test.js: both sides appended a describe block;
  upstream's first.

Also: dev's conversation tests find the bar's buttons by aria-label
instead of title, since Archive's title now carries its shortcut.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
maathimself added a commit that referenced this pull request Nov 1, 2026
…sender

Replying to a message in Sent that went out from a "Send as" or
delegated address MailFlow doesn't list as an alias went back to that
address, not to the people it was sent to. A copy in the account's Sent
folder (by its special-use flag, the folder mapping, or the usual names)
now counts as the user's own, so Reply and Reply All answer its
recipients, as they do for the account's address and its aliases.

Forwarding a conversation row in the grouped list, from the context menu
or with F, forwarded the row's newest message but credited it to the
person who started the thread. The forward header now names the sender
of the message being forwarded, as the reply quote already did.

Follow-ups to #692.
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.

Replying to a sent message addresses the sender instead of its recipients

2 participants