Skip to content
Steve Soltys edited this page Jan 10, 2017 · 19 revisions

There are a few things you need to do in order to get Carrier up and running. They are documented below. Please note that this guide is meant for use with a Debian-based Linux distribution. This Wiki will be updated in the future to support more than one operating system.

1. Configure the database

Install PostgreSQL. Once it's running, create a database called carrier.

You'll need to change your login credentials to whatever they are configured to be in your PostgreSQL database configuration. You can make these changes in this file.

2. Configure Tomcat

Install Apache Tomcat. You'll need to allow binding to port 25 on startup. A solution for Debian-based distros can be found here.

Another option is binding to another port and using iptables to redirect the traffic:

# iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 25 -j REDIRECT --to-port 2525

3. Configure the application

Create a configuration directory. This application looks for configuration files in $HOME/.config/carrier. For one using Debian and Tomcat 7, this would be /home/tomcat7/.config/carrier.

Next, create a keystore within the configuration directory:

# keytool -genkey -keystore /home/tomcat7/.config/carrier/keystore -keyalg RSA

It is necessary to create and link a keystore to this application for STARTTLS support.

Now we need to create the configuration file:

# touch /home/tomcat7/.config/carrier/config.json

Take a look at the configuration guide and edit this file accordingly.

4. Configure DKIM

This section is optional, but also highly recommended if you plan on using your personal domain name. If you don't have a personal domain name or wish to use your actual IP address, you can skip this section.

Check out the separate guide for configuring DKIM.

5. Deploy the application

The final step is to deploy the project to your running Tomcat instance. Make sure you have Git and Gradle installed.

First, clone the git repository:

# git clone git@github.com:stevesoltys/carrier.git
# cd carrier

Now it's time to build the WAR file and copy it to Tomcat's webapps directory:

# gradle war
# cp build/libs/carrier-0.1.war /var/lib/tomcat7/webapps/carrier.war
# systemctl restart tomcat7
# tail -f /var/lib/tomcat7/logs/catalina.out -n99

6. Try it out

We're done! Let's create a masked address:

# curl -u username:password http://server.mydomain.com:8080/carrier/create\?address\=test@yourdomain.com\&destination\=john.doe@gmail.com

Where server.mydomain.com is the address of your Tomcat instance and username/password are the credentials of an account you created in the configuration file.

If everything worked out correctly, mail sent to test@yourdomain.com should now redirect to john.doe@gmail.com.