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
+7 -5
View File
@@ -722,10 +722,12 @@ async function _openEmail(em, itemEl, preloadedData = null, mode = 'reply') {
em.is_read = true;
if (itemEl) itemEl.classList.remove('email-unread');
// Get my own address to exclude from Reply All. window._myEmailAddress
// is populated from the configured account on init; the empty fallback
// simply means "no exclusion" — better than baking in a real address.
const myAddress = (window._myEmailAddress || '').toLowerCase();
// Addresses to exclude from Reply All. Prefer the full set of configured
// accounts (so a multi-account user's other mailboxes are excluded too),
// falling back to the single active address. Empty ⇒ no exclusion.
const myAddresses = (Array.isArray(window._myEmailAddresses) && window._myEmailAddresses.length)
? window._myEmailAddresses
: (window._myEmailAddress ? [window._myEmailAddress] : []);
let toAddress = data.from_address;
let ccAddresses = '';
@@ -733,7 +735,7 @@ async function _openEmail(em, itemEl, preloadedData = null, mode = 'reply') {
if (mode === 'reply-all') {
// Build reply-all: TO = original sender, CC = everyone else (To + Cc minus me)
ccAddresses = buildReplyAllCc(data, myAddress);
ccAddresses = buildReplyAllCc(data, myAddresses);
} else if (mode === 'forward') {
toAddress = '';
subjectPrefix = 'Fwd: ';