check_and_add_alias virusalert root
check_and_add_alias spamalert root
-if [ ! -f $AHOME/.spamassassin/user_prefs ] ; then
- [ -d $AHOME/.spamassassin ] || mkdir -p $AHOME/.spamassassin
- cat > $AHOME/.spamassassin/user_prefs <<-EEND
+if [ -f $AHOME/.spamassassin/user_prefs ] ; then
+ user_prefs_temp=out=$(mktemp /tmp/user_prefs.XXXXXX)
+ cat > $user_prefs_temp <<-EEND
bayes_path $AHOME/.spamassassin/bayes
bayes_auto_expire 0
auto_whitelist_path $AHOME/.spamassassin/auto-whitelist
EEND
- chown_ahome=1
-fi
-
-if [ ! -f $AHOME/.spamassassin/auto-whitelist ] ; then
- touch $AHOME/.spamassassin/auto-whitelist
- chown_ahome=1
+ if cmp -s $user_prefs_temp $AHOME/.spamassassin/user_prefs; then
+ rm -f $AHOME/.spamassassin/user_prefs
+ fi
+ rm -f $user_prefs_temp
fi
# No sysvinit order fixes