2020-09-26 16:18:02 +02:00
2020-09-26 16:18:02 +02:00
2020-09-26 11:17:53 +02:00
2020-09-26 16:18:02 +02:00
2020-09-26 16:18:02 +02:00

Postfix-Relay

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). For this to work, you will need to set up reverse DNS and SPF.

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

TODO 3wc: Can you run more than one instance of this on a swarm? How could we handle that in terms of reverse DNS?

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
  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/nextcloud.

Description
Simple SMTP server / postfix null relay host
https://github.com/bokysan/docker-postfix Readme 55 KiB