mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2024-11-27 04:16:45 +01:00
updates
Signed-off-by: Jess Frazelle <acidburn@google.com>
This commit is contained in:
parent
147fea10ab
commit
3fef00b940
|
@ -2,6 +2,7 @@ FROM alpine:edge
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
bash \
|
bash \
|
||||||
|
ca-certificates \
|
||||||
libsasl \
|
libsasl \
|
||||||
postfix \
|
postfix \
|
||||||
rsyslog \
|
rsyslog \
|
||||||
|
|
|
@ -1,44 +1,44 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# Avoid warning: smtputf8_enable is true, but EAI support is not compiled in
|
||||||
|
echo "smtputf8_enable = no" >> /etc/postfix/main.cf
|
||||||
|
|
||||||
# Do we want to modify the config first with the script?
|
# Do we want to modify the config first with the script?
|
||||||
[ -f /etc/service/postfix/run.config ] && source /etc/service/postfix/run.config
|
[ -f /etc/service/postfix/run.config ] && source /etc/service/postfix/run.config
|
||||||
|
|
||||||
if [ "$MAILNAME" ]; then
|
if [[ ! -z "$MAILNAME" ]]; then
|
||||||
echo "$MAILNAME" > /etc/mailname
|
echo "$MAILNAME" > /etc/mailname
|
||||||
postconf -e myhostname="$MAILNAME"
|
postconf -e myhostname="$MAILNAME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$MY_NETWORKS" ]; then
|
if [[ ! -z "$MY_NETWORKS" ]]; then
|
||||||
postconf -e mynetworks="$MY_NETWORKS"
|
postconf -e mynetworks="$MY_NETWORKS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$MY_DESTINATION" ]; then
|
if [[ ! -z "$MY_DESTINATION" ]]; then
|
||||||
postconf -e mydestination="$MY_DESTINATION"
|
postconf -e mydestination="$MY_DESTINATION"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$ROOT_ALIAS" ]; then
|
if [[ ! -z "$ROOT_ALIAS" ]]; then
|
||||||
sed -i '/^root:/d' /etc/aliases
|
if [[ -f /etc/aliases ]]; then
|
||||||
|
sed -i '/^root:/d' /etc/aliases
|
||||||
|
fi
|
||||||
echo "root: $ROOT_ALIAS" >> /etc/aliases
|
echo "root: $ROOT_ALIAS" >> /etc/aliases
|
||||||
newaliases
|
newaliases
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$RELAY" ]; then
|
if [[ ! -z "$RELAY" ]]; then
|
||||||
# setup the relay
|
# setup the relay
|
||||||
echo "relay_host = $RELAY" >> /etc/postfix/main.cf
|
echo "relay_host = $RELAY" >> /etc/postfix/main.cf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$SASL_AUTH" ]; then
|
if [[ ! -z "$SASL_AUTH" ]]; then
|
||||||
# setup tls
|
# setup tls
|
||||||
echo -e "smtp_sasl_auth_enable = yes\nsmtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd\nsmtp_sasl_security_options = noanonymous\nsmtp_use_tls = yes" >> /etc/postfix/main.cf
|
echo -e "smtp_sasl_auth_enable = yes\nsmtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd\nsmtp_sasl_security_options = noanonymous\nsmtp_use_tls = yes\ninet_interfaces = 127.0.0.1" >> /etc/postfix/main.cf
|
||||||
|
|
||||||
# Avoid warning: smtputf8_enable is true, but EAI support is not compiled in
|
|
||||||
echo "smtputf8_enable = no" >> /etc/postfix/main.cf
|
|
||||||
|
|
||||||
# generate the SASL password map
|
# generate the SASL password map
|
||||||
cat > /etc/postfix/sasl_passwd <<- EOF
|
echo "$RELAY $SASL_AUTH" > /etc/postfix/sasl_passwd
|
||||||
$RELAY $SASL_AUTH
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# generate a .db file
|
# generate a .db file
|
||||||
postmap /etc/postfix/sasl_passwd
|
postmap /etc/postfix/sasl_passwd
|
||||||
|
|
Loading…
Reference in New Issue
Block a user