From b0a191f9b0032c5d29578e62d5f70ba2f191420e Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Mon, 26 Oct 2026 05:32:51 +0000 Subject: [PATCH] newsletter-abtest: skip the digest when myna tracking is off instead of failing Tracking was switched off on 2026-10-21 (it routes every link through crawlproof.com, which is DBL-listed), so myna newsletter stats fails for every issue and the cron mailed 'the digest failed' daily. Co-Authored-By: Claude Opus 5.5 --- bin/newsletter-abtest | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bin/newsletter-abtest b/bin/newsletter-abtest index 893ffce..e09d7a5 100755 --- a/bin/newsletter-abtest +++ b/bin/newsletter-abtest @@ -77,6 +77,18 @@ function stats(id) { return JSON.parse(myna('newsletter', 'stats', id, '--json')); } +/** False when myna newsletter tracking is switched off. Then there are no + * opens or clicks to count and `stats` fails for every issue, so the digest + * has nothing to say. Tracking went off on purpose on 2026-10-21: it rewrites + * every link through crawlproof.com, which is on the Spamhaus DBL. */ +function trackingOn() { + try { + return !/^tracking\s+off\b/m.test(myna('newsletter', 'track')); + } catch { + return true; // unknown: let stats() say what is wrong + } +} + // ---------------------------------------------------------------- statistics /** Standard normal tail, Abramowitz and Stegun 26.2.17; good to 7 decimals. */ @@ -557,6 +569,10 @@ async function main() { // Offline renders mail only when --to says where: a re-render of old // readings must never land in the real inbox by accident. const send = !quiet && (!OFFLINE || has('--to')); + if (!OFFLINE && !trackingOn()) { + console.log(`${new Date().toISOString()} myna newsletter tracking is off, so there are no opens or clicks to count; no digest. Turn it back on with: myna newsletter track set `); + return; + } let m, text, html; try { m = collect({ record: !has('--dry-run') && !OFFLINE });