config | ||
lib | ||
public | ||
routes | ||
services | ||
setup | ||
test | ||
views | ||
.eslintrc.js | ||
.gitignore | ||
app.js | ||
Gruntfile.js | ||
index.js | ||
LICENSE | ||
meta.json | ||
nitrous-post-create.sh | ||
nitrous.json | ||
package.json | ||
README.md | ||
README.nitrous.md |
Mailtrain
Mailtrain is a self hosted newsletter application built on Node.js (v5+) and MySQL (v5.5+ or MariaDB).
Features
Mailtrain supports subscriber list management, list segmentation, custom fields, email templates, large CSV list import files, etc.
Subscribe to Mailtrain Newsletter here (uses Mailtrain obviously)
Cons
- Alpha-grade software. Might or might not work as expected
- Awful code base, needs refactoring
- No tests
- No documentation
Requirements
- Nodejs v5+
- MySQL v5.5 or MariaDB
- Redis (optional, used for session storage only)
Installation
- Download Mailtrain files using git:
git clone git://github.com/andris9/mailtrain.git
and open Mailtrain foldercd mailtrain
- Run
npm install
in the Mailtrain folder to install required dependencies - Copy config/default.toml as
config/production.toml
and update MySQL and any other settings in it - Run the server
NODE_ENV=production npm start
- Open http://localhost:3000/
- Authenticate as
admin
:test
- Navigate to http://localhost:3000/settings and update service configuration
- Navigate to http://localhost:3000/users/account and update user information and password
Upgrade
- Replace old files with new ones by running in the Mailtrain folder
git pull origin master
Using environment variables
Some servers expose custom port and hostname options through environment variables. To support these, create a new configuration file config/local.js
:
module.exports = {
www: {
port: process.env.OPENSHIFT_NODEJS_PORT,
host: process.env.OPENSHIFT_NODEJS_IP
}
};
Mailtrain uses node-config for configuration management and thus the config files are loaded in the following order:
- default.toml
- {NODE_ENV}.toml (eg. development.toml or production.toml)
- local.js
Running behind Nginx proxy
Edit mailtrain.nginx (update server_name
directive) and copy it to /etc/nginx/sites-enabled
Running as an Upstart service in Ubuntu 14.04
Edit mailtrain.conf (update application folder) and copy it to /etc/init
Nitrous Quickstart
You can quickly create a free development environment for this Mailtrain project in the cloud on www.nitrous.io:
![Nitrous Quickstart](https://nitrous-image-icons.s3.amazonaws.com/quickstart.png)
In the IDE, start Mailtrain via Run > Start Mailtrain
and access your site via Preview > 3000
.
Bounce handling
Mailtrain uses webhooks integration to detect bounces and spam complaints. Currently supported webhooks are:
- AWS SES – create a SNS topic for complaints and bounces and use
http://domain/webhooks/aws
as the subscriber URL for these topics - SparkPost – use
http://domain/webhooks/sparkpost
as the webhook URL for bounces and complaints - SendGrid – use
http://domain/webhooks/sendgrid
as the webhook URL for bounces and complaints - Mailgun – use
http://domain/webhooks/mailgun
as the webhook URL for bounces and complaints
Additionally Mailtrain (v1.1+) is able to use VERP-based bounce handling. This would require to have a compatible SMTP relay (the services mentioned above strip out or block VERP addresses in the SMTP envelope) and you also need to set up special MX DNS name that points to your Mailtrain installation server.
License
GPL-V3.0