1 |
# $Id: smeserver-spamassassin.spec,v 1.8 2016/01/07 14:16:52 vip-ire Exp $ |
# $Id: smeserver-spamassassin.spec,v 1.26 2023/03/08 09:55:14 jcrisp 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 1 |
%define release 12 |
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.7.0-bz11166-update.patch |
14 |
|
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 |
|
Patch4: smeserver-spamassassin-2.7.0-bz12330-logging-sa4.patch |
18 |
|
|
19 |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
20 |
Requires: e-smith-email >= 4.13.0-38 |
Requires: e-smith-email >= 4.13.0-38 |
21 |
Requires: headermatch |
Requires: headermatch |
22 |
Requires: spamassassin >= 3.3.0 |
Requires: spamassassin >= 4.0.0 |
23 |
Requires: perl(Crypt::OpenSSL::Bignum) |
Requires: perl(Crypt::OpenSSL::Bignum) |
24 |
Requires: perl(IO::Socket::INET6) |
Requires: perl(IO::Socket::INET6) |
25 |
Requires: perl(IP::Country) |
Requires: perl(IP::Country) |
27 |
Requires: perl(Net::Ident) |
Requires: perl(Net::Ident) |
28 |
Requires: perl(Compress::Zlib) |
Requires: perl(Compress::Zlib) |
29 |
Requires: perl(Mail::DKIM) |
Requires: perl(Mail::DKIM) |
30 |
|
Requires: perl(Mail::DMARC) >= 1.20200214 |
31 |
Requires: ucspi-tcp daemontools |
Requires: ucspi-tcp daemontools |
32 |
Requires: e-smith-lib >= 1.13.1-90 |
Requires: e-smith-lib >= 1.13.1-90 |
33 |
Requires: e-smith-base >= 4.13.16 |
Requires: e-smith-base >= 4.13.16 |
34 |
Requires: e-smith-qmail >= 1.9.0-09sme02 |
Requires: e-smith-qmail >= 1.9.0-09sme02 |
35 |
Requires: razor-agents >= 2.61-1 |
Requires: smeserver-clamav >= 2.7.0 |
36 |
|
Requires: perl-Razor-Agent |
37 |
Requires: DCC |
Requires: DCC |
38 |
Requires: pyzor |
Requires: pyzor |
39 |
Obsoletes: FuzzyOcr |
Obsoletes: FuzzyOcr |
47 |
SME Server - spamassassin anti-spam module |
SME Server - spamassassin anti-spam module |
48 |
|
|
49 |
%changelog |
%changelog |
50 |
|
* Wed Jul 05 2023 John Crisp <jcrisp@safeandsoundit.co.uk> 2.7.0-12.sme |
51 |
|
- Add requires perl-Mail-DMARC for spamassassin 4 |
52 |
|
|
53 |
|
* Tue Mar 07 2023 John Crisp <jcrisp@safeandsoundit.co.uk> 2.7.0-11.sme |
54 |
|
- update for Spamassassin 4 - thanks for the patch Zsolt [SME: 12330] |
55 |
|
|
56 |
|
* Wed Apr 07 2021 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-10.sme |
57 |
|
- prevent noise in log at spamassassin call from qpsmtpd [SME: 11491] |
58 |
|
|
59 |
|
* Tue Mar 16 2021 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-9.sme |
60 |
|
- clean rsyslog syntax for spamd [SME: 11422] |
61 |
|
|
62 |
|
* Tue Feb 23 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-8.sme |
63 |
|
- remove warning while trying to delete file when missing in post script [SME: 11375] |
64 |
|
|
65 |
|
* Sun Feb 21 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-7.sme |
66 |
|
- remove spamd reference as service use spamassassin.service [SME: 11375] |
67 |
|
migrate spamd propertie SpamLearning to spamassassin |
68 |
|
template for /etc/sysconfig/spamassassin, revert --allow-tell option |
69 |
|
stop spamassassin spamd and delete /etc/systemd/system/spamassassin.service link if exists |
70 |
|
|
71 |
|
* Sun Feb 21 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-6.sme |
72 |
|
- fix typo [SME: 11361] |
73 |
|
|
74 |
|
* Thu Feb 18 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-5.sme |
75 |
|
- fix spamd unable to load [SME: 11361] |
76 |
|
- redirect spamd loging to spamd.log instead of message [SME: 11362] |
77 |
|
|
78 |
|
* Wed Feb 17 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-4.sme |
79 |
|
- add requires DCC as we have built it [SME: 11065] |
80 |
|
|
81 |
|
* Fri Jan 08 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-3.sme |
82 |
|
- fix smeserver-spamassassin-update event fix [SME: 11166] |
83 |
|
|
84 |
|
* Wed Dec 16 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 2.7.0-1 |
85 |
|
- Start systemd migration. Remove symlinks [SME: 11224] |
86 |
|
- remove refresh clam as this will be provided by clamav |
87 |
|
- require spamassassin 3.4.4 + |
88 |
|
|
89 |
|
* Wed Jun 28 2017 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-8.sme |
90 |
|
- disable auto_learn by default when enabling Bayes [SME: 8160] |
91 |
|
- added properties UseBayesAutoLearn, BayesAutoLearnThresholdSpam and BayesAutoLearnThresholdNonSpam |
92 |
|
|
93 |
|
* Wed Mar 8 2017 Daniel Berteaud <daniel@firewall-services.com> 2.6.0-7.sme |
94 |
|
- Rewrite spamd run script to add support for --allow-tell [SME: 10137] |
95 |
|
|
96 |
|
* Wed Apr 20 2016 Daniel Berteaud <daniel@firewall-services.com> 2.6.0-6.sme |
97 |
|
- Add X-Spam-Details header (and simplify X-Spam-Status) [SME: 9471] |
98 |
|
|
99 |
|
* Fri Mar 18 2016 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-5.sme |
100 |
|
- fix claim to own /usr/bin [SME: 9348] |
101 |
|
- rebuild for Bug [SME: 9347] |
102 |
|
|
103 |
|
* Fri Mar 18 2016 Daniel Berteaud <daniel@firewall-services.com> 2.6.0-4.sme |
104 |
|
- Update dependency for perl-Razor-Agent [SME: 9336] |
105 |
|
|
106 |
|
* Fri Mar 18 2016 Daniel Berteaud <daniel@firewall-services.com> 2.6.0-3.sme |
107 |
|
- Remove dependency on dcc as it's non free software [SME: 9331] |
108 |
|
|
109 |
|
* Fri Mar 18 2016 Jean-Philippe Pialasse <tests@pialasse.com> 2.6.0-2.sme |
110 |
|
- Change Requires DCC to dcc [SME: 9343] |
111 |
|
|
112 |
* Sat Feb 06 2016 stephane de Labrusse <stephdl@de-labrusse.fr> 2.6.0-1.sme |
* Sat Feb 06 2016 stephane de Labrusse <stephdl@de-labrusse.fr> 2.6.0-1.sme |
113 |
- Initial release to sme10 |
- Initial release to sme10 |
114 |
|
|
165 |
* Tue Oct 7 2008 Shad L. Lords <slords@mail.com> 2.2.0-1.sme |
* Tue Oct 7 2008 Shad L. Lords <slords@mail.com> 2.2.0-1.sme |
166 |
- Roll new stream to separate sme7/sme8 trees [SME: 4633] |
- Roll new stream to separate sme7/sme8 trees [SME: 4633] |
167 |
|
|
168 |
* Sat Mar 9 2008 chris burnat <devlist@burnat.com> 1.4.0-18 |
* Sat Mar 8 2008 chris burnat <devlist@burnat.com> 1.4.0-18 |
169 |
- Edit and rename deprecated template fragment [SME: 3857] |
- Edit and rename deprecated template fragment [SME: 3857] |
170 |
|
|
171 |
* Tue Dec 25 2007 Shad L. Lords <slords@mail.com> 1.4.0-17 |
* Tue Dec 25 2007 Shad L. Lords <slords@mail.com> 1.4.0-17 |
488 |
|
|
489 |
%prep |
%prep |
490 |
%setup |
%setup |
491 |
|
%patch0 -p1 |
492 |
|
%patch1 -p1 |
493 |
|
rm -rf root/etc/e-smith/templates/usr/ |
494 |
|
rm -rf root//usr/lib/systemd/system/spamd.service.d |
495 |
|
%patch2 -p1 |
496 |
|
%patch3 -p1 |
497 |
|
rm -rf root/etc/e-smith/db/configuration/defaults/spamd |
498 |
|
mkdir -p root/var/service/qpsmtpd/.spamassassin |
499 |
|
%patch4 -p1 |
500 |
|
|
501 |
%build |
%build |
502 |
perl createlinks |
perl createlinks |
506 |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
507 |
rm -f %{name}-%{version}-%{release}-filelist |
rm -f %{name}-%{version}-%{release}-filelist |
508 |
/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)' \ |
|
509 |
--dir /var/log/spamd 'attr(2750,smelog,smelog)' \ |
--dir /var/log/spamd 'attr(2750,smelog,smelog)' \ |
510 |
--dir /var/spool/spamd 'attr(2750,spamd,spamd)' \ |
--dir /var/spool/spamd 'attr(2750,spamd,spamd)' \ |
511 |
--dir /var/spool/spamd/.spamassassin 'attr(2750,spamd,spamd)' \ |
--dir /var/spool/spamd/.spamassassin 'attr(2750,spamd,spamd)' \ |
512 |
--file /etc/cron.hourly/sa-restart 'attr(0755,root,root)' \ |
--file /etc/cron.hourly/sa-restart 'attr(0755,root,root)' \ |
513 |
--file /usr/bin/refreshclam 'attr(0755,root,root)' \ |
--dir /usr/lib/systemd/system/spamd.service.d 'attr(0755,root,root)' \ |
514 |
|
--dir /usr/lib/systemd/system/spamassassin.service.d 'attr(0755,root,root)' \ |
515 |
|
--dir /var/service/qpsmtpd/.spamassassin 'attr(2750,spamd,spamd)' \ |
516 |
|
|grep -v "/var/service/qpsmtpd$" \ |
517 |
|
|grep -v "/var/service$" \ |
518 |
> %{name}-%{version}-%{release}-filelist |
> %{name}-%{version}-%{release}-filelist |
519 |
|
|
520 |
%pre |
%pre |
521 |
/sbin/e-smith/create-system-user spamd 1005 \ |
/sbin/e-smith/create-system-user spamd 1005 \ |
522 |
'spamassassin daemon user' /var/spool/spamd /bin/false |
'spamassassin daemon user' /var/spool/spamd /bin/false |
523 |
|
#clean 10.0b1 bad choice |
524 |
|
if [[ -L "/etc/systemd/system/spamassassin.service" ]]; then |
525 |
|
unlink /etc/systemd/system/spamassassin.service; fi |
526 |
|
if [[ -L "/usr/lib/systemd/system/spamassassin.service" ]]; then |
527 |
|
/usr/bin/systemctl stop spamd.service |
528 |
|
/usr/bin/systemctl stop spamassassin.service |
529 |
|
fi |
530 |
|
|
531 |
|
|
532 |
|
|
533 |
%clean |
%clean |
534 |
rm -rf $RPM_BUILD_ROOT |
rm -rf $RPM_BUILD_ROOT |
535 |
|
|
536 |
%post |
%post |
537 |
|
|
538 |
|
# Cleanup old files |
539 |
|
if [[ -d /var/lib/spamassassin/3.004000 ]]; then |
540 |
|
rm -rf /var/lib/spamassassin/3.004000 2>/dev/null || true |
541 |
|
fi |
542 |
|
|
543 |
|
if [[ ! -d /var/lib/spamassassin/3.004004 ]]; then |
544 |
|
echo "Installing new spam databases - please be patient" |
545 |
|
nc -z 8.8.8.8 53 >/dev/null 2>&1 |
546 |
|
online=$? |
547 |
|
if [ $online -eq 0 ]; then |
548 |
|
echo "Server Online - updating" |
549 |
|
/usr/bin/sa-update -v |
550 |
|
else |
551 |
|
echo "Offline - please check your network connection and then run sa-update manually" |
552 |
|
fi |
553 |
|
fi |
554 |
|
|
555 |
|
if [[ -d /usr/lib/systemd/system/spamd.service.d ]]; then |
556 |
|
rm -rf /usr/lib/systemd/system/spamd.service.d |
557 |
|
fi |
558 |
|
|
559 |
%files -f %{name}-%{version}-%{release}-filelist |
%files -f %{name}-%{version}-%{release}-filelist |
560 |
%defattr(-,root,root) |
%defattr(-,root,root) |