npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mailhook-cli

v1.0.1

Published

📫 Mailhook.app CLI tool - A simple SMTP server that forwards your emails to your webhook.

Downloads

2

Readme

Mailhook CLI

After running mailhook.app as a SaaS for 4.5 wonderful years, I've decided to make this simplified version available for free. This CLI tool provides the core functionality of Mailhook: receiving emails and forwarding them to webhooks.

Features

  • 📨 SMTP Server for receiving emails
  • 🔄 Forward emails to webhook endpoints
  • 📎 Support for email attachments (via S3)
  • ⚡️ Easy configuration with JSON
  • 🔒 Secure and reliable email processing

Installation

npm install -g mailhook-cli

Quick Start

  1. Create a configuration file:
# Create config.json in your project directory
{
  "mailhook": [
    {
      "email": "[email protected]",
      "webhook": "https://api.example.com/webhook",
      "method": "POST", # Optional, defaults to POST
      "forwardAttachments": true
    }
  ]
}
  1. If using attachments, configure AWS (optional):
# .env file
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret
AWS_REGION=your_region
AWS_BUCKET_NAME=your_bucket
  1. Start the server:
mailhook

Configuration Options

Email Hook Configuration

Each hook in the mailhook array supports:

| Field | Type | Required | Description | |-------|------|----------|-------------| | email | string | Yes | Email address to receive mail | | webhook | string | Yes | Endpoint to forward emails | | method | string | No | HTTP method (GET/POST, defaults to POST) | | forwardAttachments | boolean | No | Enable S3 attachment forwarding |

Environment Variables

| Variable | Required | Description | |----------|----------|-------------| | SMTP_PORT | No | SMTP port (default: 25) | | AWS_* | If using attachments | AWS credentials for S3 |

Webhook Payload

Mailhook sends the following JSON payload to your webhook:

{
  "id": string,                // Unique identifier
  "received_at": string,       // ISO timestamp
  "from": string[],            // Sender email addresses
  "to": string[],              // Recipient email addresses
  "subject": string,           // Email subject
  "text": string,              // Plain text content
  "html": string | null,       // HTML content if available
  "attachments": [             // Only if forwardAttachments is true
    {
      "filename": string,
      "size": number,
      "contentType": string,
      "url": string            // S3 public URL
    }
  ]
}

Requirements

  • Node.js 14 or later
  • Available SMTP port (default: 25)
  • AWS account (only for attachment handling)

Common Use Cases

  • Receive notifications from services that only support email
  • Build email automation workflows
  • Test email-based features
  • Process incoming emails in your applications
  • Create email-to-webhook bridges

Development

# Clone the repository
git clone https://github.com/camtosh/mailhook-cli

# Install dependencies
npm install

# Run in development mode
npm run dev

# Build
npm run build

Troubleshooting

Common Issues

  1. Attachments not working
    • Verify AWS credentials
    • Ensure S3 bucket has proper permissions
    • Check forwardAttachments is enabled

Future Improvements

  • [ ] Email filtering options
  • [ ] Email validation rules
  • [ ] Custom HTTP headers support
  • [ ] Retry mechanisms for failed webhooks

License

This project is licensed for personal and non-commercial use only. Commercial use requires explicit permission. See LICENSE for details.

For commercial licensing: [email protected]

Support

  • Create an issue for bug reports
  • For security concerns, email directly
  • Commercial support available upon request

Acknowledgements

Thank you to all Mailhook customers who supported this project. This open-source version is dedicated to you.


Made with ❤️ by Camille Toche