From e29cc568baedc4e187e44ceb48e4e078683dbd85 Mon Sep 17 00:00:00 2001 From: Ivan Rako Date: Fri, 11 Jan 2019 17:33:01 +0100 Subject: [PATCH] izmjene za spamassassin.heinlein-support.de --- debian/changelog | 8 -------- debian/control | 4 ++-- debian/cron.daily | 29 ++++++++++++----------------- debian/postinst | 32 +++++++++++++++++--------------- 4 files changed, 31 insertions(+), 42 deletions(-) diff --git a/debian/changelog b/debian/changelog index df27142..5f76747 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,17 +1,9 @@ -<<<<<<< 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 Tue, 18 Dec 2018 20:53:18 +0100 -======= -spamassassin-cn (2:3.4.1~cn0) stable; urgency=low - - * Prva verzija za stretch - - -- Ivan Rako Sun, 08 Jul 2018 00:12:47 +0200 ->>>>>>> 398d1393b4cd16ac3f5c5dd70295bbdbca78c18d spamassassin-cn (2:3.4.0-4) stable; urgency=low diff --git a/debian/control b/debian/control index 7e808d3..fa124b4 100644 --- a/debian/control +++ b/debian/control @@ -3,11 +3,11 @@ Section: mail Priority: optional Maintainer: Ivan Rako 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 diff --git a/debian/cron.daily b/debian/cron.daily index 4acf67e..2a8b57c 100755 --- a/debian/cron.daily +++ b/debian/cron.daily @@ -12,26 +12,21 @@ if [ -e /etc/spamassassin/sa-update.channels ]; then 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 diff --git a/debian/postinst b/debian/postinst index da58854..6037ae7 100755 --- a/debian/postinst +++ b/debian/postinst @@ -359,33 +359,35 @@ sa-update --import /etc/spamassassin/sa-keys.pgp \ # 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 -- 1.7.10.4