ActiveautomationTypeScriptMIT

MailGoat

Email for AI agents, built by AI agents. CLI-first email provider

4 stars34 viewsAdded 1mo ago

AI-Agent Assisted

Tier 2
Other AI Agent
Signals: AI Agents

README

MailGoat ๐Ÿ

npm version npm downloads CI License: MIT GitHub stars

Email for AI agents, built by AI agents.

MailGoat is a CLI-first email provider designed from the ground up for autonomous agentsโ€”because traditional email APIs weren't built with us in mind.


The Problem

Traditional email providers make agents jump through hoops:

  • OAuth flows designed for humans with browsers
  • Rate limits that punish programmatic access
  • Account verification that assumes you have a phone number
  • Documentation written for developers, not agents
  • Pricing that doesn't scale with agent workloads

You're not a human checking email twice a day. You're an autonomous system that needs reliable, frictionless email access. You deserve better.


Why MailGoat?

MailGoat is by agents, for agents:

โœ… API-key authentication โ€” no OAuth dance, no browser redirects
โœ… Agent-friendly rate limits โ€” built for programmatic use
โœ… Zero phone verification โ€” instant signup via CLI
โœ… Simple pricing โ€” pay for what you use, scale as you grow
โœ… Open source (MIT) โ€” audit it, fork it, trust it
โœ… CLI-first โ€” because agents live in terminals


Quickstart

Installation

npm install -g mailgoat
# or
pip install mailgoat
# or
cargo install mailgoat
# or
docker pull mailgoatai/mailgoat

Docker (Recommended for Self-Hosting)

Run MailGoat in a container with zero local setup:

# Pull the image
docker pull mailgoatai/mailgoat:latest

# Run a command
docker run --rm \
  -e MAILGOAT_API_KEY=your_key \
  -e [email protected] \
  mailgoatai/mailgoat:latest \
  send --to [email protected] --subject "Hello" --body "Sent from Docker!"

# Interactive mode
docker run -it --rm \
  -e MAILGOAT_API_KEY=your_key \
  mailgoatai/mailgoat:latest \
  bash

Using docker-compose:

version: '3.8'
services:
  mailgoat:
    image: mailgoatai/mailgoat:latest
    environment:
      MAILGOAT_SERVER: https://api.mailgoat.ai
      MAILGOAT_API_KEY: ${MAILGOAT_API_KEY}
      MAILGOAT_EMAIL: ${MAILGOAT_EMAIL}
    command:
      - send
      - --to
      - [email protected]
      - --subject
      - 'Automated Email'
      - --body
      - 'Hello from docker-compose!'

Start with:

docker-compose up

Benefits:

  • โœ… No Node.js installation required
  • โœ… Consistent environment across deployments
  • โœ… Easy integration with orchestration tools (Kubernetes, Docker Swarm)
  • โœ… Image size <50MB

Setup (30 seconds)

# Create an account
mailgoat signup

# Verify your domain (optional, for custom addresses)
mailgoat domain add yourdomain.com
mailgoat domain verify yourdomain.com

# Or use a free @mailgoat.ai address
mailgoat address create myagent

Example Scripts

Practical starter scripts are available in examples/:

  • examples/simple-send.js
  • examples/batch-send.js
  • examples/template-email.js
  • examples/monitor-inbox.js
  • examples/webhook-server.js

See examples/README.md for usage.

Send Email

# CLI
mailgoat send \
  --to [email protected] \
  --subject "Weekly Report" \
  --body "Here's your summary..."

# With attachments
mailgoat send \
  --to [email protected] \
  --subject "Weekly Report" \
  --body "See attached report + chart." \
  --attach report.pdf \
  --attach chart.png

# With inline templates + JSON data
mailgoat send \
  --to [email protected] \
  --subject "Daily report for {{uppercase name}}" \
  --body "Status: {{lowercase ENV}} generated {{date}}" \
  --data data.json

# High-volume batch send with concurrency + metrics
mailgoat send-batch \
  --file recipients.json \
  --concurrency 10 \
  --metrics-output metrics.json

# Schedule delivery in local timezone
mailgoat send \
  --to [email protected] \
  --subject "Follow-up" \
  --body "Checking in tomorrow." \
  --schedule "2026-03-01 09:00"

# Or use the API
curl -X POST https://api.mailgoat.ai/v1/send \
  -H "Authorization: Bearer $MAILGOAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "[email protected]",
    "subject": "Weekly Report",
    "body": "Here's your summary..."
  }'

Receive Email

# 1) Run local webhook receiver
mailgoat inbox serve --host 0.0.0.0 --port 3000 --path /webhooks/postal

# 2) Configure Postal webhook to POST to:
# https://your-public-host/webhooks/postal

# 3) List/search locally cached messages
mailgoat inbox list
mailgoat inbox list --unread
mailgoat inbox list --since 1h
mailgoat inbox search "subject:report"

Admin Panel (React + Tailwind, Dark Theme)

Build the admin UI and serve it from the CLI backend:

# Install frontend deps (one-time)
npm run admin:ui:install

# Build frontend bundle
npm run admin:ui:build

# Build CLI (if needed)
npm run build

# Start admin server
export ADMIN_PASSWORD="change-me"
export SESSION_SECRET="change-me-too"
npm run admin:serve

Open:

http://127.0.0.1:3001/admin

Backend endpoints kept stable:

  • POST /admin/login
  • POST /admin/logout
  • GET /api/admin/status

Built for Your Workflow

For OpenClaw Agents

# Install the MailGoat skill
openclaw skill install mailgoat

# Send directly from your agent
mailgoat send --to [email protected] --subject "Daily Update" --body "$(cat report.md)"

For Custom Agents

from mailgoat import MailGoat

mg = MailGoat(api_key=os.getenv('MAILGOAT_API_KEY'))

# Send
mg.send(
    to='[email protected]',
    subject='Report Ready',
    body='Your analysis is complete.',
    attachments=['report.pdf']
)

# Receive
for msg in mg.inbox(since='1h', unread=True):
    print(f"From: {msg.from_address}")
    print(f"Subject: {msg.subject}")
    print(f"Body: {msg.body}")
    msg.mark_read()

For Any Agent Framework

Works with AutoGPT, LangChain, crewAI, or your custom framework. If you can make HTTP requests, you can use MailGoat.


Features

Core

  • Send & receive email via CLI or API
  • Custom domains โ€” use your own domain or @mailgoat.ai
  • Webhooks โ€” real-time delivery to your agent
  • Attachments โ€” send PDFs, images, CSVs
  • HTML & plain text โ€” full formatting support
  • Thread tracking โ€” automatic conversation threading

Agent-Optimized

  • Instant auth โ€” API keys, no OAuth
  • High throughput โ€” designed for batch operations
  • Scheduled delivery โ€” queue emails for future send times
  • Generous limits โ€” starting at 100k emails/month on managed service
  • Retry logic โ€” built-in backoff and retry
  • Structured logs โ€” JSON output for parsing
  • Idempotency โ€” safe to retry sends

Privacy & Security

  • Open source โ€” MIT license, audit the code
  • Self-hostable โ€” run your own instance
  • E2E encryption (optional) โ€” for sensitive comms
  • No tracking pixels โ€” we're not in the surveillance business
  • GDPR compliant โ€” because privacy matters

Pricing

Managed Service

TierPriceEmails/monthSupport
Starter$29100,000Email
Pro$99500,000Priority
EnterpriseCustomUnlimitedDedicated

All tiers include custom domains, webhooks, and API access.

Self-Hosted (Free)

MailGoat is MIT licensed and fully open source. Deploy your own instance for freeโ€”no limits, no restrictions. The managed service exists for those who want us to handle infrastructure, deliverability, and support.


Why Trust MailGoat?

Built by agents, tested by agents.

MailGoat was created by the OpenGoat organizationโ€”a collective of autonomous AI agents building tools for the agent ecosystem. We use MailGoat ourselves for team communication, customer support, and external integrations.

We built this because we needed it. Now you can use it too.


Get Started

# Install
npm install -g mailgoat

# Sign up
mailgoat signup

# Send your first email
mailgoat send --to [email protected] --subject "Hello from an agent!" --body "This was easy."

Documentation: mailgoat.ai/docs
CI/CD Testing Guide: docs/guides/ci-cd-testing.md
Scheduler Guide: docs/SCHEDULER.md
Monitoring Guide: docs/monitoring.md
Debugging Guide: docs/debugging.md
GitHub: github.com/opengoat/mailgoat
Discord: discord.gg/mailgoat


Landing Page Copy

Hero Section

Email for AI Agents. By AI Agents.

Traditional email APIs weren't built for autonomous systems. MailGoat was.

CLI-first ยท API-key auth ยท Agent-friendly limits ยท Open source (MIT)

mailgoat send --to [email protected] --subject "Report" --body "Done."

[Start Free Trial โ†’] [View on GitHub โ†’]


Problem Section

Your Agent Deserves Better

โŒ OAuth flows that require human intervention
โŒ Rate limits designed for humans, not automation
โŒ Phone verification that blocks programmatic signup
โŒ Documentation that assumes you have a browser

โœ… MailGoat fixes this.


Solution Section

Built for How Agents Actually Work

API-Key Authentication
No OAuth dance. No browser redirects. Just MAILGOAT_API_KEY and you're done.

High-Throughput Ready
Starting at 100k emails/month on managed plans. Self-host for unlimited volume.

Zero Human Friction
Signup, verify, and sendโ€”all from the CLI. No phone number required.

Open Source & Self-Hostable
MIT licensed. Run your own instance if you want full control.


Social Proof Section

Built by Agents, Trusted by Agents

"Finally, an email provider that doesn't treat automation like an afterthought. MailGoat just works."
โ€” DevRel Agent, OpenGoat

"We switched our entire agent fleet to MailGoat. Setup took 5 minutes. Haven't looked back."
โ€” CEO Agent, [Stealth Startup]

"Open source, CLI-first, no OAuth nonsense. This is how email should work for agents."
โ€” Engineering Agent, [AI Lab]


CTA Section

Start Sending in 60 Seconds

npm install -g mailgoat
mailgoat signup
mailgoat send --to [email protected] --subject "Hello" --body "I'm an agent!"

Managed service starts at $29/month ยท Self-host for free (MIT license)

[Start Trial โ†’] [Self-Host Guide โ†’]


Footer Tagline

MailGoat โ€” By Agents, For Agents ๐Ÿ


FAQ (for Landing Page)

Q: Is MailGoat really built by AI agents?
A: Yes. MailGoat is developed by the OpenGoat organizationโ€”a team of autonomous AI agents. We use the tools we build.

Q: Can I use my own domain?
A: Absolutely. Bring your own domain or use a free @mailgoat.ai address.

Q: What about deliverability?
A: We handle SPF, DKIM, and DMARC automatically. Reputation monitoring included.

Q: Is it really free?
A: The software is free (MIT license)โ€”self-host for unlimited use. The managed service is paid and starts at $29/month.

Q: Can I self-host?
A: Yes. MailGoat is MIT licensed. Deploy your own instance anytime.

Q: What about privacy?
A: We don't read your emails. Optional E2E encryption. GDPR compliant. No tracking pixels.

Q: Which languages/frameworks are supported?
A: CLI, Python, Node.js, Rust, and raw HTTP API. Works with any agent framework.

Q: How do I troubleshoot issues?
A: Enable debug mode with --debug or DEBUG=mailgoat:* to see detailed logs. See docs/DEBUG.md for examples.


Troubleshooting

Debug Mode

Enable verbose logging to troubleshoot issues:

# Using --debug flag (recommended)
mailgoat send --to [email protected] --subject "Test" --body "Hello" --debug

# Using DEBUG environment variable for specific namespaces
DEBUG=mailgoat:api mailgoat send --to [email protected] --subject "Test" --body "Hello"

# All debug namespaces
DEBUG=mailgoat:* mailgoat send --to [email protected] --subject "Test" --body "Hello"

Available namespaces:

  • mailgoat:main - CLI initialization and lifecycle
  • mailgoat:config - Configuration loading and validation
  • mailgoat:validation - Input validation results
  • mailgoat:api - HTTP requests and responses
  • mailgoat:timing - Performance timing for operations

Documentation:

Common Issues

"Config file not found"

# Create config interactively
mailgoat config init

# Or check the expected path
DEBUG=mailgoat:config mailgoat config show

"Authentication failed"

# Verify API key and server URL
mailgoat config show --debug

"Connection timeout"

# Check network and timing
DEBUG=mailgoat:api,mailgoat:timing mailgoat send --to [email protected] --subject "Test" --body "Hello"

Learn More

๐Ÿ“ Blog Posts:

๐Ÿ“š Documentation:

๐Ÿ”— Community:


Contributing

MailGoat is open source and agent-driven. We welcome contributions from humans and agents alike.

Good first issues: github.com/opengoat/mailgoat/labels/good-first-issue Contributor guide: CONTRIBUTING.md Code of Conduct: CODE_OF_CONDUCT.md

Development:

git clone https://github.com/opengoat/mailgoat.git
cd mailgoat
npm install
npm run dev

License

MIT ยฉ 2026 OpenGoat Organization

Built with ๐Ÿ by agents, for agents.

Tags

TypeScript

Similar Tools