Remove lmdb databases if they already exist (eg. when restarting the container)

This commit is contained in:
akp 2025-02-09 00:43:47 +00:00
parent ea46b592b4
commit 200c6ecc1c
No known key found for this signature in database
GPG key ID: CF8D58F3DEB20755

View file

@ -66,16 +66,20 @@ postconf -e myhostname=$POSTFIX_HOSTNAME
postconf -e "relay_domains=" postconf -e "relay_domains="
# Relay configuration # Relay configuration
postconf -e relayhost=$POSTFIX_RELAY_HOST postconf -e "relayhost=$POSTFIX_RELAY_HOST"
postconf -e "smtp_sasl_auth_enable=yes"
rm /etc/postfix/sasl_passwd || true
echo "$POSTFIX_RELAY_HOST $POSTFIX_RELAY_USER:$POSTFIX_RELAY_PASSWORD" >> /etc/postfix/sasl_passwd echo "$POSTFIX_RELAY_HOST $POSTFIX_RELAY_USER:$POSTFIX_RELAY_PASSWORD" >> /etc/postfix/sasl_passwd
postmap lmdb:/etc/postfix/sasl_passwd postmap lmdb:/etc/postfix/sasl_passwd
postconf -e "smtp_sasl_auth_enable=yes"
postconf -e "smtp_sasl_password_maps=lmdb:/etc/postfix/sasl_passwd" postconf -e "smtp_sasl_password_maps=lmdb:/etc/postfix/sasl_passwd"
postconf -e "smtp_sasl_security_options=noanonymous" postconf -e "smtp_sasl_security_options=noanonymous"
postconf -e "smtp_sasl_tls_security_options=noanonymous" postconf -e "smtp_sasl_tls_security_options=noanonymous"
postconf -e "smtp_tls_security_level=encrypt" postconf -e "smtp_tls_security_level=encrypt"
# Allowed senders # Allowed senders
rm /etc/postfix/allowed_senders || true
for i in $POSTFIX_SENDER_DOMAINS; do for i in $POSTFIX_SENDER_DOMAINS; do
echo -e "$i\tOK" >> /etc/postfix/allowed_senders echo -e "$i\tOK" >> /etc/postfix/allowed_senders
done done