Fob
Browse the docs

Email

@finopsbricks/fob-email connects to any mailbox that speaks IMAP, and to SMTP for sending. One npm package gives you two ways in:

You want to…UseStart here
Find, read, download and file mail from a terminal, or let an AI agent do itThe CLI, fob-emailInstall the CLI
Read or send mail from your own scripts and workersThe library, import { fobEmail }Use the library

Both need the same thing first: your mailbox's IMAP server and an app password. Connect a mailbox walks you through it in about five minutes.

Beta

fob-email works with Gmail, Google Workspace, Yahoo, iCloud, Fastmail and other IMAP servers that accept a password. It does not work with Outlook.com or Microsoft 365, which require OAuth sign-in. See Beta limits.

Video coming soon
fob-email in 90 seconds

How it works#

fob-email runs on your machine, or in your worker, and talks directly to your mail provider over IMAP and SMTP. No FinOpsBricks server sits in between, and your mail and passwords are never sent to us.

  • Credentials live in ~/.fob/fob-email/config.yml (file mode 0600) for the CLI, or in the FOB_EMAIL_ACCOUNTS environment variable for workers and CI.
  • Reads are live. Every command asks your mail server directly, unless you opt into the local mirror with --cached.
  • Reading doesn't change anything. Opening a message with emails show does not mark it as read.

What you can do#

ResourceReadChange
emailsList a folder, search it, show a message, download its attachmentsMark read or unread, move, delete, send
threadsList conversations, show a whole conversation—
draftsList draftsCreate, replace, delete and send drafts
foldersList foldersCreate, rename and delete folders
syncShow what is mirrored locallyMirror folders into a local database, clear the mirror
config profilesList accountsAdd, switch, remove and re-check accounts

Every read has --json for scripts. The command reference lists every command and option.

Beta limits#

  • Password sign-in only. There is no OAuth, so Outlook.com, Hotmail, Microsoft 365, and Google Workspace domains that block app passwords cannot connect.
  • Search is IMAP search: keywords, sender, subject and date. There is no semantic search.
  • No paging. Lists return the newest messages up to --limit (default 50).
  • Message IDs belong to a folder. An ID from INBOX means nothing in another folder, and a message gets a new ID when it moves.
  • No replies or forwards with threading headers yet. drafts edit replaces the whole draft.
  • The local mirror is manual, stores headers and flags but not message bodies, and needs Node.js 22.13 or later.
  • Passwords are stored in a plain YAML file protected by file permissions, not in your system keychain.

Missing something? Open an issue on GitHub.

fob-email is not affiliated with or endorsed by Google, Yahoo, Apple, Fastmail or Microsoft. Product names are trademarks of their owners.