~dricottone/container-images

e93c6cce73108c60776f773d52168f6aed9cf008 — Dominic Ricottone 1 year, 6 months ago a7203db
Adding recipient_canonical maps to Postfix
5 files changed, 12 insertions(+), 1 deletions(-)

M postfix/README.md
M postfix/entrypoint.sh
M postfix/main.cf
M postfix/main.cf.tls-in
M postfix/main.cf.tls-out
M postfix/README.md => postfix/README.md +8 -1
@@ 21,7 21,7 @@ make image
Can be used with any container manager toolchain.

Create a `generic(5)` file in `$genericfile`.
Mail with recipient addresses matching the patterns will be rewritten.
Addresses matching the patterns will be rewritten.
It must also be owned (on the host system) by the user that will create the
container (i.e. `root` for conventional `docker(1)` deployments).
It should like like:


@@ 31,6 31,12 @@ root@localhost example@gmail.com
@localhost     example@gmail.com
```

If instead an address should only be rewritten when it is a recipient address,
create a `canonical(5)` file in `$canonicalfile`.
It should look the same way.
It must also be owned (on the host system) by the user that will create the
container (i.e. `root` for conventional `docker(1)` deployments).

Create a `transport(5)` file in `$transportfile`.
Mail is routed based on which pattern the recipient address matches.
It must also be owned (on the host system) by the user that will create the


@@ 70,6 76,7 @@ Try:
```
$conman run --detach --name postfix --restart always \
  --mount type=bind,src=$genericfile,dst=/etc/postfix/generic,readonly \
  --mount type=bind,src=$canonicalfile,dst=/etc/postfix/recipient_canonical,readonly \
  --mount type=bind,src=$transportfile,dst=/etc/postfix/transport,readonly \
  --mount type=bind,src=$saslfile,dst=/etc/postfix/sasl/sasl_passwd,readonly \
  --mount type=bind,src=$sasldb,dst=/etc/sasl2/sasldb2,readonly \

M postfix/entrypoint.sh => postfix/entrypoint.sh +1 -0
@@ 2,6 2,7 @@
newaliases
postmap /etc/postfix/transport
postmap /etc/postfix/generic
postmap /etc/postfix/recipient_canonical
postmap /etc/postfix/sasl/sasl_passwd

sed -i /etc/postfix/main.cf -e "s/^mydomain.*/mydomain = ${DOMAIN}/"

M postfix/main.cf => postfix/main.cf +1 -0
@@ 18,6 18,7 @@ smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)

# Address rewriting
smtp_generic_maps = lmdb:/etc/postfix/generic
recipient_canonical_maps = lmdb:/etc/postfix/recipient_canonical

# Transport map
transport_maps = lmdb:/etc/postfix/transport

M postfix/main.cf.tls-in => postfix/main.cf.tls-in +1 -0
@@ 18,6 18,7 @@ smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)

# Address rewriting
smtp_generic_maps = lmdb:/etc/postfix/generic
recipient_canonical_maps = lmdb:/etc/postfix/recipient_canonical

# Transport map
smtp_dns_support_level = disabled

M postfix/main.cf.tls-out => postfix/main.cf.tls-out +1 -0
@@ 18,6 18,7 @@ smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)

# Address rewriting
smtp_generic_maps = lmdb:/etc/postfix/generic
recipient_canonical_maps = lmdb:/etc/postfix/recipient_canonical

# Transport map
transport_maps = lmdb:/etc/postfix/transport