@lmtlssss/caduceusmail
v3.7.0
Published
Portable Microsoft 365 plus Cloudflare mail orchestration framework with skill bundle packaging for agent harnesses like Codex.
Maintainers
Readme
☤CaduceusMail 3.7.0
CaduceusMail is a portable Microsoft 365 plus Cloudflare mail operations framework built for agent harnesses. It packages the skill bundle, bootstrap tooling, DNS and transport automation, sender identity controls, and verification flows needed to make one mailbox behave like a full control plane.
Version 3.7.0 separates publishable framework code from machine-local identity state. The repo now ships safe generic defaults, while live mailbox branding, personal names, footer data, and domain maps live in a local override file outside git.
What ships
The repo now includes:
- a root
SKILL.mdbundle that can be installed into agent harnesses - a generic sender identity rules template
- Microsoft 365 and Cloudflare bootstrap + doctor tooling
- Exchange, Graph, DNS, and DKIM orchestration scripts
- a small npm package wrapper for skill installation and profile scaffolding
- credential templates, examples, docs, and regression tests
Two surfaces
Use the project in two clean layers:
- Publishable framework The tracked repo, npm package, docs, templates, and skill bundle stay generic and safe to ship publicly.
- Machine-local operations profile
Names, domains, footer details, and live mailbox inventory belong in
~/.caduceusmail/sender_identity_rules.local.jsonor another file pointed to byCADUCEUSMAIL_SENDER_IDENTITY_RULES_PATH.
That split keeps public releases reusable while preserving a tuned live operator profile on a specific machine.
npm and skill install
Global install:
npm install -g @lmtlssss/caduceusmailInitialize a local sender identity profile:
caduceusmail init-profileInstall the packaged skill into Codex:
caduceusmail install-skill --harness codex --forceYou can also print the installed package root for custom harness wiring:
caduceusmail skill-pathLocal identity customization
The tracked rules file at scripts/sender_identity_rules.json is a generic template.
Customize your live sender behavior in:
~/.caduceusmail/sender_identity_rules.local.jsonThe runtime resolves sender identity rules in this order:
CADUCEUSMAIL_SENDER_IDENTITY_RULES_PATH~/.caduceusmail/sender_identity_rules.local.json~/.config/caduceusmail/sender_identity_rules.local.json- bundled
scripts/sender_identity_rules.json
That means the public package stays generic while your live machine can keep exact brand maps, reply names, footer blocks, and mailbox inventory.
Credentials and bootstrap
Copy the credential templates, fill them in locally, then run the wrapper:
cp credentials/entra.txt.template credentials/entra.txt
cp credentials/cloudflare.txt.template credentials/cloudflare.txt
bash ./scripts/caduceusmail.sh \
--organization-domain "example.com" \
--mailbox "[email protected]" \
--bootstrap-auth-mode deviceFor headless daily operations after the trust ceremony:
bash ./scripts/caduceusmail.sh \
--organization-domain "example.com" \
--mailbox "[email protected]" \
--skip-m365-bootstrapPersistence is opt-in. The wrapper does not write secrets to disk unless you explicitly ask it to.
Doctor
Use the doctor to check runtime readiness:
python3 ./scripts/caduceusmail-doctor.py --jsonOr through the npm bin:
caduceusmail doctor --jsonIt reports:
- required binaries
- credentials file presence and key coverage
- headless readiness
- skill frontmatter safety
- recommended bootstrap mode for the current host
Deliverability model
CaduceusMail coordinates four planes together:
- Entra and Graph identity
- Exchange transport and accepted domains
- Cloudflare DNS for MX, SPF, DMARC, and DKIM selectors
- sender identity + footer rendering through the local profile
New lane verification and send preflight now include DKIM, so subdomains are not treated as ready on MX/SPF/DMARC alone.
Agent harness notes
The bundle is shaped for skill-based agent runtimes:
- Codex can load the copied skill folder under
~/.codex/skills/caduceusmail - OpenClaw can load the root
SKILL.mddirectly and inject env throughskills.entries.<skill>.env - other harnesses can copy the same packaged bundle to any custom skill path
See:
docs/openclaw.mddocs/codex.mdexamples/openclaw.config.json5
Security
Do not track:
- live credentials
- local sender identity override files
- mailbox inventory snapshots
- generated intel artifacts
The repo intentionally keeps credential templates in git and real secrets out of git.
Testing
Smoke test:
bash ./scripts/caduceusmail-sandbox-smoke.shFull test suite:
PYTHONPATH=src python3 -m pytest -qnpm payload dry run:
npm pack --dry-runPublishing
The repo now includes .github/workflows/npm-publish.yml for push-driven GitHub-to-npm publishing from main. It expects an NPM_TOKEN repository secret, runs the test/package checks on each push, and only publishes when the package.json version is not already present on npm.
License
MIT.
