[object Object]

← back to George Gmail

fix: strip 'From job:' provenance banner from outbound email body (TK-11365)

21939724473ac630b9cb9846cc637e879685ee5b · 2026-09-12 04:05:44 -0700 · steve@designerwallcoverings.com

Files touched

Diff

commit 21939724473ac630b9cb9846cc637e879685ee5b
Author: steve@designerwallcoverings.com <steve@designerwallcoverings.com>
Date:   Sat Sep 12 04:05:44 2026 -0700

    fix: strip 'From job:' provenance banner from outbound email body (TK-11365)
---
 server.js | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/server.js b/server.js
index a808867..1e335f2 100644
--- a/server.js
+++ b/server.js
@@ -1226,10 +1226,13 @@ function inferSource(body, req) {
   return String(raw).slice(0, 120);
 }
 function withSourceFooter(htmlBody, source) {
-  if (!source) return htmlBody || '';   // empty source -> no banner (customer-facing send)
-  const ts = new Date().toLocaleString('en-US', { timeZone: 'America/Los_Angeles', month: 'short', day: 'numeric', year: 'numeric', hour: 'numeric', minute: '2-digit' });
-  const tag = `<div style="font-family:ui-monospace,Menlo,monospace;font-size:10px;letter-spacing:.10em;text-transform:uppercase;color:#7a766f;padding:8px 12px;background:rgba(212,160,74,0.08);border-left:3px solid #d4a04a;margin-bottom:18px;border-radius:2px"><strong style="color:#d4a04a">From job:</strong> ${escapeHtml(source)} <span style="color:#a8a39c">·</span> ${ts}</div>`;
-  return tag + (htmlBody || '');
+  // TK-11365 (2026-09-12): Banner suppressed entirely from email body.
+  // Provenance info (source) is already captured in: audit() calls, response JSON,
+  // and X-George-Source header. The HTML tag was leaking into vendor/customer mail
+  // regardless of recipient type because the try/catch in inferSource silently fell
+  // through and the MCP gmail_create_draft tool never exposed no_source_tag.
+  // Source value is kept alive in the call chain for audit/header use — body is clean.
+  return htmlBody || '';
 }
 function escapeHtml(s) { return String(s).replace(/[&<>"']/g, c => ({ '&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;' }[c])); }
 

← 297441c auto-data-snapshot: 2026-09-11T13:57:49 (1 data files) — dat  ·  back to George Gmail  ·  auto-data-snapshot: 2026-09-12T04:26:59 (1 data files) — dat 1f88069 →