Skip to content

Guides

Reading business mail without an API

Date
Where
Praxys Solutions
Tags
#email#cloudflare#gmail

Praxys mail was being read in Zoho's browser because the free plan had no IMAP, no POP, and no API. The practical failure was that a session could expire and make a signed-out browser look exactly like a quiet inbox. A paid plan could have supplied IMAP, but we chose a forwarding and read-only integration instead.

The replacement stack

The replacement uses forwarding into a dedicated Gmail business mailbox and a read-only Gmail integration. Credentials are encrypted, and authorization happens without a deployed callback.

Gmail is scoped by a dedicated CRM label before any message list is read. Unlabeled mail is never read. The admin stores message metadata in the contact timeline, while bodies remain in Gmail and are fetched on demand. The read path does not send, draft, label, delete, or mark messages read.

What broke while we built it

The first sync shape let one bad message hold up a page. We changed it so a message without a usable id or date is counted as skipped and left unprojected, while the cursor still advances for the rest of the page. An expired cursor now restarts from recent mail, and a failed request leaves the cursor where it was.

The first reply-matching window also let unrelated mailbox traffic crowd out the sent message that anchored a reply. We split the sent and inbound windows, filtered out rows with no usable Message-ID or References before they consumed slots, and corrected the operator notes about older mail and skipped counts. The final path still uses bounded manual sweeps, and incremental history belongs to a later phase.

The label boundary was added after the initial read path so mail outside the business scope would not be imported. The implementation and tests document the replacement path and its fixes. The setup record explicitly says this phase had no deployment, so the sources prove the design and implementation work, not a recorded production cutover.