Sophie

Sophie

distrib > Mageia > 1 > i586 > by-pkgid > dfc45828caf32173d3c4b93d3a3f1a29 > scriptlet

spamassassin-spamd-3.3.2-1.5.mga1.i586.rpm

PREUN

/bin/sh
/usr/share/rpm-helper/del-service spamassassin $1 spamd

POSTIN

/bin/sh


# -a and --auto-whitelist options were removed from 3.0.0
# prevent service startup failure
perl -p -i -e 's/(["\s]-\w+)a/$1/ ; s/(["\s]-)a(\w+)/$1$2/ ; s/(["\s])-a\b/$1/' /etc/sysconfig/spamd
perl -p -i -e 's/ --auto-whitelist//' /etc/sysconfig/spamd

# fix permissions
if [ -f /etc/mail/spamassassin/local.cf ]; then

    auto_whitelist_path="`grep "^auto_whitelist_path" /etc/mail/spamassassin/local.cf | awk '{ print $2 }'`"
    auto_whitelist_file_mode="`grep "^auto_whitelist_file_mode" /etc/mail/spamassassin/local.cf | awk '{ print $2 }'`"

    if [ "${auto_whitelist_path}" == "/var/spool/spamassassin" ]; then
	echo "Correcting \"auto_whitelist_path\" (#27424) in the /etc/mail/spamassassin/local.cf file..."
	perl -pi -e "s|/var/spool/spamassassin\b|/var/spool/spamassassin/auto-whitelist|g" /etc/mail/spamassassin/local.cf
	auto_whitelist_path="/var/spool/spamassassin/auto-whitelist"
    fi

    if ! [ -z "${auto_whitelist_path}" ]; then
        touch ${auto_whitelist_path}
        if [ -z "${auto_whitelist_file_mode}" ]; then
            auto_whitelist_file_mode="0666"
        fi
        chmod ${auto_whitelist_file_mode} ${auto_whitelist_path}
    fi

fi
# Need to run sa-update otherwise the spamd will not start until a cron job completes
echo "need to run sa-update"
/usr/bin/sa-update -v

/usr/share/rpm-helper/add-service spamassassin $1 spamd