mailtrain/README.md

104 lines
5.3 KiB
Markdown
Raw Normal View History

2016-04-04 12:36:30 +00:00
# Mailtrain
[Mailtrain](http://mailtrain.org) is a self hosted newsletter application built on Node.js (v5+) and MySQL (v5.5+ or MariaDB).
2016-04-04 12:42:36 +00:00
![](http://mailtrain.org/mailtrain.png)
2016-05-08 14:31:44 +00:00
> **NB!** I'm running an IndieGoGo campaign to help fund developing first class automation support into Mailtrain. See all details here: [https://igg.me/at/mailtrain/8720095](https://igg.me/at/mailtrain/8720095)
2016-04-04 12:42:36 +00:00
## Features
Mailtrain supports subscriber list management, list segmentation, custom fields, email templates, large CSV list import files, etc.
2016-04-04 13:17:22 +00:00
Subscribe to Mailtrain Newsletter [here](http://mailtrain.org/subscription/EysIv8sAx) (uses Mailtrain obviously)
2016-04-04 12:42:36 +00:00
## Cons
2016-04-04 12:46:45 +00:00
* Alpha-grade software. Might or might not work as expected
* Awful code base, needs refactoring
* No tests
2016-04-28 19:47:53 +00:00
* Almost no documentation (there are some guides in the [Wiki](https://github.com/andris9/mailtrain/wiki))
2016-04-04 12:46:45 +00:00
## Requirements
* Nodejs v5+
* MySQL v5.5 or MariaDB
2016-04-28 19:47:53 +00:00
* Redis (optional, disabled by default, used only for session storage)
2016-04-04 12:42:36 +00:00
2016-04-04 12:36:30 +00:00
## Installation
2016-04-28 20:34:44 +00:00
### Automatic install (Ubuntu 14.04)
You can download and run [install.sh](setup/install.sh) in your blank Ubuntu 14.04 VPS to set up
Mailtrain and all required dependencies (including MySQL).
2016-04-28 20:37:36 +00:00
If you are using DigitalOcean then you can copy the contents of the [installation script](setup/install.sh) to the User Data textarea field when creating a new VPS (select Ubuntu 14.04 as the droplet Distribution image). After your droplet is created it should already have Mailtrain up and running. Navigate to http://droplet-hostname-or-ip/ and authenticate as `admin`:`test`. Do not forget to update your account information and set up SMTP settings.
2016-04-28 20:34:44 +00:00
### Manual (any OS that supports Node.js)
2016-04-28 19:47:53 +00:00
1. Download Mailtrain files using git: `git clone git://github.com/andris9/mailtrain.git` (or download [zipped repo](https://github.com/andris9/mailtrain/archive/master.zip)) and open Mailtrain folder `cd mailtrain`
2. Run `npm install --production` in the Mailtrain folder to install required dependencies
2016-04-19 09:05:13 +00:00
3. Copy [config/default.toml](config/default.toml) as `config/production.toml` and update MySQL and any other settings in it
4. Run the server `NODE_ENV=production npm start`
5. Open [http://localhost:3000/](http://localhost:3000/)
6. Authenticate as `admin`:`test`
7. Navigate to [http://localhost:3000/settings](http://localhost:3000/settings) and update service configuration
8. Navigate to [http://localhost:3000/users/account](http://localhost:3000/users/account) and update user information and password
2016-04-04 12:36:30 +00:00
2016-04-19 09:05:13 +00:00
## Upgrade
2016-04-28 19:47:53 +00:00
* Replace old files with new ones by running in the Mailtrain folder `git pull origin master` if you used Git to set Mailtrain up or just download [new files](https://github.com/andris9/mailtrain/archive/master.zip) and replace old ones with these
* Run `npm install --production` in the Mailtrain folder
2016-04-19 09:05:13 +00:00
2016-04-11 03:26:20 +00:00
## 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](https://github.com/lorenwest/node-config) for configuration management and thus the config files are loaded in the following order:
1. default.toml
2. {NODE_ENV}.toml (eg. development.toml or production.toml)
3. local.js
2016-04-04 12:36:30 +00:00
### Running behind Nginx proxy
Edit [mailtrain.nginx](setup/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](setup/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:
<a href="https://www.nitrous.io/quickstart">
<img src="https://nitrous-image-icons.s3.amazonaws.com/quickstart.png" alt="Nitrous Quickstart" width=142 height=34>
</a>
In the IDE, start Mailtrain via `Run > Start Mailtrain` and access your site via `Preview > 3000`.
2016-04-04 12:36:30 +00:00
## 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
2016-04-26 14:51:29 +00:00
* **SparkPost** use `http://domain/webhooks/sparkpost` as the webhook URL for bounces and complaints ([instructions](https://github.com/andris9/mailtrain/wiki/Setting-up-Webhooks-for-SparkPost))
* **SendGrid** use `http://domain/webhooks/sendgrid` as the webhook URL for bounces and complaints ([instructions](https://github.com/andris9/mailtrain/wiki/Setting-up-Webhooks-for-SendGrid))
* **Mailgun** use `http://domain/webhooks/mailgun` as the webhook URL for bounces and complaints ([instructions](https://github.com/andris9/mailtrain/wiki/Setting-up-Webhooks-for-Mailgun))
2016-04-04 12:36:30 +00:00
2016-04-11 12:01:02 +00:00
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.
2016-04-04 12:36:30 +00:00
## License
**GPL-V3.0**