# upgrade the IMAP server
upgrade_dovecot() {
- if [ ! -f /etc/dovecot/conf.d/95-local ]; then
+ local local_conf=/etc/dovecot/conf.d/95-${backup_ext}.conf
+
+ if [ -f /etc/dovecot/conf.d/95-local -a ! -f $local_conf ]; then
+ mv /etc/dovecot/conf.d/95-local $local_conf
+ sed -i 's/\/usr\/lib\/dovecot\/modules\/imap/\/usr\/lib\/dovecot\/modules/g' $local_conf
+ /etc/init.d/dovecot restart
+ fi
+
+ if [ ! -f $local_conf ]; then
pkgrm dovecot-cn
# restore config
# install new version and restore local changes
pkgadd dovecot-core
- doveconf -n -c /etc/dovecot/dovecot.conf.$backup_ext > /etc/dovecot/conf.d/95-local
+ doveconf -n -c /etc/dovecot/dovecot.conf.$backup_ext > $local_conf
+ sed -i 's/\/user\/lib\/dovecot\/modules\/imap/\/usr\/lib\/dovecot\/modules/g' $local_conf
pkgadd dovecot-cn
fi