Quick Install - mobber007/postal GitHub Wiki

To get up and running quickly, you can follow these steps. You'll have a basic Postal installation ready to go in in less than 10 minutes.

Provision a new server running Ubuntu 16.04 LTS. This can be from any provider. We use Digital Ocean for testing.

Login to your new server as root and run the following command to install Postal:

curl https://raw.githubusercontent.com/mobber007/postal/master/script/install/ubuntu1604.sh | sh

Secure with Let's Encrypt

sudo add-apt-repository ppa:certbot/certbot

sudo apt-get update

sudo apt install python-certbot-nginx

sudo nano /etc/nginx/sites-available/default

... server_name example.com; ...

sudo nginx -t

sudo systemctl reload nginx

sudo certbot --nginx -d example.com

Set-up DNS properly

To work properly, you'll need to configure a number of DNS records for your Postal installation. Review the table below and create appropriate DNS records on your DNS server. You will need to enter the record names you choose in your postal.yml configuration file.

For this documentation we will assume you have allocated some IP addresses:

192.168.1.3 - IPv4 address for management, SMTP and other traffic 192.168.1.4 - IPv4 address for the "fast" web server (used for tracking) 2a00:1234:abcd:1::3 - IPv6 address for management, SMTP and other traffic 2a00:1234:abcd:1::4 - IPv6 address for the "fast" web server (used for tracking) We will assume that you want to set up everything on the mail.yourdomain.com domain.

A Records - you'll need these records for accessing the API, management interface & SMTP server.

mail.yourdomain.com. IN A 192.168.1.3 mail.yourdomain.com. IN AAAA 2a00:1234:abcd:1::3 SPF Record - you can configure a global SPF record for your mail server which means domains don't need to each individually reference your server IPs. This allows you to make changes in the future.

spf.mail.yourdomain.com. IN TXT "v=spf1 ip4:192.168.0.0/28 ip6:2a00:1234:abcd:1::/64 ~all" Return Path - the return path domain is the default domain that is used as the MAIL FROM for all messages sent through a mail server. You should add DNS records as below.

rp.mail.yourdomain.com. IN A 192.168.1.3 rp.mail.yourdomain.com. IN AAAA 2a00:1234:abcd:1::3 rp.mail.yourdomain.com. IN MX 10 mail.yourdomain.com rp.mail.yourdomain.com. IN TXT "v=spf1 a mx include:spf.mail.yourdomain.com ~all" In addition to these, you'll need to enter a DKIM record. This differs depending on your installation. When the installation is initialised a key will be generated automatically. You can see the appropriate value for this record by running postal default-dkim-record on the host.

postal._domainkey.rp.mail.yourdomain.com. IN TXT "postal default-dkim-record" Route domain - if you wish to receive incoming e-mail by sending messages directly to created routes in Postal, you'll need to configure a domain for this just to point to your MX servers.

routes.mail.yourdomain.com. IN MX 10 mx.mail.yourdomain.com Tracking domain - to configure click & link tracking you'll need to configure a domain that will be used in rewritten links. This will point to the second IP address on your host. The second IP is used to distinguish traffic which is aimed at the management web server and that destined for the tracking web server.

track.mail.yourdomain.com. IN A 192.168.0.4 track.mail.yourdomain.com. IN AAAA 2a00:1234:abcd:1::4 In your postal.yml you should have something like that looks like the below,.

dns: mx_records: - mail.yourdomain.com smtp_server_hostname: mail.yourdomain.com spf_include: spf.mail.yourdomain.com return_path: rp.mail.yourdomain.com route_domain: routes.mail.yourdomain.com track_domain: track.mail.yourdomain.com dkim_identifier: postal domain_verify_prefix: postal-verification custom_return_path_prefix: psrp

Create a new user for you to login with:

postal make-user

Access your Postal installation in a web browser. You'll start with an SSL warning because the certificate isn't valid but you can fix that later.

You should also be able to access the SMTP server on port 25.

Next steps Now your installation is active, there are a few things you can look at doing next.

Change your MySQL & RabbitMQ passwords. By default they are set to p0stalpassw0rd and the MySQL root password is blank.

Replace the self signed certificates in /etc/nginx/ssl/postal.cert with something proper. You can use something like CertBot to get you one for free through Let's Encrypt.

Set up your DNS appropriately, see the guide for full details.

Configure spam & virus checking, see the guide for full details

Configure click/open tracking, see the guide for full details.

Configure Postal to start on boot