inbd
v0.2.7-beta
Published
CLI tool to forward inbound email to webhooks
Downloads
82
Readme
inbd
Email In. Webhook Out. Fully Yours.
What is inbd?
inbd is a lightweight, open-source CLI tool that turns any email into a webhook.
Designed for developers who want full control over inbound email — without third-party providers, hidden fees, or complex dashboards. It's perfect for:
- Automating internal workflows
- Powering no-code tools and bots
- Building email-based APIs and integrations
- Replacing inbound services like Mailgun, SendGrid, or Postmark
Why inbd?
✅ Open-Source & Transparent — No hidden SaaS, vendor lock-in, or mystery fees
⚙️ Self-Hosted Freedom — Works on any server, locally or in production
📦 CLI-First — Easy to configure, extend, and deploy via the terminal
📬 Inbound Routing via Wildcards — Match email addresses using simple patterns
🧰 Minimal Setup — Install, configure, and forward in just a few commands
🔒 Private by Default — Your emails never leave your server
Installation
npm install -g inbdQuick Start
1. Deploy to your server
inbd deploy <user@your-server-ip>This installs inbd on your remote server, sets it up, and starts the SMTP listener.
2. Configure your domain and server address
inbd config set domain <support.yourdomain.com>
inbd config set server <your-server-ip>domainis the hostname where you'll receive emails (used in MX records)serveris the IP or hostname where yourinbdserver is running
3. Add DNS records
inbd config get dnsCopy the displayed MX and TXT records into your domain registrar (e.g. Cloudflare, GoDaddy).
4. Create a routing rule
inbd rule add support -e "*@support.yourdomain.com" -w "https://yourapp.com/webhook"Now all emails to addresses like [email protected] will be parsed and forwarded as JSON to your webhook.
Command Overview
Configuration
# Set values
inbd config set domain <support.yourdomain.com>
inbd config set server <your-server-ip>
# View current values
inbd config get domain
inbd config get server
inbd config get dns
inbd config get pathRules
# Add a new rule
inbd rule add <name> -e <pattern> -w <webhook>
# List all rules
inbd rule list
# Remove a rule by name
inbd rule remove <name>-e, --email: Email pattern using wildcards (*)-w, --webhook: URL to POST parsed email data to
Start Locally
inbd runRuns the SMTP server locally using your current config and rules.
Deploy to Production
inbd deploy <user@your-server-ip>Installs inbd and starts it remotely. Your server must be accessible via SSH.
Email Pattern Examples
inbd uses a simple wildcard pattern system for matching email addresses. The pattern must match your configured domain in DNS.
For example, if your DNS is configured for support.domain.com:
Valid patterns:
*@support.domain.com- matches all emails to support.domain.com[email protected]- matches only [email protected]support+*@support.domain.com- matches all emails to [email protected]
Invalid patterns:
*@other.domain.com- won't work because DNS is configured for support.domain.com*@*.domain.com- wildcards in domain part are not allowed[email protected]- different domain won't be routed to your server
Note: Only the * wildcard character can be used, and only in the local part (before @) of the email address.
Webhook Payload Format
When an email is received, it's POSTed to your webhook as:
{
"from": "[email protected]",
"to": "[email protected]",
"subject": "Email Subject",
"text": "Plain text content",
"html": "<strong>HTML content</strong>",
"attachments": [
{
"filename": "file.pdf",
"contentType": "application/pdf",
"content": "base64string...",
"size": 12345
}
]
}Local Development
- Clone and install:
git clone https://github.com/kzkr/inbd.git
cd inbd
npm install -g inbd- Configure your local setup:
# Set your domain
inbd config set domain support.yourdomain.com
# Set your server address
inbd config set server localhost
# Add a rule for testing
inbd rule add test -e "*@support.yourdomain.com" -w "http://localhost:3000/webhook"- Start the server:
inbd runNote: You'll need to run a separate web server (e.g., using Express.js) to handle the webhook requests at /webhook. This server should be set up independently to receive and process the forwarded emails.
License
MIT — do what you want. No tracking, no analytics, no strings attached.

