[Postfix] Fix smtp last login on replicated setups

This commit is contained in:
andryyy
2020-09-28 16:23:49 +02:00
parent b3c557f690
commit 836ea1508e
3 changed files with 7 additions and 2 deletions

View File

@@ -355,6 +355,9 @@ if [[ ! -f /opt/postfix/conf/custom_postscreen_whitelist.cidr ]]; then
echo '# Autogenerated by mailcow' > /opt/postfix/conf/custom_postscreen_whitelist.cidr
fi
# Fix SMTP last login on slaves
sed -i "s/__REDIS_SLAVEOF_IP__/${REDIS_SLAVEOF_IP}/g" /usr/local/bin/smtpd_last_login.sh
# Fix Postfix permissions
chown -R root:postfix /opt/postfix/conf/sql/ /opt/postfix/conf/custom_transport.pcre
chmod 640 /opt/postfix/conf/sql/*.cf /opt/postfix/conf/custom_transport.pcre

View File

@@ -1,5 +1,7 @@
#!/bin/bash
REDIS_SLAVEOF_IP=__REDIS_SLAVEOF_IP__
# Do not attempt to write to slave
if [[ ! -z ${REDIS_SLAVEOF_IP} ]]; then
REDIS_CMDLINE="redis-cli -h ${REDIS_SLAVEOF_IP} -p ${REDIS_SLAVEOF_PORT}"