Jan 17, 2019

AHEM - Ad Hoc Email is a temporary disposable email service. Its public website provides a disposable email service for the domain @ahem.email.
You can send an email to any @ahem.email address and check the AHEM mailbox to retrieve and read the email.

But AHEM is also installable as an on premise server, serving your own domains.
Setting up AHEM as your own temporary email service is now ever easier with Docker.

The AHEM server image is available in the docker hub website. To pull the AHEM docker image run the following command:

docker pull o4oren/ahem

To run AHEM, you also need a Mongo DB server. If you do not have access to a mongo db server, or don't want to install and manage one, you can easily run one in a docker container. Follow the instructions on the mongodb docker hub page.

Create a configuration file named properties.json. Edit it to suit your preferences.

vim properties.json
The properties.json file should look something like this:
{
      "serverBaseUri": "http://[YOUR SERVER URL]:3000",
      "mongoConnectUrl": "mongodb://[YOUR MONGO DB ADDRESS]:27017/",
      "dbName": "ahem",
      "appListenPort": 3000,
      "smtpPort" : 25,
      "emailDeleteInterval" : 3600,
      "emailDeleteAge" : 86400,
      "allowAutocomplete" : true,
      "allowedDomains" : ["my.domain.com", "my.second.domain.com"],
      "jwtSecret": "AH3M 709 S3cR3T",
      "jwtExpiresIn": 3600,
      "maxAllowedApiCalls": 1000
      }

To run the docker image while mounting the properties file you created earlier, use the following command:

docker run -d -p 3000:3000 -v [FULL PATH TO properties.json]/properties.json:/app/properties.json o4oren/ahem