diff --git a/Dockerfile b/Dockerfile index 509bf26..759f225 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,3 @@ -# TODO: This configuration is only really useful for sending e-mail. It -# receives and stores email for local users but we're not serving them -# just yet. FROM sutty/monit:latest MAINTAINER "f " @@ -68,7 +65,11 @@ RUN postconf -e alias_maps='hash:/etc/postfix/aliases' \ && postconf -e masquerade_domains='$mydomain' \ && postconf -e non_smtpd_milters=inet:opendkim:8891 \ && postconf -e smtpd_milters=inet:opendkim:8891 \ - && postconf -e virtual_alias_maps=hash:/etc/postfix/maps/virtual + && postconf -e virtual_alias_maps=hash:/etc/postfix/maps/virtual \ + && postconf -e sender_canonical_maps=tcp:postsrsd:10001 \ + && postconf -e sender_canonical_classes=envelope_sender \ + && postconf -e recipient_canonical_maps=tcp:postsrsd:10002 \ + && postconf -e recipient_canonical_classes=envelope_recipient,header_recipient RUN newaliases RUN postmap /etc/postfix/transport @@ -78,13 +79,7 @@ COPY ./monit.conf /etc/monit.d/postfix.conf COPY ./postfix.sh /usr/local/bin/postfix RUN chmod 755 /usr/local/bin/postfix -# Check config -RUN monit -t - -# Save email for later! -VOLUME "/var/spool/postfix" VOLUME "/etc/postfix/maps" -VOLUME "/home" # Port EXPOSE 25 diff --git a/postfix.sh b/postfix.sh index 142b2c0..6b6e6ec 100644 --- a/postfix.sh +++ b/postfix.sh @@ -7,17 +7,4 @@ postconf -e smtpd_tls_key_file="/etc/letsencrypt/live/${SUTTY}/privkey.pem" postconf -e smtpd_tls_cert_file="/etc/letsencrypt/live/${SUTTY}/fullchain.pem" postconf -e mynetworks="127.0.0.0/8 [::1]/128 `ip route | grep -v default | cut -d " " -f 1`" -# Recreate users from ~ -for home in /home/*; do - user="${home##*/}" - test "${user}" = "*" && continue - - uid="$(stat -c %u "${home}")" - - # Skip if it already exists - getent passwd ${user} >/dev/null && continue - - adduser -h ${home} -s /bin/false -G users -D -H -u ${uid} ${user} -done - exec /usr/sbin/postfix start