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 \
|
||||
bash \
|
||||
ca-certificates \
|
||||
libsasl \
|
||||
postfix \
|
||||
rsyslog \
|
||||
|
|
|
@ -1,44 +1,44 @@
|
|||
#!/bin/bash
|
||||
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?
|
||||
[ -f /etc/service/postfix/run.config ] && source /etc/service/postfix/run.config
|
||||
|
||||
if [ "$MAILNAME" ]; then
|
||||
if [[ ! -z "$MAILNAME" ]]; then
|
||||
echo "$MAILNAME" > /etc/mailname
|
||||
postconf -e myhostname="$MAILNAME"
|
||||
fi
|
||||
|
||||
if [ "$MY_NETWORKS" ]; then
|
||||
if [[ ! -z "$MY_NETWORKS" ]]; then
|
||||
postconf -e mynetworks="$MY_NETWORKS"
|
||||
fi
|
||||
|
||||
if [ "$MY_DESTINATION" ]; then
|
||||
if [[ ! -z "$MY_DESTINATION" ]]; then
|
||||
postconf -e mydestination="$MY_DESTINATION"
|
||||
fi
|
||||
|
||||
if [ "$ROOT_ALIAS" ]; then
|
||||
sed -i '/^root:/d' /etc/aliases
|
||||
if [[ ! -z "$ROOT_ALIAS" ]]; then
|
||||
if [[ -f /etc/aliases ]]; then
|
||||
sed -i '/^root:/d' /etc/aliases
|
||||
fi
|
||||
echo "root: $ROOT_ALIAS" >> /etc/aliases
|
||||
newaliases
|
||||
fi
|
||||
|
||||
if [ "$RELAY" ]; then
|
||||
if [[ ! -z "$RELAY" ]]; then
|
||||
# setup the relay
|
||||
echo "relay_host = $RELAY" >> /etc/postfix/main.cf
|
||||
fi
|
||||
|
||||
if [ "$SASL_AUTH" ]; then
|
||||
if [[ ! -z "$SASL_AUTH" ]]; then
|
||||
# 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
|
||||
|
||||
# Avoid warning: smtputf8_enable is true, but EAI support is not compiled in
|
||||
echo "smtputf8_enable = no" >> /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
|
||||
|
||||
# generate the SASL password map
|
||||
cat > /etc/postfix/sasl_passwd <<- EOF
|
||||
$RELAY $SASL_AUTH
|
||||
EOF
|
||||
echo "$RELAY $SASL_AUTH" > /etc/postfix/sasl_passwd
|
||||
|
||||
# generate a .db file
|
||||
postmap /etc/postfix/sasl_passwd
|
||||
|
|
Loading…
Reference in New Issue
Block a user