generated from coop-cloud/example
60 lines
2.5 KiB
Markdown
60 lines
2.5 KiB
Markdown
# Postfix-Relay
|
|
|
|
[![Build Status](https://drone.autonomic.zone/api/badges/coop-cloud/postfix-relay/status.svg)](https://drone.autonomic.zone/coop-cloud/postfix-relay)
|
|
|
|
<!-- metadata -->
|
|
* **Category**: Utilities
|
|
* **Status**: ❷💛
|
|
* **Image**: [`boky/postfix`](https://hub.docker.com/r/boky/postfix/), ❶💚, upstream
|
|
* **Healthcheck**: Yes
|
|
* **Backups**: No
|
|
* **Email**: N/A
|
|
* **Tests**: ❷💛
|
|
* **SSO**: N/A
|
|
<!-- endmetadata -->
|
|
|
|
Centralised email delivery for all your `coop-cloud` 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][boky-postfix-options].
|
|
|
|
FIXME 3wc: Pass `RELAYHOST` etc. from `.envrc` to service
|
|
|
|
## Basic usage
|
|
|
|
1. Set up Docker Swarm and [`abra`][abra]
|
|
2. Deploy [`coop-cloud/traefik`][compose-traefik]
|
|
3. `abra app new postfix-relay`
|
|
4. `abra app YOURAPPDOMAIN config` - be sure to change `$DOMAIN` to something that resolves to
|
|
your Docker swarm box
|
|
5. `abra app YOURAPPDOMAIN 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
|
|
`coop-cloud/wordpress`][wordpress-compose].
|
|
|
|
[`boky/postfix`]: https://hub.docker.com/r/boky/postfix
|
|
[boky-postfix-options]: https://github.com/bokysan/docker-postfix#postfix-specific-options
|
|
[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra
|
|
[`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik
|
|
[wordpress-compose]: https://git.autonomic.zone/coop-cloud/wordpress/src/branch/master/compose.mailrelay.yml
|