-<<<<<<< HEAD
spamassassin-cn (2:3.4.0-5) stable; urgency=low
* novi kljuc i sa-update zbog problema opisanih na stranici:
https://sysportal.carnet.hr/node/1793
-- Ivan Rako <Ivan.Rako@CARNet.hr> Tue, 18 Dec 2018 20:53:18 +0100
-=======
-spamassassin-cn (2:3.4.1~cn0) stable; urgency=low
-
- * Prva verzija za stretch
-
- -- Ivan Rako <Ivan.Rako@CARNet.hr> Sun, 08 Jul 2018 00:12:47 +0200
->>>>>>> 398d1393b4cd16ac3f5c5dd70295bbdbca78c18d
spamassassin-cn (2:3.4.0-4) stable; urgency=low
Priority: optional
Maintainer: Ivan Rako <Ivan.Rako@CARNet.hr>
Build-Depends: debhelper (>= 9.20120909), po-debconf
-Standards-Version: 3.9.8
+Standards-Version: 3.9.6
Package: spamassassin-cn
Architecture: all
-Depends: spamassassin (>= 3.4.1), razor (>= 1:2.85-4+b1), libnet-dns-perl (>= 0.66-2+b2), carnet-tools-cn (>= 3.2.1), gnupg (>= 1.4.12-7+deb7u1), libmail-dkim-perl (>= 0.39-1), libcrypt-openssl-bignum-perl (>= 0.04-3), libmail-spf-perl (>= 2.8.0-1), adduser (>= 3.113+nmu3), ${misc:Depends}
+Depends: spamassassin (>= 3.4.0), razor (>= 1:2.85-4+b1), libnet-dns-perl (>= 0.66-2+b2), carnet-tools-cn (>= 3.0.4), gnupg (>= 1.4.12-7+deb7u1), libmail-dkim-perl (>= 0.39-1), libcrypt-openssl-bignum-perl (>= 0.04-3), libmail-spf-perl (>= 2.8.0-1), adduser (>= 3.113+nmu3), debconf (>= 0.5) | debconf-2.0
Recommends: amavisd-new
Description: Perl-based spam filter using text analysis
SpamAssassin is a very powerful and fully configurable spam filter
sa-update \
--channelfile /etc/spamassassin/sa-update.channels \
--allowplugins \
- --gpgkey 6C6191E3 \
- --gpgkey 24F434CE \
- --gpgkey BDE9DC10 || \
+ --gpghomedir /var/lib/spamassassin/sa-update-keys || \
( echo "$(date +'%d-%m-%Y %T'): No new rules. Exiting now."; exit )
fi
# restart of services
echo "$(date +'%d-%m-%Y %T'): Will restart services due to updated rules..."
-if [ -x /usr/sbin/invoke-rc.d ]; then
- [ -x /etc/init.d/spamassassin ] && \
- invoke-rc.d --quiet spamassassin restart
- [ -x /etc/init.d/amavis ] && \
- invoke-rc.d --quiet amavis restart
- [ -x /etc/init.d/postfix ] && \
- invoke-rc.d --quiet postfix restart
-else
- [ -x /etc/init.d/spamassassin ] && \
- /etc/init.d/spamassassin restart
- [ -x /etc/init.d/amavis ] && \
- /etc/init.d/amavis restart
- [ -x /etc/init.d/postfix ] && \
- /etc/init.d/postfix restart
+
+if [ -x /etc/init.d/spamassassin ]; then
+ service spamassassin restart
+fi
+
+if [ -x /etc/init.d/amavis ]; then
+ service amavis restart
+fi
+
+if [ -x /etc/init.d/postfix ]; then
+ service postfix restart
fi
# import http://spamassassin.apache.org/updates/GPG.KEY
echo "CN: Importing new http://spamassassin.apache.org/updates/GPG.KEY..."
-sa-update --import /usr/share/spamassassin-cn/GPG.KEY
+sa-update --gpghomedir /etc/spamassassin/sa-update-keys --import /usr/share/spamassassin-cn/GPG.KEY
# clean old RulesDuJour rules
echo "CN: Cleaning old RulesDuJour and SARE rules..."
rm -rf /etc/spamassassin/*_sare_*.cf /etc/spamassassin/RulesDuJour
-find /var/lib/spamassassin -iname \*_sare_\* -print0| xargs -0r rm -rf
+find /var/lib/spamassassin -iname \*_sare_\* -print0 | xargs -0r rm -rf
sed -i -e '/dostech.net/d' /etc/spamassassin/sa-update.channels
echo "CN: Please use /etc/spamassassin/sa-update.channels in future!"
-
+
+# clean old sought.rules.yerp.org
+echo "CN: Cleaning old YERP rules..."
+find /var/lib/spamassassin -iname \*_yerp_\* -print0 | xargs -0r rm -rf
+sed -i -e '/sought.rules.yerp.org/d' /etc/spamassassin/sa-update.channels
+
+# add spamassassin.heinlein-support.de
+echo "CN: Adding spamassassin.heinlein-support.de to /etc/spamassassin/sa-update.channels..."
+if ! grep -q spamassassin.heinlein-support.de /etc/spamassassin/sa-update.channels; then
+ echo spamassassin.heinlein-support.de >> /etc/spamassassin/sa-update.channels
+fi
+
# get/update the rules
echo "CN: Downloading new SpamAssassin rules and updating in background"
echo "$(date +'%d-%m-%Y %T'): Fetching new SA rules..." >> \
/var/log/sa-update.log
sa-update \
--channelfile /etc/spamassassin/sa-update.channels \
- --allowplugins \
- --gpgkey 6C6191E3 \
- --gpgkey 24F434CE \
- --gpgkey BDE9DC10 >>/var/log/sa-update.log 2>&1 &
-
-# get rules https://sysportal.carnet.hr/node/1793
-echo "CN: Downloading new GPG key for SpamAssassin from http://spamassassin.apache.org/updates/GPG.KEY"
-echo "$(date +'%d-%m-%Y %T'): Downloading new GPG key from http://spamassassin.apache.org/updates/GPG.KEY ..." >> \
- /var/log/sa-update.log
-wget -O - http://spamassassin.apache.org/updates/GPG.KEY 2> /dev/null | sa-update --import -
-sa-update -v
-restart=yes
+ --gpghomedir /etc/spamassassin/sa-update-keys \
+ --allowplugins >>/var/log/sa-update.log 2>&1 &
+
echo "CN: SpamAssassin updates are now logged at /var/log/sa-update.log"
# restart the spamasassin