Skip to content

Gmail IMAP AUTHENTICATIONFAILED — root cause not found, switched to POP3

Section titled “Gmail IMAP AUTHENTICATIONFAILED — root cause not found, switched to POP3”

Trigger: Medium-digest email-fetch script (imaplib.IMAP4_SSL) consistently got AUTHENTICATIONFAILED on Gmail IMAP login, despite a valid App Password that worked fine for SMTP on the same account/machine. ~5 rounds spent theorizing (stale password, transient block, regenerate password) — full diagnostic detail was in the now-deleted Ideas-Workflow-P4-multi-format-intake.md archive copy and the diagnostic brief itself.

Ruled out: password typo/formatting, stale/dead password (2 fresh App Passwords tested, both rejected), WSL/network environment difference, rate-limiting, IMAP-disabled-via-toggle (no such toggle exists in this account’s Settings UI).

Second opinion (Gemini): answered confidently on first try with a plausible-sounding but unverified “why” (invented-sounding policy/terminology, no citations) and proposed OAuth2 — not what actually fixed it. Its real value was prompting a switch to trying a different protocol entirely, not the specific diagnosis being correct.

Fix: switched from IMAP to POP3 — worked immediately, no further IMAP root-cause investigation needed.

Lesson (promoted to ~/ai-config/AGENTS.md circuit-breaker rule): after ~4 failed fix attempts on the same axis, change axis — try a different protocol/tool, not another variant of the same theory. A Gmail MCP connector was tried once early, hit an expired token, and wasn’t revisited as an option — a missed axis-2 move worth remembering next time Gmail auth breaks.

Disposition: archived diagnostic-brief task file deleted after this log was written — full repro/ruled-out detail preserved in git history on Core/Processes/Projects/Ideas-Workflow/Tasks/archive/2026-07-18_gemini-imap-diagnostic-brief.md.