ScriptsApr 24, 2026·3 min read

Mailtrain — Self-Hosted Newsletter and Mailing List Manager

Run your own email newsletter platform with list management, template editing, automation, and detailed analytics — all without per-subscriber fees.

Introduction

Mailtrain is a self-hosted newsletter application that removes the recurring per-subscriber cost of SaaS email platforms. Built on Node.js and MySQL, it handles list management, campaign creation, and delivery analytics entirely on your own infrastructure.

What Mailtrain Does

  • Manages multiple subscriber lists with custom fields and segments
  • Creates and sends campaigns using a drag-and-drop or code-based template editor
  • Tracks opens, clicks, bounces, and unsubscribes with built-in analytics
  • Supports RSS-to-email campaigns that auto-send when new content is published
  • Provides automation workflows for triggered and drip email sequences

Architecture Overview

Mailtrain v2 is a Node.js application backed by MySQL or MariaDB. It connects to any SMTP relay (Postfix, Amazon SES, Mailgun) for actual delivery. A built-in job queue handles campaign sending in batches to respect rate limits. The frontend uses React for the campaign editor and list management views.

Self-Hosting & Configuration

  • Requires Node.js 14+, MySQL 8+ or MariaDB 10+, and an SMTP relay
  • Docker images are available for quick deployment with docker-compose
  • Configure SMTP credentials, sending rate, and bounce handling in the TOML config file
  • Set up DKIM, SPF, and DMARC on your sending domain for best deliverability
  • Use the built-in zone editor to manage multiple sending domains

Key Features

  • Unlimited subscribers and sends with no SaaS pricing tiers
  • Visual template editor with merge tags and conditional content blocks
  • Automation workflows for welcome series, drip campaigns, and triggers
  • Import and export subscribers via CSV with field mapping
  • GPG encryption option for subscriber-facing emails

Comparison with Similar Tools

  • Listmonk — Go-based alternative, simpler but fewer automation features
  • Mautic — full marketing automation suite, heavier to operate
  • Postal — focused on transactional email, less newsletter-oriented
  • Sendy — inexpensive one-time license, ties you to Amazon SES
  • Mailchimp — SaaS with polished UX but escalating per-subscriber costs

FAQ

Q: Which SMTP providers work with Mailtrain? A: Any standard SMTP relay including Postfix, Amazon SES, Mailgun, SendGrid, and self-hosted options.

Q: How does Mailtrain handle bounces? A: It supports VERP and webhook-based bounce processing. Bounced addresses are automatically flagged or unsubscribed based on your policy.

Q: Can I migrate from Mailchimp? A: Yes. Export your Mailchimp list as CSV and import it into Mailtrain with field mapping. Templates can be copied as raw HTML.

Q: Is there an API for integrations? A: Mailtrain exposes a REST API for managing lists, subscribers, and campaigns programmatically.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets