Simple SMTP server / postfix null relay host https://github.com/bokysan/docker-postfix
This repository has been archived on 2021-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
3wc 6ff4b4958b
continuous-integration/drone/push Build is passing Details
Fix embarrassing mass-typo 😳
2020-12-31 23:02:27 +02:00
.drone.yml Fix settings, improve docs, add `networks` for Drone 2020-09-27 21:36:04 +02:00
.env.sample Fix embarrassing mass-typo 😳 2020-12-31 23:02:27 +02:00
.gitignore Initial commit 2020-09-26 11:17:53 +02:00
README.md Update README 2020-09-27 22:06:37 +02:00
compose.yml Don't need "mail" network 2020-10-29 19:51:19 +02:00

README.md

Postfix-Relay

Build Status

Centralised email delivery for all your compose-stacks apps using the boky/postfix outgoing-only mail image.

The basic idea is to run one instance of this on each swarm, and configure that swarm's apps to send all their email through it.

By default, this stack will try to deliver e-mail directly (i.e. looking up the recipient's mail server using MX records). NOTE: make sure that:

  • your Traefik server and host firewall are configured to allow port 587,
  • you have an MX record for your configured $DOMAIN pointing to this server,
  • you have an SPF record for $DOMAIN that includes mx or this server's IP
  • you have a reverse DNS (rDNS / PTR) record for this IP that matches $DOMAIN

(These requirements mean that you can only deploy one direct-delivery instance of this app per swarm host..)

Alternatively, you can easily route mail through a smarthost / relay host like Mailgun or Gandi -- see RELAYHOST and related parameters.

FIXME 3wc: Pass RELAYHOST etc. from .envrc to service

Basic usage

  1. Set up Docker Swarm and abra
  2. Deploy compose-stacks/traefik
  3. git clone https://git.autonomic.zone/compose-stacks/postfix-relay.git && cd postfix-relay
  4. cp .envrc.sample .envrc
  5. Edit .envrc - be sure to change DOMAIN to something that resolves to your Docker swarm box, and add any extra domains (including subdomains) you'd like to be able to send mail from in EXTRA_SENDER_DOMAINS
  6. direnv allow (or . .envrc)
  7. abra deploy

Using this in other stacks

Add the other service to the (internal) mail network, and set whatever options the image supports for auto-configuring SMTP settings.

For reusable stacks, you probably want to put this configuration in a separate compose.mailrelay.yml file, e.g. the version in compose-stacks/wordpress.