dovecot-postfix always overwrites main.cf

Bug #795336 reported by Tim White
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
dovecot (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: dovecot-postfix

Every upgrade of dovecot-postfix overwrites the main.cf postfix configuration file removing some of the users customisations.
It is expected on initial install for this to occur (although a warning even then would be good), however according to the postinst it is not supposed to overwrite the config on upgrades.

It was noticed on a previous upgrade as well as one done last night. Thankfully, as I use etckeeper I was able to rollback the changes it made without any problem. To confirm it was dovecot-postfix I did apt-get install --reinstall dovecot-postfix after restoring the correct config and it again overwrote the main.cf. The problem seems to be in the snippit of postinst below. The POSTFIX_BCKFILE's do exist, however the check for the file not existing occurs AFTER the backup file is moved to the dated version. It appears that maybe the mv should be a copy, or the test for not existing should be changed.

$ ls -l /var/backups/dovecot-postfix/main.cf-backup*
-rw-r--r-- 1 root root 1219 2011-06-10 09:00 /var/backups/dovecot-postfix/main.cf-backup
-rw-r--r-- 1 root root 708 2010-03-06 15:52 /var/backups/dovecot-postfix/main.cf-backup-201007062114
-rw-r--r-- 1 root root 934 2010-07-06 21:14 /var/backups/dovecot-postfix/main.cf-backup-201103060521
-rw-r--r-- 1 root root 1166 2011-03-06 05:22 /var/backups/dovecot-postfix/main.cf-backup-201106092123
-rw-r--r-- 1 root root 1219 2011-06-09 21:24 /var/backups/dovecot-postfix/main.cf-backup-201106100859

snippit of postinst
        # Configure postfix either on new install
        # or if the postfix backup file is no longer there
        # (only deleted when the pkg is removed)
        if [ -f "/etc/postfix/main.cf" ]; then
                if [ -e "$POSTFIX_BCKFILE" ]; then
                        mv $POSTFIX_BCKFILE ${POSTFIX_BCKFILE}-$(date +%Y%m%d%H%M)
                fi
                if [ -z "$2" -o ! -e "$POSTFIX_BCKFILE" ]; then

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: dovecot-postfix 1:1.2.9-1ubuntu6.4
ProcVersionSignature: Ubuntu 2.6.32-30.59-generic-pae 2.6.32.29+drm33.13
Uname: Linux 2.6.32-30-generic-pae i686
Architecture: i386
Date: Fri Jun 10 08:55:25 2011
PackageArchitecture: all
ProcEnviron:
 LANG=en_AU.UTF-8
 SHELL=/bin/bash
SourcePackage: dovecot

Revision history for this message
Tim White (timwhite88) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.