--- rpms/smeserver-spamassassin/sme10/smeserver-spamassassin.spec 2017/03/08 14:29:38 1.8 +++ rpms/smeserver-spamassassin/sme10/smeserver-spamassassin.spec 2023/07/05 14:03:17 1.27 @@ -1,21 +1,25 @@ -# $Id: smeserver-spamassassin.spec,v 1.7 2016/04/20 20:45:45 vip-ire Exp $ +# $Id: smeserver-spamassassin.spec,v 1.26 2023/03/08 09:55:14 jcrisp Exp $ Summary: SME Server - spamassassin anti-spam module %define name smeserver-spamassassin Name: %{name} -%define version 2.6.0 -%define release 7 +%define version 2.7.0 +%define release 12 Version: %{version} Release: %{release}%{?dist} License: GPL Group: Networking/Daemons Source: %{name}-%{version}.tar.xz -Patch0: smeserver-spamassassin-2.6.0-add_detailed_header.patch -Patch1: smeserver-spamassassin-2.6.0-allow_tell.patch +Patch0: smeserver-spamassassin-2.7.0-bz11166-update.patch +Patch1: smeserver-spamassassin-2.7.0-bz11361-spamd-fails.patch +Patch2: smeserver-spamassassin-2.7.0-bz11362-logging.patch +Patch3: smeserver-spamassassin-2.7.0-bz11375-remove-spamd.patch +Patch4: smeserver-spamassassin-2.7.0-bz12330-logging-sa4.patch + BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot Requires: e-smith-email >= 4.13.0-38 Requires: headermatch -Requires: spamassassin >= 3.3.0 +Requires: spamassassin >= 4.0.0 Requires: perl(Crypt::OpenSSL::Bignum) Requires: perl(IO::Socket::INET6) Requires: perl(IP::Country) @@ -23,11 +27,14 @@ Requires: perl(Net::DNS) >= 0.34-1 Requires: perl(Net::Ident) Requires: perl(Compress::Zlib) Requires: perl(Mail::DKIM) +Requires: perl(Mail::DMARC) >= 1.20200214 Requires: ucspi-tcp daemontools Requires: e-smith-lib >= 1.13.1-90 Requires: e-smith-base >= 4.13.16 Requires: e-smith-qmail >= 1.9.0-09sme02 +Requires: smeserver-clamav >= 2.7.0 Requires: perl-Razor-Agent +Requires: DCC Requires: pyzor Obsoletes: FuzzyOcr Obsoletes: e-smith-spamassassin @@ -40,6 +47,49 @@ AutoReqProv: no SME Server - spamassassin anti-spam module %changelog +* Wed Jul 05 2023 John Crisp 2.7.0-12.sme +- Add requires perl-Mail-DMARC for spamassassin 4 + +* Tue Mar 07 2023 John Crisp 2.7.0-11.sme +- update for Spamassassin 4 - thanks for the patch Zsolt [SME: 12330] + +* Wed Apr 07 2021 Jean-Philippe Pialasse 2.7.0-10.sme +- prevent noise in log at spamassassin call from qpsmtpd [SME: 11491] + +* Tue Mar 16 2021 Jean-Philippe Pialasse 2.7.0-9.sme +- clean rsyslog syntax for spamd [SME: 11422] + +* Tue Feb 23 2021 Jean-Philipe Pialasse 2.7.0-8.sme +- remove warning while trying to delete file when missing in post script [SME: 11375] + +* Sun Feb 21 2021 Jean-Philipe Pialasse 2.7.0-7.sme +- remove spamd reference as service use spamassassin.service [SME: 11375] + migrate spamd propertie SpamLearning to spamassassin + template for /etc/sysconfig/spamassassin, revert --allow-tell option + stop spamassassin spamd and delete /etc/systemd/system/spamassassin.service link if exists + +* Sun Feb 21 2021 Jean-Philipe Pialasse 2.7.0-6.sme +- fix typo [SME: 11361] + +* Thu Feb 18 2021 Jean-Philipe Pialasse 2.7.0-5.sme +- fix spamd unable to load [SME: 11361] +- redirect spamd loging to spamd.log instead of message [SME: 11362] + +* Wed Feb 17 2021 Jean-Philipe Pialasse 2.7.0-4.sme +- add requires DCC as we have built it [SME: 11065] + +* Fri Jan 08 2021 Jean-Philipe Pialasse 2.7.0-3.sme +- fix smeserver-spamassassin-update event fix [SME: 11166] + +* Wed Dec 16 2020 John Crisp 2.7.0-1 +- Start systemd migration. Remove symlinks [SME: 11224] +- remove refresh clam as this will be provided by clamav +- require spamassassin 3.4.4 + + +* Wed Jun 28 2017 Jean-Philipe Pialasse 2.6.0-8.sme +- disable auto_learn by default when enabling Bayes [SME: 8160] +- added properties UseBayesAutoLearn, BayesAutoLearnThresholdSpam and BayesAutoLearnThresholdNonSpam + * Wed Mar 8 2017 Daniel Berteaud 2.6.0-7.sme - Rewrite spamd run script to add support for --allow-tell [SME: 10137] @@ -115,7 +165,7 @@ SME Server - spamassassin anti-spam modu * Tue Oct 7 2008 Shad L. Lords 2.2.0-1.sme - Roll new stream to separate sme7/sme8 trees [SME: 4633] -* Sat Mar 9 2008 chris burnat 1.4.0-18 +* Sat Mar 8 2008 chris burnat 1.4.0-18 - Edit and rename deprecated template fragment [SME: 3857] * Tue Dec 25 2007 Shad L. Lords 1.4.0-17 @@ -440,6 +490,13 @@ SME Server - spamassassin anti-spam modu %setup %patch0 -p1 %patch1 -p1 +rm -rf root/etc/e-smith/templates/usr/ +rm -rf root//usr/lib/systemd/system/spamd.service.d +%patch2 -p1 +%patch3 -p1 +rm -rf root/etc/e-smith/db/configuration/defaults/spamd +mkdir -p root/var/service/qpsmtpd/.spamassassin +%patch4 -p1 %build perl createlinks @@ -449,28 +506,55 @@ rm -rf $RPM_BUILD_ROOT (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) rm -f %{name}-%{version}-%{release}-filelist /sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ - --dir /var/service/spamd 'attr(01755,root,root)' \ - --file /var/service/spamd/down 'attr(0644,root,root)' \ - --file /var/service/spamd/run 'attr(0755,root,root)' \ - --dir /var/service/spamd/log 'attr(0755,root,root)' \ - --dir /var/service/spamd/log/supervise 'attr(0700,root,root)' \ - --dir /var/service/spamd/supervise 'attr(0700,root,root)' \ - --file /var/service/spamd/log/run 'attr(0755,root,root)' \ --dir /var/log/spamd 'attr(2750,smelog,smelog)' \ --dir /var/spool/spamd 'attr(2750,spamd,spamd)' \ --dir /var/spool/spamd/.spamassassin 'attr(2750,spamd,spamd)' \ --file /etc/cron.hourly/sa-restart 'attr(0755,root,root)' \ - --file /usr/bin/refreshclam 'attr(0755,root,root)' \ + --dir /usr/lib/systemd/system/spamd.service.d 'attr(0755,root,root)' \ + --dir /usr/lib/systemd/system/spamassassin.service.d 'attr(0755,root,root)' \ + --dir /var/service/qpsmtpd/.spamassassin 'attr(2750,spamd,spamd)' \ + |grep -v "/var/service/qpsmtpd$" \ + |grep -v "/var/service$" \ > %{name}-%{version}-%{release}-filelist %pre /sbin/e-smith/create-system-user spamd 1005 \ 'spamassassin daemon user' /var/spool/spamd /bin/false +#clean 10.0b1 bad choice +if [[ -L "/etc/systemd/system/spamassassin.service" ]]; then + unlink /etc/systemd/system/spamassassin.service; fi +if [[ -L "/usr/lib/systemd/system/spamassassin.service" ]]; then + /usr/bin/systemctl stop spamd.service + /usr/bin/systemctl stop spamassassin.service +fi + + %clean rm -rf $RPM_BUILD_ROOT %post +# Cleanup old files +if [[ -d /var/lib/spamassassin/3.004000 ]]; then + rm -rf /var/lib/spamassassin/3.004000 2>/dev/null || true +fi + +if [[ ! -d /var/lib/spamassassin/3.004004 ]]; then + echo "Installing new spam databases - please be patient" + nc -z 8.8.8.8 53 >/dev/null 2>&1 + online=$? + if [ $online -eq 0 ]; then + echo "Server Online - updating" + /usr/bin/sa-update -v + else + echo "Offline - please check your network connection and then run sa-update manually" + fi +fi + +if [[ -d /usr/lib/systemd/system/spamd.service.d ]]; then + rm -rf /usr/lib/systemd/system/spamd.service.d +fi + %files -f %{name}-%{version}-%{release}-filelist %defattr(-,root,root)