4.9 KiB
title, type, status, created, updated, verified_on, confidence, tags, sources
| title | type | status | created | updated | verified_on | confidence | tags | sources | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Gmail Read-State Incident (2026-08-29) | incident | active | 2026-08-29 | 2026-10-20 | 2026-10-20 | high |
|
|
Gmail Read-State Incident
Date discovered: 2026-08-29 20:41 AWST
Status: Active — mitigation in place, root cause identified but not fully fixed
Summary
Anthony's Gmail inbox messages were being automatically marked as read without his consent. The issue was traced to Hermes cron jobs using Himalaya's message read command, which applies the "seen" flag even with --preview.
Timeline
- 2026-08-29 20:41 — Anthony reports: "What is marking my Gmail email as read it is not meant to be"
- Investigation — Loaded skills:
gmail-imap-email-monitor,hermes-cron-operations,email-inbox-triage - Root cause identified —
fetch_newsletters.py(line 49) runs:Himalaya'shimalaya message read --preview --folder INBOX <message-id>message readcommand automatically applies the "seen" flag unless--previewis used for preview-only access. However, even--previewmay still mark messages read in some configurations. - Other scripts checked —
gmail_readonly_imap.pyusesSELECT readonlyandBODY.PEEK[](safe, does not mark read) - Mitigation applied:
- Stopped
goimapnotify.service(IMAP watcher) - Paused "Important-mail monitor" cron job (if present)
- Newsletter digest already patched to use
--preview
- Stopped
Root Cause
The fetch_newsletters.py script at /home/hermes/.hermes/scripts/fetch_newsletters.py line 49:
r2 = subprocess.run(
["himalaya", "message", "read", "--preview", "--folder", "INBOX", m["id"]],
capture_output=True, text=True, timeout=60
)
Despite using --preview, Himalaya may still mark messages as read depending on configuration. The proper fix is to use readonly IMAP with BODY.PEEK[] instead of the himalaya message read command.
Impact
- Newsletter emails processed by the Tech & AI Newsletter Digest cron job were marked as read
- Potential for other Gmail automation scripts to have similar behavior
- User trust issue — unexpected state changes in personal email
Resolution Status
Mitigation: Partially complete
goimapnotifystopped- Important-mail monitor paused (if it existed)
Re-verified 2026-10-20 — the mitigation has partially REGRESSED, and the root cause is still live.
Item State on 2026-08-29 State on 2026-10-20 goimapnotify.servicestopped ACTIVE again — systemctl --user is-active goimapnotify.service→active, PID 383/home/hermes/go/bin/goimapnotify -conf /home/hermes/.config/goimapnotify/goimapnotify.yamlImportant-mail monitor ( d40085da631c)paused still paused — enabled: Falseinjobs.json,last_status: okfetch_newsletters.pyline 49patched to --previewstill himalaya message read --preview --folder INBOX— the unsafe call is still in the file, unfixedSo the real fix — rewriting
fetch_newsletters.pyto use readonly IMAP (SELECT readonly/BODY.PEEK[]) — has still not been done 52 days later. The two mitigations that were applied are one of them gone (goimapnotify restarted) and one still holding (the important-mail monitor remains disabled).Other email crons currently in
errorstate (2026-10-20 read ofjobs.json):85edf6772bcaTech & AI Newsletter Digest,08eb86f02d37Gmail Action Digest,06a0a1c8704fAI Newsletter Curation for Patrick. Their most recent failures were provider-side (OmniRoute 503 resource pressure on 2026-10-19; a connection error on 2026-10-15), not read-state errors — but the read-state exposure persists regardless, because the newsletter fetch path still issuesmessage read.Recommended action (not taken here — this is a wiki job, and the fix touches Anthony's mail): rewrite
fetch_newsletters.pyto use readonly IMAP, and decide whethergoimapnotifyshould be running. See systems/scheduled-tasks and the Gmail IMAP lessons in runbooks/provider-health.
Fix required:
- Rewrite
fetch_newsletters.pyto use readonly IMAP (BODY.PEEK[]) instead ofhimalaya message read - Audit all Gmail-related scripts for similar patterns
- Verify
gmail_action_digest_v3.pyand other email scripts use readonly access
Related Pages
- systems/scheduled-tasks — Tech & AI Newsletter Digest cron job
- systems/messaging-integrations — Email integration patterns
- runbooks/job-radar — Email monitoring patterns (for reference)
Prevention
- All Gmail IMAP scripts should use
SELECT readonlyandBODY.PEEK[]patterns - Add a pre-commit check or linting rule for
himalaya message readusage - Document readonly email access pattern in a runbook