5
# Check if dovecot-postfix.conf had any customizations
6
if [ -f "/usr/share/dovecot/dovecot-postfix.conf" ]; then
7
if [ -f "/etc/dovecot/dovecot-postfix.conf" ]; then
8
mv /etc/dovecot/dovecot-postfix.conf /etc/dovecot/dovecot-postfix.conf.bak
10
egrep -v ^protocol /etc/dovecot/dovecot-postfix.conf.bak > $DIR/dovecot-postfix-custom.conf
11
egrep -v ^protocol /usr/share/dovecot/dovecot-postfix.conf > $DIR/dovecot-postfix-dist.conf
12
if diff -qur $DIR/dovecot-postfix-dist.conf $DIR/dovecot-postfix-custom.conf 1>/dev/null 2>&1; then
13
rm -f /etc/dovecot/dovecot-postfix.conf.bak
15
awk ' /^auth default/ {flag=1;next} /^}/{flag=0} flag { print }' /etc/dovecot/dovecot-postfix.conf.bak > /etc/dovecot/auth.d/01-dovecot-postfix.auth
16
awk ' /^## Dovecot conf/{flag=1} /^auth default/{flag=0} flag { print }' /etc/dovecot/dovecot-postfix.conf.bak > /etc/dovecot/conf.d/01-dovecot-postfix.conf
17
awk ' /^# If you wish to use another authentication server than dovecot-auth/{flag=1} flag { print }' /etc/dovecot/dovecot-postfix.conf.bak >> /etc/dovecot/conf.d/01-dovecot-postfix.conf