X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;h=85f6874bb8343b59bfeb8aa9ca99f277bdbe793a;hb=ab6bc87ddbd3b118d5d87654d2dd66edf4ff233f;hp=ed617475a34264441ef467c25e87b9ff094f6be7;hpb=3173912c8a40b82b62ef2c5cb5e34bb75c535380;p=spamassassin-cn.git diff --git a/debian/postinst b/debian/postinst index ed61747..85f6874 100755 --- a/debian/postinst +++ b/debian/postinst @@ -191,6 +191,12 @@ if [ -f $examdir/local.cf ]; then $confdir/local.cf.$$ || true done + # remove obsolete options from old SA + egrep -v '^(bayes_use_chi2_combining|ok_languages|pyzor)' \ + $confdir/local.cf.$$ > $confdir/local.cf.$$.$$ && \ + mv -f $confdir/local.cf.$$.$$ $confdir/local.cf.$$ + rm -f $confdir/local.cf.$$.$$ + # different than template if ! cmp -s $confdir/local.cf.$$ $confdir/local.cf; then # backup if not zero size @@ -209,10 +215,11 @@ if [ -f $examdir/local.cf ]; then fi # enable requested plugins in SA -list=$(find /etc/spamassassin -type -f -name 'v*.pre') +list=$(find /etc/spamassassin -type f -name 'v*.pre') for i in $list; do # enable DCC if requested if [ "$use_dcc" = "true" ]; then + cp -f $i $i.$$ plugin="loadplugin Mail::SpamAssassin::Plugin::DCC" cp_check_and_sed "^.*#.*$plugin.*$" \ "s/^.*#.*$plugin.*$/$plugin/g" $i.$$ || true @@ -223,6 +230,7 @@ for i in $list; do fi # enable DKIM + cp -f $i $i.$$ plugin="loadplugin Mail::SpamAssassin::Plugin::DKIM" cp_check_and_sed "^.*#.*$plugin.*$" \ "s/^.*#.*$plugin.*$/$plugin/g" $i.$$ || true @@ -230,6 +238,16 @@ for i in $list; do mv -f $i.$$ $i fi rm -f $i.$$ + + # disable Pyzor + cp -f $i $i.$$ + plugin="loadplugin Mail::SpamAssassin::Plugin::Pyzor" + cp_check_and_sed "^$plugin.*$" \ + "s/^$plugin.*$/#$plugin/g" $i.$$ || true + if ! cmp -s $i.$$ $i; then + mv -f $i.$$ $i + fi + rm -f $i.$$ done # check and replace /etc/default/spamasassin if needed