/docker-opensmtpd-mta

Opensmtpd as a simple MTA

Primary LanguageShellMIT LicenseMIT

OpenSMTPD_logo docker-opensmtpd-mta

OpenSMTPD as a simple MTA to send emails

RSS commits build

In a Docker environment, OpenSMTPD is way more simple and lightweight than postfix, especially for MTA usage. Works great paired with docker-pluxml.

You can find out more about OpenSMTPD on the project's website.

Supported tags and respective Dockerfile links

Quick start

Pull the image and fire up a OpenSMTPD-mta container:

docker pull src386/docker-opensmtpd-mta
docker run -p 25:25 \
 -e MAILNAME=example.org \
 -d src386/docker-opensmtpd-mta:latest

Or, using docker-compose (recommended):

version: '3'
services:

  opensmtpd-mta:
    image:
      src386/docker-opensmtpd-mta:latest
    ports:
      - "127.0.0.1:25:25"
    environment:
      - MAILNAME=example.org

Then fire up a OpenSMTPD-mta container:

docker-compose up -d

Features

  • Currently based on alpine
  • TLS support, a 10y self-signed certificate is generated on startup if none is present

Development

git clone https://github.com/src386/docker-opensmtpd-mta
cd docker-opensmtpd-mta && docker build -t docker-opensmtpd-mta:latest

Or you may want to use the docker-compose.yml file:

git clone https://github.com/src386/docker-opensmtpd-mta
cd docker-opensmtpd-mta/5.6 && docker-compose build

Configuration

List of environment variables:

  • MAILNAME: (required) the fqdn that smtpd will use when talking to other servers.

FAQ

How do I use docker-opensmtpd-mta with docker-pluxml ?

Full docker-compose.yml example:

version: '3' services:

 pluxml:
   image:
     src386/docker-pluxml:5.6
   volumes:
     - /etc/localtime:/etc/localtime:ro
     - data:/var/www/html/data
   ports:
     - "80:80"
   environment:
     - PHP_SMTP_HOST=mta
     - PHP_SMTP_PORT=25
     - ENABLE_REMOTEIP=true
   restart:
     unless-stopped

 mta:
   image:
     src386/docker-opensmtpd-mta:latest
   environment:
       - MAILNAME=example.org
   volumes:
     - /etc/localtime:/etc/localtime:ro
   restart:
     unless-stopped

volumes:
  data:

Licensing

MIT. You can find full text of the license in the LICENSE file.