FengOffice

Mail, CRM, and Newsletter in one automated chain—folding content operations' infrastructure into a command-line and Docker stack.

Why

Marketing operations shouldn't be scattered across spreadsheets and manual work

Mail CLI

One command line—receive, read, and reply

Twenty CRM

One Docker stack, all customer relationships archived

Newsletter

Listmonk + Postgres, distributing content in one click

Automation Chain

Discover → reply → record → distribute

Deploy

A few commands, from zero to running

Marketing Operations, Not Scattered Across Spreadsheets

The real infrastructure of content operations is mail, customers, and distribution.

Many content-operation teams put their effort into content itself, yet let mail, customer relationships and newsletters scatter across spreadsheets and manual work. FengOffice folds these three into one automated chain: one CLI for mail, one Docker stack for CRM, and one newsletter system for distribution.

  • Where engineering delivery meets marketing operations: needs understood by marketers, solved the engineer's way.
  • Fully self-hosted: data stays in hand—customer data never goes to a third-party SaaS.
  • Scriptable: every repeated task becomes a command, executed by AI.

One CLI, All Your Mailboxes

fengmail.py—IMAP to receive, SMTP to reply, everything output as JSON.

Multiple mail accounts managed under one command line. Check mail, read bodies, send, reply—everything outputs JSON, ready for scripts and AI to consume directly.

  • Multi-account: seven accounts like Gmail and Outlook managed together, with OAuth config kept separate.
  • Proper threading: reply auto-extracts Message-ID and References, correctly chaining the email thread.
  • AI-friendly: structured JSON output that agents can filter, classify, draft, and send.
  • Classification system: four-tier mail classification (docs/email-classification.md), turning the inbox into a workflow.
IMAP SMTP OAuth JSON

Customer Relationships, One Docker Stack

Twenty CRM—self-hosted, data in hand.

  • One-command deploy: starts via docker-compose, reachable on local port 3002.
  • Full CRM features: contacts, companies, opportunities, activities—the full customer lifecycle archived.
  • Wired to mail: mail discovery → customer info → CRM record, completed automatically by the chain.
  • Documented requirements: docs/requirements.md records the CRM's functional needs and roadmap.
Twenty Docker Self-hosted

Content, Distributed At Once

Listmonk + Postgres—subscribe, unsubscribe, campaigns, all scripted.

  • Subscription management: add-subscriber / remove-subscriber scripts, called directly by AI.
  • Campaign sending: send-newsletter creates and sends a mail in one step.
  • Auto unsub handling: process-unsubscribes reads unsubscribe mail and syncs it.
  • Content hub: docs/newsletter-architecture.md defines the hub architecture of the newsletter and content.
Listmonk Postgres AI scripts

One Chain, Running by Itself

Mail discovery → reply → CRM record → newsletter distribution.

Each step's output feeds the next; the repeated labor is written into code once.

  • Discover: fengmail.py pulls incoming mail from multiple inboxes and filters out what actually needs attention, via the four-tier classification.
  • Reply: AI drafts, the CLI sends, and the reply keeps the correct thread structure.
  • Record: contact info flows into Twenty CRM, becoming a searchable asset.
  • Distribute: the newsletter system reaches subscribers, and unsubscribes are cleaned automatically.

From Zero to Running

A few commands, and the whole stack is local.

  • python fengmail.py list-accounts — list configured mail accounts
  • docker compose up -d — start Twenty CRM (localhost:3002)
  • docker compose up -d (newsletter folder) — start Listmonk + Postgres
  • python newsletter/scripts/send-newsletter.py — send a newsletter