Fix spamassassin symlink.

At some point in the distant past there was a config file called
spam.assassin.prefs.conf.  This was renamed to spamassassin.conf,
but the symlink in %D/etc/mail/spamassassin still pointed to the
old location.  This worked fine for old installs, but new installs
were left out.  This should DTRT for both without administrator
intervention necessary.
This commit is contained in:
Chris Rees 2020-10-13 19:44:42 +00:00
parent 8428bff8b7
commit 05d73e85e9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=552279
3 changed files with 12 additions and 5 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= MailScanner
PORTVERSION= 5.1.2
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= mail
MASTER_SITES= https://s3.amazonaws.com/msv5/release/
DISTNAME= ${PORTNAME}-${PORTVERSION}-${PATCHLEVEL}.nix

View File

@ -103,10 +103,16 @@ initial_config()
case $2 in
POST-INSTALL)
[ "x${WITHOUT_SPAMASSASSIN_SYMLINK}" = "xno" ] \
&& [ ! -r ${PKG_PREFIX}/etc/mail/spamassassin/mailscanner.cf ] \
&& ${LN} -s ${PKG_PREFIX}/etc/MailScanner/spam.assassin.prefs.conf \
${PKG_PREFIX}/etc/mail/spamassassin/mailscanner.cf
if [ "${WITHOUT_SPAMASSASSIN_SYMLINK}" = "no" ] && \
[ ! -r ${PKG_PREFIX}/etc/mail/spamassassin/mailscanner.cf ]; then
if [ -r ${PKG_PREFIX}/etc/MailScanner/spam.assassin.prefs.conf ]; then
${LN} -s ${PKG_PREFIX}/etc/MailScanner/spam.assassin.prefs.conf \
${PKG_PREFIX}/etc/mail/spamassassin/mailscanner.cf
else
${LN} -s ${PKG_PREFIX}/etc/MailScanner/spamassassin.conf \
${PKG_PREFIX}/etc/mail/spamassassin/mailscanner.cf
fi
fi
upgrade_lang_conf
[ -f ${PKG_PREFIX}/etc/MailScanner/MailScanner.conf ] \
&& upgrade_mailscanner_conf

View File

@ -551,3 +551,4 @@ lib/MailScanner/systemd/ms-milter
lib/MailScanner/systemd/ms-systemd
lib/MailScanner/wrapper/sophos-autoupdate
lib/MailScanner/wrapper/sophos-wrapper
@postunexec [ -L %D/etc/mail/spamassassin/mailscanner.cf ] && rm %D/etc/mail/spamassassin/mailscanner.cf || true