Skip to content

Commit 48aca4f

Browse files
turianclaude
andcommitted
Set reply from-address to match the address that received the original
When replying to an email sent to joseph@noc0.dev, the reply should come from joseph@noc0.dev, not the account default (turian@fastmail.com). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent aff66cd commit 48aca4f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/fastmail_cli/jmapc.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,10 @@ def handle_email_draft_reply(args: argparse.Namespace) -> Tuple[int, Dict[str, A
431431
else:
432432
references = original.message_id
433433

434+
# Set from address to the address that received the original email
435+
# This ensures replies come from the correct identity (e.g., joseph@noc0.dev not turian@fastmail.com)
436+
from_addr = original.to[0] if original.to else None
437+
434438
# Find the Drafts mailbox
435439
drafts_mailbox_id = find_drafts_mailbox_id(client, account_id)
436440

@@ -447,6 +451,7 @@ def handle_email_draft_reply(args: argparse.Namespace) -> Tuple[int, Dict[str, A
447451
email = Email(
448452
mailbox_ids={drafts_mailbox_id: True},
449453
keywords={"$draft": True},
454+
mail_from=[from_addr] if from_addr else None,
450455
to=to_addrs,
451456
cc=cc_addrs,
452457
subject=subject,

0 commit comments

Comments
 (0)