@bobfrankston/rmfmail 1.1.189 → 1.1.191

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7444,17 +7444,24 @@ async function openCompose(mode, overrideMsg, overrideAccountId) {
7444
7444
  const identityDomains = foldDomains(
7445
7445
  explicitDomains.length > 0 ? explicitDomains : accountDomain ? [accountDomain] : []
7446
7446
  );
7447
+ function bareAddress(raw) {
7448
+ if (!raw) return raw;
7449
+ const angle = raw.match(/<([^>]+)>/);
7450
+ if (angle) return angle[1].trim();
7451
+ return raw.trim().replace(/^"+|"+$/g, "");
7452
+ }
7447
7453
  function detectReplyFrom() {
7448
7454
  if (!msg) return void 0;
7449
7455
  if (msg.deliveredTo) {
7450
- console.log(`[compose] reply From \u2192 ${msg.deliveredTo} (Delivered-To)`);
7451
- return msg.deliveredTo;
7456
+ const addr = bareAddress(msg.deliveredTo);
7457
+ console.log(`[compose] reply From \u2192 ${addr} (Delivered-To, bare of "${msg.deliveredTo}")`);
7458
+ return addr;
7452
7459
  }
7453
7460
  if (identityDomains.length === 0) return void 0;
7454
7461
  const candidates = [
7455
7462
  ...(msg.to || []).map((a) => a.address),
7456
7463
  ...(msg.cc || []).map((a) => a.address)
7457
- ].filter(Boolean);
7464
+ ].filter(Boolean).map(bareAddress);
7458
7465
  for (const addr of candidates) {
7459
7466
  const domain = addr.split("@")[1]?.toLowerCase();
7460
7467
  if (domain && identityDomains.some((d) => domain === d || domain.endsWith(`.${d}`))) {