Skip to content

Commit 3e7af93

Browse files
author
gdt
committed
mail/spamassassin: Update to 4.0.0
Tested on NetBSD 9 amd64 with postfix and spamass-milter. NB the rule renaming below and the modified init.pre, which will not be merged by updating if init.pre is locally modifed. Upstream Release Notes: Introduction ------------ Apache SpamAssassin 4.0.0 contains numerous tweaks and bug fixes over the past releases. In particular, it includes major changes that significantly improve the handling of text in international language. As with any major release, there are countless functional patches and improvements to upgrade to 4.0.0. Apache SpamAssassin 4.0.0 includes several years of fixes that significantly improve classification and performance. It has been thoroughly tested in production systems. We strongly recommend upgrading as soon as possible. Notable features: ================= New plugins ----------- There are three new plugins added with this release: #1 Mail::SpamAssassin::Plugin::ExtractText This plugin uses external tools to extract text from message parts, and then sets the text as the rendered part. All SpamAssassin rules that apply to the rendered part will run on the extracted text as well. #2 Mail::SpamAssassin::Plugin::DMARC This plugin checks if emails match DMARC policy after parsing DKIM and SPF results. #3 Mail::SpamAssassin::Plugin::DecodeShortURLs This plugin looks for URLs shortened by a list of URL shortening services. Upon finding a matching URL, plugin will send a HTTP request to the shortening service and retrieve the Location-header which points to the actual shortened URL. It then adds this URL to the list of URIs extracted by SpamAssassin which can then be accessed by uri rules and plugins such as URIDNSBL. Removed plugin -------------- HashCash module, formerly deprecated, has now been removed completely Notable changes --------------- This release includes fixes for the following: - Support for international text such as UTF-8 rules has been completed and significantly improved to include native UTF-8 processing - Bayes plugin has been improved to skip common words aka noise words written in languages other than English - OLEVBMacro plugin has been improved in order to detect more Microsoft Office macros and dangerous content. It has also been improved to extract URIs from Office documents for automatic inclusion in rules such as RBL lookups. - You can now use Captured Tags to use tags “captured” in one rule inside other rules - sa-update(1) tool has been improved with three new options: #1 forcemirror: forces sa-update to use a specific mirror server, #2 score-multiplier: adjust all scores from update channel by a given multiplier to quickly level set scores to match your preferred threshold #3 score-limit adjusts all scores from update channel over a specified limit to a new limit * SSL client certificate support has been improved and made easier to implement with spamc/spamd * DKIM plugin can now detect ARC signatures * More work on improving the configuration and internal coding to use more inclusive and less divisive language * spamc(1) speed has been improved when both SSL and compression are used * The normalize_charset option is now enabled by default. NOTE: Rules should not expect specific non-UTF-8 or UTF-8 encoding in the body. Matching is done against the raw body, which may vary depending on normalize_charset setting and whether UTF-8 decoding was successful. * Mail::SPF is now the only supported module used by the SPF plugin. * Mail::SPF::Query use is deprecated, along with settings do_not_use_mail_spf, do_not_use_mail_spf_query. * SPF lookups are not done asynchronously and you may consider using an SPF filter at the MTA level (pypolicyd-spf / spf-engine / etc) which generates a Received-SPF header that can be parsed by SpamAssassin. * The default sa-update ruleset doesn't make ASN lookups or header additions anymore. Configure desired methods (asn_use_geodb / asn_use_dns) and add_header clauses manually, as described in documentation for the Mail::SpamAssassin::Plugin::ASN. New configuration options ------------------------- All rules, functions, command line options and modules that contain "whitelist" or "blacklist" have been renamed to "welcomelist" and "blocklist" terms Old options will continue to work for backwards compatibility until at least the Apache SpamAssassin version 4.1.0 release New tflag "nolog" added to hide info coming from rules in SpamAssassin reports New dns_options "nov4" and "nov6" added. IMPORTANT:; You must set nov6 if your DNS resolver is filtering IPv6 AAAA replies. Razor2 razor_fork option added. It will fork separate Razor2 process and read in the results later asynchronously, increasing throughput. When this is used, rule priorities are automatically adjusted to -100. Pyzor pyzor_fork option added. It will fork separate Pyzor process and read in the results later asynchronously, increasing throughput. When this is used, rule priorities are automatically adjusted to -100 urirhsbl and urirhssub rules now support "notrim" tflag, which forces querying the full hostname, instead of trimmed domain report_charset now defaults to UTF-8 which may change the rendering of SpamAssassin reports Notable Internal changes ------------------------ Meta rules no longer use priority values, they are evaluated dynamically when the rules they depend on are finished DNS and other asynchronous lookups like DCC or Razor2 plugins are now launched when priority -100 is reached. This allows short circuiting at lower priority without sending unneeded DNS queries New internal Mail::SpamAssassin::GeoDB module supporting RelayCountry and URILocalBL plugins provides a unified interface to Geographic IP modules. These include: MaxMind::DB::Reader (GeoIP2) Geo::IP IP::Country::DB_File IP::Country::Fast. Bayes and TxRep Message-ID tracking now uses a different hashing method Optimizations ------------- Apache SpamAssassin 4.0.0 represents years of work by the project with numerous improvements, new rule types, and internal native handling of messages in international languages. These three key optimizations will improve the efficiency of SpamAssassin: DNS queries are now done asynchronously for overall speed improvements DCC checks can now use dccifd asynchronously for improved throughput Pyzor and Razor fork use separate processes done asynchronously for increased throughput
1 parent 39def20 commit 3e7af93

File tree

4 files changed

+35
-42
lines changed

4 files changed

+35
-42
lines changed

mail/spamassassin/Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# $NetBSD: Makefile,v 1.147 2022/08/16 14:21:48 wiz Exp $
1+
# $NetBSD: Makefile,v 1.148 2022/12/17 14:29:33 gdt Exp $
22

3-
VERSION= 3.4.6
3+
VERSION= 4.0.0
44
DISTNAME= Mail-SpamAssassin-${VERSION}
55
PKGNAME= spamassassin-${VERSION}
6-
PKGREVISION= 3
76
CATEGORIES= mail perl5
87
MASTER_SITES= ${MASTER_SITE_APACHE:=spamassassin/source/}
98
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
@@ -23,7 +22,7 @@ SMF_METHODS= spamassassin
2322

2423
# The RULESARCHIVE path is taken from the link on the Download page
2524
# reachable from $HOMEPAGE.
26-
RULESARCHIVE= Mail-SpamAssassin-rules-3.4.6.r1888502.tgz
25+
RULESARCHIVE= Mail-SpamAssassin-rules-4.0.0.r1905950.tgz
2726
RULESARCHIVEASC= ${RULESARCHIVE}.asc
2827
#RULESARCHIVESHA= ${RULESARCHIVE}.sha1
2928
FILES_SUBST+= RULESARCHIVE=${RULESDIR}/${RULESARCHIVE}
@@ -38,6 +37,7 @@ DEPENDS+= p5-HTML-Parser>=3.43:../../www/p5-HTML-Parser
3837
#DEPENDS+= {perl>=5.9.3,p5-IO-Compress-[0-9]*}:../../devel/p5-IO-Compress # Compress::Zlib>=0
3938
#DEPENDS+= {perl>=5.9.3,p5-IO-Zlib>=1.04}:../../devel/p5-IO-Zlib
4039
DEPENDS+= p5-Mail-DKIM>=0.40:../../mail/p5-Mail-DKIM
40+
#DEPENDS+= p5-Mail-DMARC-PurePerl-[0-9]*:../../mail/p5-Mail-DMARC-PurePerl
4141
DEPENDS+= p5-Mail-SPF-[0-9]*:../../mail/p5-Mail-SPF
4242
#DEPENDS+= {p5-MIME-Base64>=2.11,perl>=5.8.0}:../../converters/p5-MIME-Base64
4343
DEPENDS+= p5-NetAddr-IP>=4.007:../../net/p5-NetAddr-IP
@@ -103,7 +103,7 @@ DOCDIR= ${PREFIX}/${DOC_SUBDIR}
103103
RULE_SUBDIR= share/spamassassin
104104
RULESDIR= ${PREFIX}/${RULE_SUBDIR}
105105

106-
PRE_FILES= init.pre v310.pre v312.pre v320.pre v330.pre v340.pre
106+
PRE_FILES= init.pre v310.pre v312.pre v320.pre v330.pre v340.pre v400.pre
107107
.for p in ${PRE_FILES}
108108
CONF_FILES+= ${EGDIR}/${p} ${PKG_SYSCONFDIR}/${p}
109109
.endfor
@@ -141,7 +141,7 @@ SUBST_VARS.sa2+= VARBASE
141141
SUBST_CLASSES+= sa3
142142
SUBST_MESSAGE.sa3= Setting correct paths for pkgsrc (part 2)
143143
SUBST_STAGE.sa3= pre-configure
144-
SUBST_FILES.sa3= INSTALL UPGRADE USAGE ldap/README
144+
SUBST_FILES.sa3= INSTALL USAGE ldap/README
145145
SUBST_FILES.sa3+= spamc/README.qmail spamc/spamc.pod
146146
SUBST_FILES.sa3+= lib/Mail/SpamAssassin/Conf.pm
147147
SUBST_FILES.sa3+= lib/Mail/SpamAssassin/Plugin/Test.pm

mail/spamassassin/distinfo

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
$NetBSD: distinfo,v 1.80 2022/08/16 14:21:48 wiz Exp $
1+
$NetBSD: distinfo,v 1.81 2022/12/17 14:29:33 gdt Exp $
22

3-
BLAKE2s (Mail-SpamAssassin-3.4.6.tar.gz) = d330863c4775e9dfc3ffb8158e3b145a3e43ff9122e686a074be7c2d1a2cb65d
4-
SHA512 (Mail-SpamAssassin-3.4.6.tar.gz) = 7910852f04463a7363a2fc3b70a35adadf5714552e57c5b8ca57beaa534ee18d9f06526cdbcf8bcd5781e5ca778f98d2f84ef2efd1872fa550cfe1689440364a
5-
Size (Mail-SpamAssassin-3.4.6.tar.gz) = 6572574 bytes
6-
BLAKE2s (Mail-SpamAssassin-rules-3.4.6.r1888502.tgz) = 5ac6070924cf3093fda442bf1cbc059ea3dd98df0d9eea7eaad45eea6f7a177e
7-
SHA512 (Mail-SpamAssassin-rules-3.4.6.r1888502.tgz) = 29167c2ab50de26954181ad53395d4270b8b15b7d3bb13d6c62aa2f13ed3bb7a54adcda944bbd4c8d0cf4fe918a2eb0f542ef420af2bd96a121cb3d9b55dd572
8-
Size (Mail-SpamAssassin-rules-3.4.6.r1888502.tgz) = 369768 bytes
9-
BLAKE2s (Mail-SpamAssassin-rules-3.4.6.r1888502.tgz.asc) = e1c0171d935698f2f3241a45ae16e34d990727ba8c0d6195e658eb77e4959b04
10-
SHA512 (Mail-SpamAssassin-rules-3.4.6.r1888502.tgz.asc) = 97066dfe751aa067b14368ebd0388666522257945bd0fd37d921371682209be6bd658199ca817bb0dd345c4ddb1cebe02015ca9ca3a33f167d68b7d029a07b0c
11-
Size (Mail-SpamAssassin-rules-3.4.6.r1888502.tgz.asc) = 833 bytes
12-
SHA1 (patch-Makefile.PL) = bcf48afe3adce57fbe4ff0de583ca23bf5177aab
3+
BLAKE2s (Mail-SpamAssassin-4.0.0.tar.gz) = fdcc278214de88b9796e678b5902ded5100e2c30dbb5725c4b5aea027980e340
4+
SHA512 (Mail-SpamAssassin-4.0.0.tar.gz) = db8e5d0249d9fabfa89bc4c7309a7eafd103ae07617ed9bd32e6b35473c5efc05b1a913b4a3d4bb0ff19093400e3510ae602bf9e96290c63e7946a1d0df6de47
5+
Size (Mail-SpamAssassin-4.0.0.tar.gz) = 6779828 bytes
6+
BLAKE2s (Mail-SpamAssassin-rules-4.0.0.r1905950.tgz) = f69d64dbe6ac98e556013540cf61889b8013dbca890577a1142a4ef6f5d33a5f
7+
SHA512 (Mail-SpamAssassin-rules-4.0.0.r1905950.tgz) = 8ff0e68e18dc52a88fec83239bb9dc3a1d34f2dcb4c03cd6c566b97fa91242e3c8d006612aeb4df0acf43929eaaa59d542eb5cf904498343adf5eadefcb89255
8+
Size (Mail-SpamAssassin-rules-4.0.0.r1905950.tgz) = 355737 bytes
9+
BLAKE2s (Mail-SpamAssassin-rules-4.0.0.r1905950.tgz.asc) = 445aee22649a330357df398cd0694535cd09e83abbaf8f3d338de5f842ed8160
10+
SHA512 (Mail-SpamAssassin-rules-4.0.0.r1905950.tgz.asc) = 517dbf83b4cf984036cb7cbf92a290ea0c8eea1da87f80d202275e71d2823b7b2eed4efff2f71742ca28090d355a690346f1bf97cfc15a3ea26a6d52792b1882
11+
Size (Mail-SpamAssassin-rules-4.0.0.r1905950.tgz.asc) = 833 bytes
12+
SHA1 (patch-Makefile.PL) = f190b064069506aa9afb1b6ecd8affea78104699
1313
SHA1 (patch-README) = 5d2aaecc4791e4f76df1078c17036cc23a39a8d0
1414
SHA1 (patch-ae) = e6e83c1de1002b8db647779d17740e67103b69d8
1515
SHA1 (patch-sa-update) = 0cac6f2315db8f80cd313473e8d141b49edb791f
16-
SHA1 (patch-spamc_libspamc.c) = 757b845df445414d4ba0c2fb039dbc6d9e68b85f
16+
SHA1 (patch-spamc_libspamc.c) = 6e634b5e4e795bd1e2bddbe4b192e2826de8ba5a
1717
SHA1 (patch-spamd_netbsd-rc-script.sh) = 192fc1876ee30a4475c0efd9be6340e87d9fa2f4

mail/spamassassin/patches/patch-Makefile.PL

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
$NetBSD: patch-Makefile.PL,v 1.6 2020/03/23 18:45:47 gdt Exp $
1+
$NetBSD: patch-Makefile.PL,v 1.7 2022/12/17 14:29:33 gdt Exp $
22

33
- enable build of qmail-spamc
44
- some files (local.cf, *.pre) are managed by pkgsrc, disable
55
their installation.
66
- pkgsrc creates B_DATADIR, so there is no need to re-set permissions
77

8-
--- Makefile.PL.orig 2020-01-25 02:51:33.000000000 +0000
8+
--- Makefile.PL.orig 2022-12-06 23:27:28.000000000 +0000
99
+++ Makefile.PL
10-
@@ -139,6 +139,7 @@ my %makefile = (
10+
@@ -134,6 +134,7 @@ my %makefile = (
1111
'spamassassin.raw' => 'spamassassin',
1212
'sa-learn.raw' => 'sa-learn',
1313
'sa-update.raw' => 'sa-update',
1414
+ 'spamc/qmail-spamc.c' => 'spamc/qmail-spamc$(EXE_EXT)',
1515
'sa-compile.raw' => 'sa-compile',
1616
'sa-awl.raw' => 'sa-awl',
1717
'sa-check_spamd.raw' => 'sa-check_spamd',
18-
@@ -1120,22 +1121,24 @@ qmail/qmail-spamc$(EXE_EXT): spamc/qmail
18+
@@ -1150,23 +1151,25 @@ qmail/qmail-spamc$(EXE_EXT): spamc/qmail
1919

2020
conf__install:
2121
-$(MKPATH) $(B_CONFDIR)
@@ -29,6 +29,7 @@ $NetBSD: patch-Makefile.PL,v 1.6 2020/03/23 18:45:47 gdt Exp $
2929
- $(PERL) -MFile::Copy -e "copy(q[rules/v341.pre], q[$(B_CONFDIR)/v341.pre]) unless -f q[$(B_CONFDIR)/v341.pre]"
3030
- $(PERL) -MFile::Copy -e "copy(q[rules/v342.pre], q[$(B_CONFDIR)/v342.pre]) unless -f q[$(B_CONFDIR)/v342.pre]"
3131
- $(PERL) -MFile::Copy -e "copy(q[rules/v343.pre], q[$(B_CONFDIR)/v343.pre]) unless -f q[$(B_CONFDIR)/v343.pre]"
32+
- $(PERL) -MFile::Copy -e "copy(q[rules/v400.pre], q[$(B_CONFDIR)/v400.pre]) unless -f q[$(B_CONFDIR)/v400.pre]"
3233
+ # manage local.cf and *.pre through pkgsrc .mk files
3334
+ # $(PERL) -MFile::Copy -e "copy(q[rules/local.cf], q[$(B_CONFDIR)/local.cf]) unless -f q[$(B_CONFDIR)/local.cf]"
3435
+ # $(PERL) -MFile::Copy -e "copy(q[rules/init.pre], q[$(B_CONFDIR)/init.pre]) unless -f q[$(B_CONFDIR)/init.pre]"
@@ -40,6 +41,7 @@ $NetBSD: patch-Makefile.PL,v 1.6 2020/03/23 18:45:47 gdt Exp $
4041
+ # $(PERL) -MFile::Copy -e "copy(q[rules/v341.pre], q[$(B_CONFDIR)/v341.pre]) unless -f q[$(B_CONFDIR)/v341.pre]"
4142
+ # $(PERL) -MFile::Copy -e "copy(q[rules/v342.pre], q[$(B_CONFDIR)/v342.pre]) unless -f q[$(B_CONFDIR)/v342.pre]"
4243
+ # $(PERL) -MFile::Copy -e "copy(q[rules/v343.pre], q[$(B_CONFDIR)/v343.pre]) unless -f q[$(B_CONFDIR)/v343.pre]"
44+
+ # $(PERL) -MFile::Copy -e "copy(q[rules/v400.pre], q[$(B_CONFDIR)/v400.pre]) unless -f q[$(B_CONFDIR)/v400.pre]"
4345

4446
data__install:
4547
-$(MKPATH) $(B_DATADIR)
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
1-
$NetBSD: patch-spamc_libspamc.c,v 1.2 2018/10/18 19:54:32 bsiegert Exp $
1+
$NetBSD: patch-spamc_libspamc.c,v 1.3 2022/12/17 14:29:33 gdt Exp $
22

33
Set the client protocol to TLS instead of SSLv3.
44
Fixes build with current openssl.
55

6-
--- spamc/libspamc.c.orig 2015-04-28 19:56:59.000000000 +0000
6+
--- spamc/libspamc.c.orig 2022-12-06 23:27:29.000000000 +0000
77
+++ spamc/libspamc.c
8-
@@ -1214,7 +1214,7 @@
9-
if (flags & SPAMC_USE_SSL) {
10-
#ifdef SPAMC_SSL
11-
SSLeay_add_ssl_algorithms();
12-
- meth = SSLv23_client_method();
13-
+ meth = TLSv1_client_method();
14-
SSL_load_error_strings();
15-
ctx = SSL_CTX_new(meth);
16-
#else
17-
@@ -1601,7 +1601,7 @@
18-
if (flags & SPAMC_USE_SSL) {
19-
#ifdef SPAMC_SSL
20-
SSLeay_add_ssl_algorithms();
21-
- meth = SSLv23_client_method();
22-
+ meth = TLSv1_client_method();
23-
SSL_load_error_strings();
24-
ctx = SSL_CTX_new(meth);
25-
#else
8+
@@ -636,7 +636,7 @@ static SSL_CTX * _try_ssl_ctx_init(int f
9+
SSLeay_add_ssl_algorithms();
10+
SSL_load_error_strings();
11+
/* this method allows negotiation of version */
12+
- meth = SSLv23_client_method();
13+
+ meth = TLSv1_client_method();
14+
ctx = SSL_CTX_new(meth);
15+
if (ctx == NULL) {
16+
libspamc_log(flags, LOG_ERR, "cannot create SSL CTX context: %s",

0 commit comments

Comments
 (0)