Fix settings, improve docs, add `networks` for Drone
continuous-integration/drone/push Build is passing Details

This commit is contained in:
3wc 2020-09-27 21:36:04 +02:00
parent 68a609593e
commit 6e3c80487f
3 changed files with 18 additions and 10 deletions

View File

@ -10,6 +10,9 @@ steps:
purge: true
deploy_key:
from_secret: drone_ssh_swarm_test
networks:
- mail
- proxy
environment:
DOMAIN: swarm-test.autonomic.zone
STACK_NAME: postfix-relay

View File

@ -7,17 +7,22 @@ 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.
recipient's mail server using `MX` records).
**NOTE**: If you use this direct delivery, 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
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`]
@ -25,7 +30,8 @@ that in terms of reverse DNS?
3. `git clone https://git.autonomic.zone/compose-stacks/postfix-relay.git && cd postfix-relay`
3. `cp .envrc.sample .envrc`
4. Edit `.envrc` - be sure to change `DOMAIN` to something that resolves to
your Docker swarm box
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`.
5. `direnv allow` (or `. .envrc`)
6. `abra deploy`

View File

@ -16,10 +16,9 @@ services:
environment:
FORCE_COLOR: "1"
TZ: ${TZ}
INBOUND_DEBUGGING: "${INBOUND_DEBUGGING:-0}"
ALLOWED_SENDER_DOMAINS: "${EXTRA_SENDER_DOMAINS} ${DOMAIN}"
POSTFIX_myhostname: "${DOMAIN}"
MASQUERADED_DOMAINS: "${MASQUERADED_DOMAINS}"
INBOUND_DEBUGGING: ${INBOUND_DEBUGGING}
ALLOWED_SENDER_DOMAINS: ${DOMAIN} ${EXTRA_SENDER_DOMAINS}
POSTFIX_myhostname: ${DOMAIN}
deploy:
restart_policy:
condition: on-failure