1 |
# $Id: smeserver-spamassassin.spec,v 1.7 2016/04/20 20:45:45 vip-ire Exp $ |
# $Id: smeserver-spamassassin.spec,v 1.21 2021/02/22 04:23:46 jpp Exp $ |
2 |
|
|
3 |
Summary: SME Server - spamassassin anti-spam module |
Summary: SME Server - spamassassin anti-spam module |
4 |
%define name smeserver-spamassassin |
%define name smeserver-spamassassin |
5 |
Name: %{name} |
Name: %{name} |
6 |
%define version 2.6.0 |
%define version 2.7.0 |
7 |
%define release 7 |
%define release 8 |
8 |
Version: %{version} |
Version: %{version} |
9 |
Release: %{release}%{?dist} |
Release: %{release}%{?dist} |
10 |
License: GPL |
License: GPL |
11 |
Group: Networking/Daemons |
Group: Networking/Daemons |
12 |
Source: %{name}-%{version}.tar.xz |
Source: %{name}-%{version}.tar.xz |
13 |
Patch0: smeserver-spamassassin-2.6.0-add_detailed_header.patch |
Patch0: smeserver-spamassassin-2.7.0-bz11166-update.patch |
14 |
Patch1: smeserver-spamassassin-2.6.0-allow_tell.patch |
Patch1: smeserver-spamassassin-2.7.0-bz11361-spamd-fails.patch |
15 |
|
Patch2: smeserver-spamassassin-2.7.0-bz11362-logging.patch |
16 |
|
Patch3: smeserver-spamassassin-2.7.0-bz11375-remove-spamd.patch |
17 |
|
|
18 |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
19 |
Requires: e-smith-email >= 4.13.0-38 |
Requires: e-smith-email >= 4.13.0-38 |
20 |
Requires: headermatch |
Requires: headermatch |
21 |
Requires: spamassassin >= 3.3.0 |
Requires: spamassassin >= 3.4.4 |
22 |
Requires: perl(Crypt::OpenSSL::Bignum) |
Requires: perl(Crypt::OpenSSL::Bignum) |
23 |
Requires: perl(IO::Socket::INET6) |
Requires: perl(IO::Socket::INET6) |
24 |
Requires: perl(IP::Country) |
Requires: perl(IP::Country) |
30 |
Requires: e-smith-lib >= 1.13.1-90 |
Requires: e-smith-lib >= 1.13.1-90 |
31 |
Requires: e-smith-base >= 4.13.16 |
Requires: e-smith-base >= 4.13.16 |
32 |
Requires: e-smith-qmail >= 1.9.0-09sme02 |
Requires: e-smith-qmail >= 1.9.0-09sme02 |
33 |
|
Requires: smeserver-clamav >= 2.7.0 |
34 |
Requires: perl-Razor-Agent |
Requires: perl-Razor-Agent |
35 |
|
Requires: DCC |
36 |
Requires: pyzor |
Requires: pyzor |
37 |
Obsoletes: FuzzyOcr |
Obsoletes: FuzzyOcr |
38 |
Obsoletes: e-smith-spamassassin |
Obsoletes: e-smith-spamassassin |
45 |
SME Server - spamassassin anti-spam module |
SME Server - spamassassin anti-spam module |
46 |
|
|
47 |
%changelog |
%changelog |
48 |
|
* Tue Feb 23 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-8.sme |
49 |
|
- remove warning while trying to delete file when missing in post script [SME: 11375] |
50 |
|
|
51 |
|
* Sun Feb 21 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-7.sme |
52 |
|
- remove spamd reference as service use spamassassin.service [SME: 11375] |
53 |
|
migrate spamd propertie SpamLearning to spamassassin |
54 |
|
template for /etc/sysconfig/spamassassin, revert --allow-tell option |
55 |
|
stop spamassassin spamd and delete /etc/systemd/system/spamassassin.service link if exists |
56 |
|
|
57 |
|
* Sun Feb 21 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-6.sme |
58 |
|
- fix typo [SME: 11361] |
59 |
|
|
60 |
|
* Thu Feb 18 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-5.sme |
61 |
|
- fix spamd unable to load [SME: 11361] |
62 |
|
- redirect spamd loging to spamd.log instead of message [SME: 11362] |
63 |
|
|
64 |
|
* Wed Feb 17 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-4.sme |
65 |
|
- add requires DCC as we have built it [SME: 11065] |
66 |
|
|
67 |
|
* Fri Jan 08 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-3.sme |
68 |
|
- fix smeserver-spamassassin-update event fix [SME: 11166] |
69 |
|
|
70 |
|
* Wed Dec 16 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 2.7.0-1 |
71 |
|
- Start systemd migration. Remove symlinks [SME: 11224] |
72 |
|
- remove refresh clam as this will be provided by clamav |
73 |
|
- require spamassassin 3.4.4 + |
74 |
|
|
75 |
|
* Wed Jun 28 2017 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-8.sme |
76 |
|
- disable auto_learn by default when enabling Bayes [SME: 8160] |
77 |
|
- added properties UseBayesAutoLearn, BayesAutoLearnThresholdSpam and BayesAutoLearnThresholdNonSpam |
78 |
|
|
79 |
* Wed Mar 8 2017 Daniel Berteaud <daniel@firewall-services.com> 2.6.0-7.sme |
* Wed Mar 8 2017 Daniel Berteaud <daniel@firewall-services.com> 2.6.0-7.sme |
80 |
- Rewrite spamd run script to add support for --allow-tell [SME: 10137] |
- Rewrite spamd run script to add support for --allow-tell [SME: 10137] |
81 |
|
|
476 |
%setup |
%setup |
477 |
%patch0 -p1 |
%patch0 -p1 |
478 |
%patch1 -p1 |
%patch1 -p1 |
479 |
|
rm -rf root/etc/e-smith/templates/usr/ |
480 |
|
rm -rf root//usr/lib/systemd/system/spamd.service.d |
481 |
|
%patch2 -p1 |
482 |
|
%patch3 -p1 |
483 |
|
rm -rf root/etc/e-smith/db/configuration/defaults/spamd |
484 |
|
|
485 |
%build |
%build |
486 |
perl createlinks |
perl createlinks |
490 |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
491 |
rm -f %{name}-%{version}-%{release}-filelist |
rm -f %{name}-%{version}-%{release}-filelist |
492 |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
/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)' \ |
|
493 |
--dir /var/log/spamd 'attr(2750,smelog,smelog)' \ |
--dir /var/log/spamd 'attr(2750,smelog,smelog)' \ |
494 |
--dir /var/spool/spamd 'attr(2750,spamd,spamd)' \ |
--dir /var/spool/spamd 'attr(2750,spamd,spamd)' \ |
495 |
--dir /var/spool/spamd/.spamassassin 'attr(2750,spamd,spamd)' \ |
--dir /var/spool/spamd/.spamassassin 'attr(2750,spamd,spamd)' \ |
496 |
--file /etc/cron.hourly/sa-restart 'attr(0755,root,root)' \ |
--file /etc/cron.hourly/sa-restart 'attr(0755,root,root)' \ |
497 |
--file /usr/bin/refreshclam 'attr(0755,root,root)' \ |
--dir /usr/lib/systemd/system/spamd.service.d 'attr(0755,root,root)' \ |
498 |
|
--dir /usr/lib/systemd/system/spamassassin.service.d 'attr(0755,root,root)' \ |
499 |
> %{name}-%{version}-%{release}-filelist |
> %{name}-%{version}-%{release}-filelist |
500 |
|
|
501 |
%pre |
%pre |
502 |
/sbin/e-smith/create-system-user spamd 1005 \ |
/sbin/e-smith/create-system-user spamd 1005 \ |
503 |
'spamassassin daemon user' /var/spool/spamd /bin/false |
'spamassassin daemon user' /var/spool/spamd /bin/false |
504 |
|
#clean 10.0b1 bad choice |
505 |
|
if [[ -L "/etc/systemd/system/spamassassin.service" ]]; then |
506 |
|
unlink /etc/systemd/system/spamassassin.service; fi |
507 |
|
if [[ -L "/usr/lib/systemd/system/spamassassin.service" ]]; then |
508 |
|
/usr/bin/systemctl stop spamd.service |
509 |
|
/usr/bin/systemctl stop spamassassin.service |
510 |
|
fi |
511 |
|
|
512 |
|
|
513 |
|
|
514 |
%clean |
%clean |
515 |
rm -rf $RPM_BUILD_ROOT |
rm -rf $RPM_BUILD_ROOT |
516 |
|
|
517 |
%post |
%post |
518 |
|
|
519 |
|
# Cleanup old files |
520 |
|
if [[ -d /var/lib/spamassassin/3.004000 ]]; then |
521 |
|
rm -rf /var/lib/spamassassin/3.004000 2>/dev/null || true |
522 |
|
fi |
523 |
|
|
524 |
|
if [[ ! -d /var/lib/spamassassin/3.004004 ]]; then |
525 |
|
echo "Installing new spam databases - please be patient" |
526 |
|
nc -z 8.8.8.8 53 >/dev/null 2>&1 |
527 |
|
online=$? |
528 |
|
if [ $online -eq 0 ]; then |
529 |
|
echo "Server Online - updating" |
530 |
|
/usr/bin/sa-update -v |
531 |
|
else |
532 |
|
echo "Offline - please check your network connection and then run sa-update manually" |
533 |
|
fi |
534 |
|
fi |
535 |
|
|
536 |
|
if [[ -d /usr/lib/systemd/system/spamd.service.d ]]; then |
537 |
|
rm -rf /usr/lib/systemd/system/spamd.service.d |
538 |
|
fi |
539 |
|
|
540 |
%files -f %{name}-%{version}-%{release}-filelist |
%files -f %{name}-%{version}-%{release}-filelist |
541 |
%defattr(-,root,root) |
%defattr(-,root,root) |