Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

email-bridge

Read and reply to webmail from a persistent headful browser via CDP — with an OCR fallback for messages that render in opaque containers.

Built for a Discord-bridge assistant that needed to check a Zoho Mail inbox and send replies entirely through browser automation. Works against any webmail that exposes a standard message list + compose UI; the selectors here target the Zoho Mail layout.

Requirements

  • Node.js 18+ with playwright installed (npm i playwright)
  • A persistent Chromium with remote debugging on 127.0.0.1:9333 (start with chromium --remote-debugging-port=9333 --user-data-dir=<profile>)
  • tesseract + tesseract-data-eng on PATH for the OCR fallback

Usage

node email.mjs list [count]              # latest N inbox messages
node email.mjs read <n|"subject match">  # open a message, print its body
node email.mjs reply <n|"subject match"> "<body>"  # reply and send

The script connects to the always-on browser, drives the webmail tab (creating it if missing), lists rows, opens messages, and clicks through the compose UI to send replies. Message text is read from the DOM first; if the body renders inside opaque/split nodes, the pane is screenshotted and OCR'd with tesseract.

Notes

  • No credentials are stored in this repo — the browser profile holds the session.
  • The OCR fallback writes a temp screenshot to /tmp/opencode/zoho-email-ocr.png.
  • Keep this tool to your own accounts; automated replies to strangers are a quick way to get flagged as spam.

About

Read and reply to webmail from a persistent browser via CDP, with an OCR fallback for opaque message bodies

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages