explaingit

mailtrain-org/mailtrain

5,729JavaScriptAudience · ops devopsComplexity · 3/5LicenseSetup · moderate

TLDR

Mailtrain is a self-hosted newsletter tool you run on your own server to manage subscriber lists and send email campaigns without paying a third-party service, though this v1 is officially deprecated with known unfixed security flaws.

Mindmap

mindmap
  root((repo))
    What it does
      Manage subscriber lists
      Send email campaigns
      Segment audiences
      Import from CSV
    Tech stack
      Node.js backend
      MySQL or MariaDB
      Docker setup
      Web browser UI
    Setup options
      Docker one-command
      Manual Node.js install
      1 CPU and 1 GB RAM
    Status
      Version 1 deprecated
      Known security flaws
      Upgrade to v2 branch
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Run a self-hosted newsletter for a community or blog without paying for Mailchimp or SendGrid

USE CASE 2

Import an existing subscriber list from a CSV file and send a campaign through your own mail server

USE CASE 3

Set up segmented email lists to send different content to different groups of subscribers

USE CASE 4

Prototype a newsletter setup locally using Docker before deciding whether to upgrade to Mailtrain v2

Tech stack

JavaScriptNode.jsMySQLMariaDBDocker

Getting it running

Difficulty · moderate Time to first run · 1h+

Version 1 has known unfixed security vulnerabilities, the maintainers recommend using the v2 branch instead.

Released under the GPL v3.0 license, free to use and modify, but any changes you distribute must also be released under the same license.

In plain English

Mailtrain is a self-hosted newsletter application, meaning you run it on your own server rather than paying for a third-party email marketing service. It is built with Node.js and uses a MySQL or MariaDB database to store subscriber data and campaign information. The core features include managing lists of subscribers, dividing those lists into segments based on custom criteria, defining custom data fields for subscribers, creating and managing email templates, and importing large subscriber lists from CSV files. Once set up, you can send newsletters to your list through your own email infrastructure. You can install Mailtrain using Docker (which handles all the dependencies automatically) or by running it manually on any machine that has Node.js installed. The Docker setup involves a few commands to clone the repository, copy a configuration template, and start the service. After it starts, you access it through a web browser at a local address and log in with default credentials that you are expected to change immediately. The hardware requirements are modest: a single CPU core and 1 GB of RAM is enough to run it. It is important to know that version 1 of Mailtrain, which this repository contains, has been officially deprecated. The maintainers note that it has security flaws that are unlikely to be fixed, and they recommend switching to Mailtrain version 2, which is available on a separate branch of the same repository. Version 1 is covered under a GPL-V3.0 license for recent releases.

Copy-paste prompts

Prompt 1
Help me set up Mailtrain v1 using Docker on a Linux VPS, configure it to send through my SMTP server, and import a CSV list of subscribers to send a test campaign.
Prompt 2
I'm running Mailtrain v1 and need to migrate to v2 on the same server. Walk me through backing up my MySQL subscriber data and pointing the v2 branch at the same database.
Prompt 3
Show me how to add a custom subscriber field in Mailtrain's MySQL schema and expose it in the campaign template as a merge tag for personalization.
Prompt 4
Help me write a script that uses Mailtrain's API to add subscribers from a Google Sheets export and tag them by the column values in the sheet.
Open on GitHub → Explain another repo

← mailtrain-org on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.