fix: reply-all Cc's the user's own other addresses (multi-account) (#672)

* feat: publish all configured email addresses for reply-all exclusion

* fix: exclude all of the user's own addresses from reply-all, not just the active one

* test: reply-all excludes all of the user's configured addresses
This commit is contained in:
Afonso Coutinho
2026-06-02 03:42:20 +01:00
committed by GitHub
parent 48d3b7abab
commit 634c16a019
4 changed files with 38 additions and 12 deletions
+13
View File
@@ -51,3 +51,16 @@ def test_reply_all_excludes_only_self_exactly():
cc = json.loads(_run(js))
# Our own address is dropped; a substring-similar address is kept.
assert cc == "Alice <alice@x.com>, bob@x.com"
@pytest.mark.skipif(not _HAS_NODE, reason="node binary not on PATH")
def test_reply_all_excludes_all_of_my_addresses():
# Multi-account user: every one of their own addresses must be excluded,
# not just the active one.
data = {"to": "Alice <alice@x.com>, me@work.com", "cc": "me@personal.com, bob@x.com"}
js = f"""
import {{ buildReplyAllCc }} from '{_HELPER.as_posix()}';
console.log(JSON.stringify(buildReplyAllCc({json.dumps(data)}, ["me@work.com", "me@personal.com"])));
"""
cc = json.loads(_run(js))
assert cc == "Alice <alice@x.com>, bob@x.com"