The open source mail server

A fully featured open source mail delivery platform for incoming & outgoing e-mail - postalhq/postal


Postal is a complete and fully featured mail server for use by websites & web servers. Think Sendgrid, Mailgun or Postmark but open source and ready for you to run on your own servers. Postal was developed by aTech Media to serve its own mail processing requirements and we have since decided that it should be released as an open source project for the community.

System Requirements

There are a couple of pre-reqs for running Postal. This page outlines how to quickly install the things needed on an Ubuntu 16.04 server.

Install Ruby

sudo apt install software-properties-common
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt update
sudo apt install ruby2.3 ruby2.3-dev build-essential

Install MySQL

sudo apt-key adv --recv-keys --keyserver hkp:// 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] xenial main'
sudo apt update
sudo apt install mariadb-server libmysqlclient-dev

Some additional configuration may be required to optimise your MySQL server. This is outside the scope of this documentation.

Install RabbitMQ

curl -sL | sudo apt-key add -
sudo add-apt-repository 'deb testing main'
sudo apt update
sudo apt install rabbitmq-server

Install Node.js

sudo apt install nodejs

Install Git

sudo apt install git


This is a list of features (in no real particular order) of things that Postal can do.

General features

  • Support for multiple organizations with mail servers & users within.
  • Graphs and stats showing volume of incoming & outgoing mail.
  • Access to view historical messages.
  • Access to view the full outgoing & incoming message queue.
  • Set up webhooks to receive live information about delivery information in realtime. Full access to the last 7 days of webhook requests are also stored for debugging purposes.
  • Built-in DNS checking & monitoring to ensure domains you send mail from are configured correctly for maximum deliverability.
  • Per server retention configuration to set how long messages should be kept in the database and the maximum size to keep on disk.
  • Complete logging so delivery issues can easily be identified.
  • Mail server wide search tools to find messages that need investigation.

Outgoing e-mails

  • Send messages to the SMTP server or using the HTTP API.
  • Manage multiple credentials per server.
  • Support for DKIM signing of outbound messages.
  • Enable development to hold messages in Postal without actually delivering them to recipients (message can be viewed in the Postal interface).
  • Built-in suppression list to avoid sending mail to recipients that don't exist or can't accept e-mail.
  • Click and open tracking to keep track of when recipients open your e-mails and click links within them.
  • Configure per-server send limits to avoid abuse on mail servers.
  • Management of multiple pools of sending IP addresses.
  • Configure different senders or recipients to have mail delivered from certain IP addresses.
  • Mail tagging so certain e-mails can be given a tag to allow them to be grouped when needed. For example, you may tag receipts or password-reset e-mails as such.

Incoming e-mails

  • Ability to forward incoming e-mail to HTTP endpoints.
  • Ability to forward incoming e-mail to other SMTP servers.
  • Ability to forward incoming e-mail to other e-mail addresses.
  • Spam & thread checking with SpamAssassin and ClamAV with configurable thresholds and different methods for dealing with spam messages.

Installation Instructions

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.

  1. Provision a new server running Ubuntu 16.04 LTS. This can be from any provider. We use Digital Ocean for testing.
  2. Login to your new server as root and run the following command to install Postal:
     curl | sh 
  3. Create a new user for you to login with:
     curl | sh 
  4. 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.
  5. 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.

  1. Change your MySQL & RabbitMQ passwords. By default they are set to p0stalpassw0rd and the MySQL root password is blank.
  2. 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.
  3. Set up your DNS appropriately, see the guide for full details.
  4. Configure spam & virus checking, see the guide for full details
  5. Configure click/open tracking, see the guide for full details.
  6. Configure Postal to start on boot