Compare commits

..

No commits in common. "rawhide" and "f40" have entirely different histories.

8 changed files with 185 additions and 154 deletions

View file

@ -1,17 +1,43 @@
Notes for Spamassassin for RHEL or Fedora
=========================================
Upstream spamassassin is no longer distributed with rules. Our package
spamassassin-3.3.x RPM package for RHEL 5+ or Fedora 11+ contains some new
functionality beyond the upstream spamassassin documentation.
Upstream spamassassin-3.3.0 is no longer distributed with rules. Our package
contains rules in order to be less of a surprise to system administrators.
However just as you wouldn't rely on antivirus software without signature
updates, spamassassin cannot be relied upon without regular rule updates.
A systemd timer unit/service is provided to do this daily.
1) For these reasons, our RPM package now runs nightly sa-update by default.
Note that the update script runs sa-update only if a known spam
/etc/cron.d/sa-update
The default cron runs sa-update once every night. You may edit this cron
file to change the schedule of sa-update or to disable it entirely. If you
had modified this file in the past you may need to restore the new file
from /etc/cron.d/sa-update.rpmnew
2) /usr/share/spamassassin/sa-update.cron
This script is executed by cron. It runs sa-update only if a known spam
daemon is running: spamd, amavisd, or mimedefang. If you do not run any
of these spam daemons but wish to have nightly sa-update, you may
override the daemon check in /etc/sysconfig/sa-update
/etc/mail/spamassassin/channel.d
3) /etc/mail/spamassassin/channel.d
All sa-update channels are defined in files contained in this directory.
See the existing config files as examples for writing your own config file.
General Warnings
================
* DO NOT USE SARE or OpenProtect rules. They are old and outdated, and
can be dangerous. Many of the useful rules have been integrated into
upstream spamassassin.
Note about -d option
====================
With spamassassin 3.4.0, this package has switched the way spamd is started.
You should no longer use the '-d' option in /etc/sysconfig/spamassassin. Doing
so will result in spamd starting and stopping in a loop. The default
/etc/sysconfig/spamassassin file has been adjusted for this, please merge
this change into that file if you have made any changes to it.

1
ci.fmf
View file

@ -1 +0,0 @@
resultsdb-testcase: separate

View file

@ -1,25 +1,16 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_testing
decision_contexts: [bodhi_update_push_testing]
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/tier1-public.functional}
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
#Rawhide
#gating rawhide
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
decision_contexts: [bodhi_update_push_stable]
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/tier1-public.functional}
#gating rhel
--- !Policy
product_versions:
- rhel-*
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/tier1-public.functional}
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/tier1-internal.functional}
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

View file

@ -1,35 +0,0 @@
/tier1-internal:
plan:
import:
url: https://gitlab.com/redhat/centos-stream/tests/spamassassin.git
name: /plans/tier1/internal
/tier1-public:
plan:
import:
url: https://gitlab.com/redhat/centos-stream/tests/spamassassin.git
name: /plans/tier1/public
/tier2-tier3-internal:
plan:
import:
url: https://gitlab.com/redhat/centos-stream/tests/spamassassin.git
name: /plans/tier2-tier3/internal
/tier2-tier3-public:
plan:
import:
url: https://gitlab.com/redhat/centos-stream/tests/spamassassin.git
name: /plans/tier2-tier3/public
/others-internal:
plan:
import:
url: https://gitlab.com/redhat/centos-stream/tests/spamassassin.git
name: /plans/others/internal
/others-public:
plan:
import:
url: https://gitlab.com/redhat/centos-stream/tests/spamassassin.git
name: /plans/others/public

6
plans/all.fmf Normal file
View file

@ -0,0 +1,6 @@
summary: Test plan with all Fedora tests
discover:
how: fmf
url: https://src.fedoraproject.org/tests/spamassassin.git
execute:
how: tmt

View file

@ -1,4 +1,4 @@
SHA512 (Mail-SpamAssassin-4.0.2.tar.bz2) = 05917f1a897e22569ab9e5130d4f91cb546db2e28fceed7bd904ea211f2684d863cf30960db750e2c99f2ea4f3119b61353714760257a3f57e898f0d11ce6cdb
SHA512 (Mail-SpamAssassin-4.0.2.tar.bz2.asc) = e4f09fcfcdaf5faea287daf385f6ccad961a18e422c7535ea0c3d7a47ccd205fde9fdb818fa5d9ccd118238c8a35dd51e17ab0718e9ea6373c3e5f89897893c2
SHA512 (Mail-SpamAssassin-rules-4.0.2.r1928015.tgz) = 5d51b127602b314a5f4e583f4341ebb0e76f6c43deb9a5f489d9781ece7a8d42bff21eac75b1ce248a03c376168b3c89002336070bc19475ec048d1064650266
SHA512 (Mail-SpamAssassin-rules-4.0.2.r1928015.tgz.asc) = 8f79ef812fbac456872d7e39b7fd0409f7d6989619e0c03aacd359c6c44a3ecd66d24ef7c54d1bd9f6770e095c4473112606f3aeea38ef11b8607faa8ff54fbd
SHA512 (Mail-SpamAssassin-4.0.1.tar.bz2) = 66183e356b07d1049cf5598fc1e563e4aab580dfca04bf8ec37781dfb57ef568d33c6f6455076f54f940947f5a5dfefa7a08d233833deea5fe5ea18b669cd790
SHA512 (Mail-SpamAssassin-4.0.1.tar.bz2.asc) = b180080c1692684014680a6873f42ed07d1640c40a6e3e330cfb43235bb3e3008f5e21018fbc0e9cba67ab6d9ba5b87cc2d98c3bed15c9503164dacdfdaef9df
SHA512 (Mail-SpamAssassin-rules-4.0.1.r1916528.tgz) = 7e6093c8514e1b18f3b47215dc97d51b7b70142ca2fe7242362c021bf770b2c1c1e99a8227d1c5b9b5d303e405ab9e6a7c67a60b5b03dcb6588bd68c733e2448
SHA512 (Mail-SpamAssassin-rules-4.0.1.r1916528.tgz.asc) = d9e83656021f65a5272c1881f13e83534bff1f6250e1abfbbed72054161d70a8fafd7695ea7477384677ee02dfcca4951ae97c94010ce443faafa6f705325ac7

View file

@ -1,44 +0,0 @@
diff -u -r Mail-SpamAssassin-4.0.1.orig/INSTALL Mail-SpamAssassin-4.0.1/INSTALL
--- Mail-SpamAssassin-4.0.1.orig/INSTALL 2024-11-28 15:46:04.746114884 +0100
+++ Mail-SpamAssassin-4.0.1/INSTALL 2024-11-28 15:46:41.689348148 +0100
@@ -410,13 +410,6 @@
If you do not plan to use this plugin, be sure to comment out its
loadplugin line in "/etc/mail/spamassassin/v310.pre".
- - Digest::SHA1 (from CPAN)
-
- An external perl module razor-agents-2.84 as used by a Razor2 plugin
- seems to be the only remaining component depending on Digest::SHA1 (note
- that a packager may ship a patched version of razor-agents which can use
- Digest::SHA instead)
-
- LWP::UserAgent (aka libwww-perl) (from CPAN)
Can be used by sa-update to retrieve update archives, as alternative to
diff -u -r Mail-SpamAssassin-4.0.1.orig/lib/Mail/SpamAssassin/Util/DependencyInfo.pm Mail-SpamAssassin-4.0.1/lib/Mail/SpamAssassin/Util/DependencyInfo.pm
--- Mail-SpamAssassin-4.0.1.orig/lib/Mail/SpamAssassin/Util/DependencyInfo.pm 2024-11-28 15:46:04.773115054 +0100
+++ Mail-SpamAssassin-4.0.1/lib/Mail/SpamAssassin/Util/DependencyInfo.pm 2024-11-29 09:39:44.359950894 +0100
@@ -91,12 +91,6 @@
our @OPTIONAL_MODULES = (
{
- 'module' => 'Digest::SHA1',
- 'version' => 0,
- 'desc' => 'The Digest::SHA1 module is still required by the Razor2 plugin.
- Other modules prefer Digest::SHA, which is a Perl base module.',
-},
-{
module => 'MIME::Base64',
version => 0,
desc => 'This module is highly recommended to increase the speed with which
diff -u -r Mail-SpamAssassin-4.0.1.orig/t/rule_names.t Mail-SpamAssassin-4.0.1/t/rule_names.t
--- Mail-SpamAssassin-4.0.1.orig/t/rule_names.t 2024-11-28 15:46:04.750114909 +0100
+++ Mail-SpamAssassin-4.0.1/t/rule_names.t 2024-11-28 15:47:21.093596927 +0100
@@ -8,7 +8,6 @@
BEGIN {
eval { require Digest::SHA; Digest::SHA->import(qw(sha1)); 1 }
- or do { require Digest::SHA1; Digest::SHA1->import(qw(sha1)) }
}
our $RUN_THIS_TEST;

View file

@ -1,6 +1,49 @@
# OVERRIDE RHEL VERSION HERE, RHEL BUILDSYSTEM DOESN'T HAVE DIST TAG
#%%define rhel 4
# Define dist tags for old RHEL releases
%if 0%{?rhel} == 4
%define dist .el4
%endif
%if 0%{?rhel} == 5
%define dist .el5
%endif
%if 0%{?rhel} == 6
%define dist .el6
%endif
# Define variables to use in conditionals
%define option_ssl 0
%define perl_devel 0
%define dkim_deps 0
%global patricia_deps 0
%global razor_deps 0
%define require_encode_detect 0
%define use_systemd 0
# SSL and IPv6 (FC6+, RHEL5+)
%if 0%{?fedora} > 5 || 0%{?rhel} >= 5
%define option_ssl 1
%endif
# Split perl-devel (FC7+ and RHEL-8+)
%if 0%{?fedora} > 6 || 0%{?rhel} > 7
%define perl_devel 1
%endif
# Encode::Detect, not strictly required but helpful if you enable language detection (FC7+)
%if 0%{?fedora} > 6 || 0%{?rhel} >= 6
%define require_encode_detect 1
%endif
# Mail::DKIM by default (F11+)
%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
%define dkim_deps 1
%endif
%if 0%{?fedora} >= 16 || 0%{?rhel} >= 7
%define use_systemd 1
%endif
%if ! 0%{?rhel}
%global patricia_deps 1
@ -10,19 +53,19 @@
%define real_name Mail-SpamAssassin
%{!?perl_vendorlib: %define perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)}
%global saversion 4.000002
%global saversion 4.000001
#%%global prerev rc2
Summary: Spam filter for email which can be invoked from mail delivery agents
Name: spamassassin
Version: 4.0.2
Version: 4.0.1
#Release: 0.8.%%{prerev}%%{?dist}
Release: 2%{?dist}
License: Apache-2.0
URL: https://spamassassin.apache.org/
Source0: https://www.apache.org/dist/%{name}/source/%{real_name}-%{version}.tar.bz2
#Source0: %%{real_name}-%%{version}-%%{prerev}.tar.bz2
Source1: https://downloads.apache.org/%{name}/source/%{real_name}-rules-%{version}.r1928015.tgz
Source1: https://www.apache.org/dist/%{name}/source/%{real_name}-rules-%{version}.r1916528.tgz
#Source1: %%{real_name}-rules-%%{version}.%%{prerev}.tgz
Source2: redhat_local.cf
Source3: spamassassin-default.rc
@ -35,14 +78,16 @@ Source9: sa-update.force-sysconfig
Source10: spamassassin-helper.sh
Source11: spamassassin-official.conf
Source13: README.RHEL.Fedora
%if %{use_systemd}
Source14: spamassassin.service
%endif
Source15: spamassassin.sysconfig.el
Source16: sa-update.service
Source17: sa-update.timer
# GPG Keys and source signatures
Source100: https://www.apache.org/dist/%{name}/source/%{real_name}-%{version}.tar.bz2.asc
Source101: https://www.apache.org/dist/%{name}/source/%{real_name}-rules-%{version}.r1928015.tgz.asc
Source101: https://www.apache.org/dist/%{name}/source/%{real_name}-rules-%{version}.r1916528.tgz.asc
Source102: https://www.apache.org/dist/spamassassin/KEYS
# Patches 0-99 are RH specific
@ -51,9 +96,10 @@ Source102: https://www.apache.org/dist/spamassassin/KEYS
Patch0: spamassassin-4.0.0-gnupg2.patch
# add a logfile and homedir for razor
Patch1: spamassassin-4.0.0-add-logfile-homedir-options.patch
# Removing of Digest::SHA1 dependency, perl-Razor-Agent hasn't this in Fedora
Patch2: spamassassin-4.0.1-remove_dep_to_digest_sha1.patch
# end of patches
%if %{use_systemd} == 0
Requires: /sbin/chkconfig /sbin/service
%endif
Requires(post): diffutils
BuildRequires: make
@ -71,18 +117,31 @@ BuildRequires: perl(DB_File)
BuildRequires: perl(Mail::SPF)
BuildRequires: perl(Net::CIDR::Lite)
BuildRequires: perl(LWP::UserAgent)
BuildRequires: perl(Digest::SHA1)
BuildRequires: perl(Test::More)
# Fedora package needs fixing before we can depend on it
#BuildRequires: re2c
%if %{use_systemd}
BuildRequires: systemd-units
%endif
Requires: perl(HTTP::Date)
Requires: perl(LWP::UserAgent)
Requires: perl(Net::DNS)
Requires: perl(Time::HiRes)
Requires: perl(DB_File)
Requires: perl(Mail::SPF)
Requires: perl(Net::CIDR::Lite)
%if %{require_encode_detect}
Requires: perl(Encode::Detect)
%endif
Requires: perl(BSD::Resource)
Requires: procmail
Requires: gnupg2
Requires: perl(XSLoader)
Requires: perl(ExtUtils::MakeMaker)
# Fedora package needs fixing before we can depend on it
#Requires: re2c
# Hard requirements
BuildRequires: perl-HTML-Parser >= 3.43
@ -100,21 +159,39 @@ Requires: perl-Razor-Agent
BuildRequires: perl-Razor-Agent
%endif
%if %{option_ssl}
# Needed for spamc/spamd SSL
Requires: perl(IO::Socket::SSL)
BuildRequires: perl(IO::Socket::SSL)
# Needed for IPv6
Requires: perl(IO::Socket::IP)
BuildRequires: perl(IO::Socket::IP)
%endif
%if %{perl_devel}
BuildRequires: perl-devel
%endif
# Mail::DKIM for F12+, works from RHEL5+ from EPEL5 but we don't require them
%if %{dkim_deps}
Requires: perl(Mail::DKIM)
BuildRequires: perl(Mail::DKIM)
BuildRequires: perl(Mail::DMARC)
Requires: perl(Mail::DMARC)
%endif
%if %{use_systemd}
Requires(post): systemd-units
Requires(post): systemd-sysv
Requires(preun): systemd-units
Requires(postun): systemd-units
%endif
# For completeness, explicitly require perl modules already
# pulled in by perl-interpreter
Requires: perl(Digest::SHA)
Requires: perl(Socket)
Requires: perl(Data::Dumper)
Requires: perl(Digest::MD5)
Requires: perl(Errno)
Requires: perl(Exporter)
Requires: perl(List::Util)
%description
SpamAssassin provides you with a way to reduce if not completely eliminate
@ -133,20 +210,6 @@ INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc
To filter spam for all users, add that line to /etc/procmailrc
(creating if necessary).
%package compile
Summary: Spamassassin sa-compile
BuildRequires: re2c
Requires: re2c
Requires: perl(XSLoader)
Requires: perl(ExtUtils::MakeMaker)
Requires: %{name} = %{version}-%{release}
%description compile
This subpackage provides the 'sa-compile' tool.
sa-compile uses "re2c" to compile the site-wide parts of the SpamAssassin ruleset.
%prep
%{gpgverify} --keyring='%{SOURCE102}' --signature='%{SOURCE100}' --data='%{SOURCE0}'
%{gpgverify} --keyring='%{SOURCE102}' --signature='%{SOURCE101}' --data='%{SOURCE1}'
@ -154,7 +217,6 @@ sa-compile uses "re2c" to compile the site-wide parts of the SpamAssassin rulese
# Patches 0-99 are RH specific
%patch 0 -p1
%patch 1 -p1
%patch 2 -p1
# end of patches
echo "RHEL=%{?rhel} FEDORA=%{?fedora}"
@ -173,11 +235,20 @@ rm -rf $RPM_BUILD_ROOT
LOCAL_RULES_DIR=%{buildroot}/etc/mail/spamassassin
chmod 755 %buildroot/%{_bindir}/* # allow stripping
%if %{use_systemd} == 0
install -d %buildroot/%{_initrddir}
install -m 0755 spamd/redhat-rc-script.sh %buildroot/%{_initrddir}/spamassassin
%endif
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/local.cf
%if %{use_systemd}
install -m644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/spamassassin
%else
install -m644 %{SOURCE15} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/spamassassin
%endif
install -m 0644 %{SOURCE3} %buildroot/etc/mail/spamassassin
install -m 0644 %{SOURCE4} %buildroot/etc/mail/spamassassin
@ -186,13 +257,19 @@ install -m 0755 %{SOURCE10} %buildroot/etc/mail/spamassassin
install -m 0644 %{SOURCE6} %buildroot/etc/logrotate.d/sa-update
%if %{use_systemd} == 0
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/cron.d
install -m 0644 %{SOURCE7} %buildroot/etc/cron.d/sa-update
%endif
install -m 0644 %{SOURCE9} %buildroot%{_sysconfdir}/sysconfig/sa-update
# installed mode 744 as non root users can't run it, but can read it.
install -m 0744 %{SOURCE8} %buildroot%{_datadir}/spamassassin/sa-update.cron
%if %{use_systemd}
mkdir -p %buildroot%{_unitdir}
install -m 0644 %{SOURCE14} %buildroot%{_unitdir}/spamassassin.service
install -m 0644 %{SOURCE16} %buildroot%{_unitdir}/sa-update.service
install -m 0644 %{SOURCE17} %buildroot%{_unitdir}/sa-update.timer
%endif
[ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress
@ -233,6 +310,10 @@ mkdir -m 0700 -p $RPM_BUILD_ROOT%{_sharedstatedir}/razor/
%doc LICENSE NOTICE CREDITS Changes README TRADEMARK UPGRADE
%doc USAGE sample-nonspam.txt sample-spam.txt
%doc README.RHEL.Fedora
%if %{use_systemd} == 0
%{_initrddir}/spamassassin
%{_sysconfdir}/cron.d/sa-update
%endif
%dir %{_sysconfdir}/mail
%config(noreplace) %{_sysconfdir}/mail/spamassassin
%config(noreplace) %{_sysconfdir}/sysconfig/spamassassin
@ -243,19 +324,21 @@ mkdir -m 0700 -p $RPM_BUILD_ROOT%{_sharedstatedir}/razor/
%dir %{_sharedstatedir}/razor
%endif
%config(noreplace) %{_sysconfdir}/logrotate.d/sa-update
%if %{use_systemd}
%{_unitdir}/spamassassin.service
%{_unitdir}/sa-update.service
%{_unitdir}/sa-update.timer
%exclude %{_bindir}/sa-compile
%exclude %{_mandir}/man1/sa-compile.1.gz
%files compile
%{_bindir}/sa-compile
%{_mandir}/man1/sa-compile.1.gz
%endif
%post
%if %{use_systemd} == 0
/sbin/chkconfig --add spamassassin
%endif
%if %{use_systemd}
%systemd_post spamassassin.service
%systemd_post sa-update.timer
%endif
# -a and --auto-whitelist options were removed from 3.0.0
# prevent service startup failure
@ -275,40 +358,45 @@ if [ -f /etc/mail/spamassassin.cf ]; then
fi
%postun
%if %{use_systemd} == 0
if [ "$1" -ge "1" ]; then
/sbin/service spamassassin condrestart > /dev/null 2>&1
fi
exit 0
%endif
%if %{use_systemd}
%systemd_postun spamassassin.service
%systemd_postun sa-update.timer
%endif
%preun
%if %{razor_deps}
rm -f %{_sharedstatedir}/razor/*
%endif
%if %{use_systemd} == 0
if [ $1 = 0 ] ; then
/sbin/service spamassassin stop >/dev/null 2>&1
/sbin/chkconfig --del spamassassin
fi
exit 0
%endif
%if %{use_systemd}
%systemd_preun spamassassin.service
%systemd_preun sa-update.timer
%endif
%if %{use_systemd}
%triggerun -- spamassassin < 3.3.2-2
%{_bindir}/systemd-sysv-convert --save spamassassin >/dev/null 2>&1 ||:
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del spamassassin >/dev/null 2>&1 || :
/bin/systemctl try-restart spamassassin.service >/dev/null 2>&1 || :
%endif
%changelog
* Sat Jan 03 2026 Kevin Fenzi <kevin@scrye.com> - 4.0.2-2
- Add perl-Mail-DMARC requirement to enable DMARC plugin. Fixes rhbz#2316684
* Thu Sep 04 2025 Kevin Fenzi <kevin@scrye.com> - 4.0.2-1
- Update to 4.0.2. Fixes rhbz#2392141
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Sun Jan 19 2025 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Fri Nov 29 2024 Michal Josef Špaček <mspacek@redhat.com> - 4.0.1-5
- Remove dependency to Digest::SHA1
- Remove duplicite requires, they are generated
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Mon May 27 2024 Kevin Fenzi <kevin@scrye.com> - 4.0.1-3
- CLean up and modernize spec
- Move sa-compile to a subpackage to reduce deps
* Sat Apr 13 2024 Kevin Fenzi <kevin@scrye.com> - 4.0.1-2
- Fix saversion for 4.0.1