+0
Daily
5,752
stars
706
forks
111
watchers
426
prs
969
issues
2
releases
README
Mailtrain v2
Mailtrain is a self hosted newsletter application built on Node.js (v14+) and MySQL (v8+) or MariaDB (v10+).
This is version 2 of Mailtrain. It mostly implements all features of v1 and add some more. It is a complete rewrite, so you will have to install it from scratch.
If you are upgrading from Mailtrain v1, backup the DB and use it for Mailtrain v2. Mailtrain v2 should be able to upgrade the DB to the new schema.
!
Features
Subscriber lists management
List segmentation
Custom fields
Email templates (including MJML-based templates)
Custom reports
Automation (triggered and RSS campaigns)
Multiple users with granular user permissions and flexible sharing
Hierarchical namespaces for enterprise-level situations
Builtin Zone-MTA (https://github.com/zone-eu/zone-mta) for close-to-zero setup of mail delivery
Recommended minimal hardware Requirements
2 vCPU
4096 MB RAM
Quick Start
Preparation
Mailtrain creates three URL endpoints, which are referred to as "trusted", "sandbox" and "public". This allows Mailtrain
to guarantee security and avoid XSS attacks in the multi-user settings. The function of these three endpoints is as follows:
- trusted - This is the main endpoint for the UI that a logged-in user uses to manage lists, send campaigns, etc.
- sandbox - This is an endpoint not directly visible to a user. It is used to host WYSIWYG template editors.
- public - This is an endpoint for subscribers. It is used to host subscription management forms, files and archive.
The recommended deployment of Mailtrain would use 3 DNS entries that all points to the same IP address. For example as follows:
- lists.example.com - public endpoint (A record lists under example.com domain)
- mailtrain.example.com - trusted endpoint (CNAME record mailtrain under example.com domain that points to lists)
- sbox-mailtrain.example.com - sandbox endpoint (CNAME record sbox-mailtrain under example.com domain that points to lists)
Installation on fresh CentOS 7 or Ubuntu 18.04 LTS (public website secured by SSL)
This will setup a publicly accessible Mailtrain instance. All endpoints (trusted, sandbox, public) will provide both HTTP (on port 80)
and HTTPS (on port 443). The HTTP ports just issue HTTP redirect to their HTTPS counterparts.
The script below will also acquire a valid certificate from Let's Encrypt.
If you are hosting Mailtrain on AWS or some other cloud provider, make sure that before running the installation
script you allow inbound connection to ports 80 (HTTP) and 443 (HTTPS).
Note, that this will automatically accept the Let's Encrypt's Terms of Service.
Thus, by running this script below, you agree with the Let's Encrypt's Terms of Service (https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf).
1. Login as root. (I had some problems running npm as root on CentOS 7 on AWS. This seems to be fixed by the seemingly extraneous su within sudo.)
sudo su -
2. Install GIT
For Centos 7 type:
Top issues
#1372Mailtrain v3 - Development30 comments · 2024-03-16#1373Maltrain v3 - Feature Requests21 comments · 2024-03-16#1384Not-operational, abandoned4 comments · 2025-02-14#1386webpack 5.98.0 error when compiled2 comments · 2025-05-16#1394Feature request: Add Werkmail bounce/complaint webhook support0 comments · 2026-08-25#1391Subscribe API is lowercasing all variables (even though only timezone should be lowercased)0 comments · 2026-03-29#1389Security: SSRF via Unauthenticated AWS SNS Webhook Endpoint (CWE-918)0 comments · 2026-02-22#1387self-hosted mailtrain error: nc: getaddrinfo: Name does not resolve0 comments · 2025-10-17