Switch to env_file and deploy amavis

This commit is contained in:
Pierre Jaury
2016-03-02 21:25:56 +01:00
parent d0006dc624
commit c55c1202d6
11 changed files with 261 additions and 18 deletions

View File

@@ -1,6 +1,6 @@
FROM alpine
RUN apk add --update postfix postfix-sqlite rsyslog && rm -rf /var/cache/apk/*
RUN apk add --update bash postfix postfix-sqlite rsyslog && rm -rf /var/cache/apk/*
COPY conf /etc/postfix
COPY rsyslog.conf /etc/rsyslog.conf

View File

@@ -2,8 +2,12 @@
# General
###############
# The list of relayed networks is still loaded from a configuration file
mynetworks = 127.0.0.1/32 [::1]/128
# Main domain and hostname
mydomain = {{ DOMAIN }}
myhostname = {{ HOSTNAME }}
myorigin = $mydomain
# Relayed networks
mynetworks = 127.0.0.1/32 [::1]/128 {{ RELAYNETS }}
# Empty alias list to override the configuration variable and disable NIS
alias_maps = hash:/etc/aliases
# SQLite configuration
@@ -25,7 +29,7 @@ smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
###############
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_type = dovecot
smtpd_sasl_path = inet:imap:2102
smtpd_sasl_path = inet:sasl:2102
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
@@ -34,5 +38,5 @@ smtpd_sasl_security_options = noanonymous
###############
virtual_mailbox_domains = ${sql}sqlite-virtual_mailbox_domains.cf
virtual_alias_maps = ${sql}sqlite-virtual_alias_maps.cf
virtual_transport = lmtp:inet:imap:2525
virtual_transport = lmtp:inet:lmtp:2525
lmtp_host_lookup = native

View File

@@ -1,4 +1,10 @@
#!/bin/sh
#!/bin/bash
# Substitute configuration
for VARIABLE in `env | cut -f1 -d=`; do
sed -i "s,{{ $VARIABLE }},${!VARIABLE},g" /etc/postfix/*.cf
done
# Actually run Postfix
/usr/lib/postfix/master &
rsyslogd -n