lol

Merge pull request #233282 from pkern/spamassassin

spamassassin: 3.4.6 → 4.0.0

authored by

Luke Granger-Brown and committed by
GitHub
cba7cd9b 3192b8eb

+127 -18
+2
nixos/doc/manual/release-notes/rl-2311.section.md
··· 50 50 51 51 - `services.lemmy.settings.federation` was removed in 0.17.0 and no longer has any effect. To enable federation, the hostname must be set in the configuration file and then federation must be enabled in the admin web UI. See the [release notes](https://github.com/LemmyNet/lemmy/blob/c32585b03429f0f76d1e4ff738786321a0a9df98/RELEASES.md#upgrade-instructions) for more details. 52 52 53 + - `spamassassin` no longer supports the `Hashcash` module. The module needs to be removed from the `loadplugin` list if it was copied over from the default `initPreConf` option. 54 + 53 55 ## Other Notable Changes {#sec-release-23.11-notable-changes} 54 56 55 57 - The Cinnamon module now enables XDG desktop integration by default. If you are experiencing collisions related to xdg-desktop-portal-gtk you can safely remove `xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];` from your NixOS configuration.
+1 -1
nixos/modules/services/mail/spamassassin.nix
··· 77 77 loadplugin Mail::SpamAssassin::Plugin::Check 78 78 #loadplugin Mail::SpamAssassin::Plugin::DCC 79 79 loadplugin Mail::SpamAssassin::Plugin::DKIM 80 + loadplugin Mail::SpamAssassin::Plugin::DMARC 80 81 loadplugin Mail::SpamAssassin::Plugin::DNSEval 81 82 loadplugin Mail::SpamAssassin::Plugin::FreeMail 82 - loadplugin Mail::SpamAssassin::Plugin::Hashcash 83 83 loadplugin Mail::SpamAssassin::Plugin::HeaderEval 84 84 loadplugin Mail::SpamAssassin::Plugin::HTMLEval 85 85 loadplugin Mail::SpamAssassin::Plugin::HTTPSMismatch
+46 -17
pkgs/servers/mail/spamassassin/default.nix
··· 1 - { lib, fetchurl, perlPackages, makeWrapper, gnupg, re2c, gcc, gnumake }: 1 + { lib, fetchurl, perlPackages, makeBinaryWrapper, gnupg, re2c, gcc, gnumake, libxcrypt, openssl, coreutils, poppler_utils, tesseract, iana-etc }: 2 2 3 3 perlPackages.buildPerlPackage rec { 4 4 pname = "SpamAssassin"; 5 - version = "3.4.6"; 5 + version = "4.0.0"; 6 6 7 7 src = fetchurl { 8 8 url = "mirror://apache/spamassassin/source/Mail-${pname}-${version}.tar.bz2"; 9 - sha256 = "044ng2aazqy8g0m17q0a4939ck1ca4x230q2q7q7jndvwkrpaj5w"; 9 + hash = "sha256-5aoXBQowvHK6qGr9xgSMrepNHsLsxh14dxegWbgxnog="; 10 10 }; 11 11 12 - # ExtUtil::MakeMaker is bundled with Perl, but the bundled version 13 - # causes build errors for aarch64-darwin, so we override it with the 14 - # latest version. We can drop the dependency to go back to the 15 - # bundled version when the version that comes with Perl is ≥7.57_02. 16 - # 17 - # Check the version bundled with Perl like this: 18 - # perl -e 'use ExtUtils::MakeMaker qw($VERSION); print "$VERSION\n"' 19 - nativeBuildInputs = [ makeWrapper perlPackages.ExtUtilsMakeMaker ]; 12 + patches = [ 13 + ./satest-no-clean-path.patch 14 + ./sa_compile-use-perl5lib.patch 15 + ]; 16 + 17 + nativeBuildInputs = [ makeBinaryWrapper ]; 20 18 buildInputs = (with perlPackages; [ 21 19 HTMLParser NetCIDRLite NetDNS NetAddrIP DBFile HTTPDate MailDKIM LWP 22 20 LWPProtocolHttps IOSocketSSL DBI EncodeDetect IPCountry NetIdent 23 21 Razor2ClientAgent MailSPF NetDNSResolverProgrammable Socket6 24 - ]); 22 + ArchiveZip EmailAddressXS NetLibIDN2 MaxMindDBReader GeoIP MailDMARC 23 + MaxMindDBReaderXS 24 + ]) ++ [ 25 + openssl 26 + ]; 25 27 26 - # Enabling 'taint' mode is desirable, but that flag disables support 27 - # for the PERL5LIB environment variable. Needs further investigation. 28 - makeFlags = [ "PERL_BIN=${perlPackages.perl}/bin/perl" "PERL_TAINT=no" ]; 28 + makeFlags = [ "PERL_BIN=${perlPackages.perl}/bin/perl" "ENABLE_SSL=yes" ]; 29 29 30 30 makeMakerFlags = [ "SYSCONFDIR=/etc LOCALSTATEDIR=/var/lib/spamassassin" ]; 31 31 32 - doCheck = false; 32 + checkInputs = (with perlPackages; [ 33 + TextDiff # t/strip2.t 34 + ]) ++ [ 35 + coreutils # date, t/basic_meta.t 36 + poppler_utils # pdftotext, t/extracttext.t 37 + tesseract # tesseract, t/extracttext.t 38 + iana-etc # t/dnsbl_subtests.t (/etc/protocols used by Net::DNS::Nameserver) 39 + re2c gcc gnumake 40 + ]; 41 + preCheck = '' 42 + substituteInPlace t/spamc_x_e.t \ 43 + --replace "/bin/echo" "${coreutils}/bin/echo" 44 + export C_INCLUDE_PATH='${lib.makeSearchPathOutput "include" "include" [ libxcrypt ]}' 45 + export HARNESS_OPTIONS="j''${NIX_BUILD_CORES}" 46 + 47 + export HOME=$NIX_BUILD_TOP/home 48 + mkdir -p $HOME 49 + mkdir t/log # pre-create to avoid race conditions 50 + ''; 33 51 34 52 postInstall = '' 35 53 mkdir -p $out/share/spamassassin 36 54 mv "rules/"* $out/share/spamassassin/ 37 55 38 56 for n in "$out/bin/"*; do 39 - wrapProgram "$n" --prefix PERL5LIB : "$PERL5LIB" --prefix PATH : ${lib.makeBinPath [ gnupg re2c gcc gnumake ]} 57 + # Skip if this isn't a perl script 58 + if ! head -n1 "$n" | grep -q bin/perl; then 59 + continue 60 + fi 61 + echo "Wrapping $n for taint mode" 62 + orig="$out/bin/.$(basename "$n")-wrapped" 63 + mv "$n" "$orig" 64 + # We don't inherit argv0 so that $^X works properly in e.g. sa-compile 65 + makeWrapper "${perlPackages.perl}/bin/perl" "$n" \ 66 + --add-flags "-T $perlFlags $orig" \ 67 + --prefix PATH : ${lib.makeBinPath [ gnupg re2c gcc gnumake ]} \ 68 + --prefix C_INCLUDE_PATH : ${lib.makeSearchPathOutput "include" "include" [ libxcrypt ]} 40 69 done 41 70 ''; 42 71
+23
pkgs/servers/mail/spamassassin/sa_compile-use-perl5lib.patch
··· 1 + diff -ru orig/t/sa_compile.t new/t/sa_compile.t 2 + --- orig/t/sa_compile.t 2022-12-14 06:03:26.000000000 +0000 3 + +++ new/t/sa_compile.t 2023-06-25 12:30:39.735577152 +0000 4 + @@ -40,7 +40,7 @@ 5 + 6 + # we now have an "installed" version we can run sa-compile with. Ensure 7 + # sarun() will use it appropriately 8 + -$scr = "$instdir/$temp_binpath/spamassassin"; 9 + +$scr = "$perl_cmd -T $instdir/$temp_binpath/spamassassin"; 10 + $scr_localrules_args = $scr_cf_args = ""; # use the default rules dir, from our "install" 11 + 12 + &set_rules(' 13 + @@ -86,8 +86,8 @@ 14 + # ------------------------------------------------------------------- 15 + 16 + rmtree( glob "~/.spamassassin/sa-compile.cache". { safe => 1 }); # reset test 17 + -system_or_die "TMP=$instdir TMPDIR=$instdir $instdir/$temp_binpath/sa-compile --quiet -p $cwd/$workdir/user.cf --keep-tmps -D 2>$instdir/sa-compile.debug"; # --debug 18 + -$scr = "$instdir/$temp_binpath/spamassassin"; 19 + +system_or_die "TMP=$instdir TMPDIR=$instdir $perl_cmd -T $instdir/$temp_binpath/sa-compile --quiet -p $cwd/$workdir/user.cf --keep-tmps -D 2>$instdir/sa-compile.debug"; # --debug 20 + +$scr = "$perl_cmd -T $instdir/$temp_binpath/spamassassin"; 21 + $scr_localrules_args = $scr_cf_args = ""; # use the default rules dir, from our "install" 22 + 23 + %patterns = (
+18
pkgs/servers/mail/spamassassin/satest-no-clean-path.patch
··· 1 + diff -ru orig/t/SATest.pm new/t/SATest.pm 2 + --- orig/t/SATest.pm 2023-06-25 11:26:27.663204415 +0000 3 + +++ new/t/SATest.pm 2023-06-25 11:34:08.902174669 +0000 4 + @@ -65,9 +65,12 @@ 5 + 6 + # Clean PATH so taint doesn't complain 7 + if (!$RUNNING_ON_WINDOWS) { 8 + - $ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin'; 9 + + # untaint PATH 10 + + $ENV{'PATH'} =~ /^(.+)$/; 11 + + $ENV{'PATH'} = $1; 12 + + # $ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin'; 13 + # Remove tainted envs, at least ENV used in FreeBSD 14 + - delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; 15 + + # delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; 16 + } else { 17 + # Windows might need non-system directories in PATH to run a Perl installation 18 + # The best we can do is clean out obviously bad stuff such as relative paths or \..\
+37
pkgs/top-level/perl-packages.nix
··· 14256 14256 }; 14257 14257 }; 14258 14258 14259 + MailDMARC = buildPerlPackage { 14260 + pname = "Mail-DMARC"; 14261 + version = "1.20230215"; 14262 + src = fetchurl { 14263 + url = "mirror://cpan/authors/id/M/MB/MBRADSHAW/Mail-DMARC-1.20230215.tar.gz"; 14264 + hash = "sha256-V9z1R1nLkkSOVukUE0D2E0QnTFjZ3WWqkKqczw5+uQM="; 14265 + }; 14266 + buildInputs = [ ExtUtilsMakeMaker FileShareDirInstall ]; 14267 + doCheck = false; # uses actual DNS at runtime 14268 + checkInputs = [ XMLSAX XMLValidatorSchema TestException TestFileShareDir TestMore TestOutput ]; 14269 + propagatedBuildInputs = [ 14270 + ConfigTiny DBDSQLite DBIxSimple EmailMIME EmailSender Encode FileShareDir GetoptLong 14271 + IOCompress IO IOSocketSSL NetDNS NetIDNEncode NetIP NetSSLeay RegexpCommon Socket6 14272 + SysSyslog URI XMLLibXML 14273 + ]; 14274 + meta = { 14275 + description = "Perl implementation of DMARC"; 14276 + homepage = "https://github.com/msimerson/mail-dmarc"; 14277 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 14278 + }; 14279 + }; 14280 + 14259 14281 MailMaildir = buildPerlPackage { 14260 14282 version = "1.0.0"; 14261 14283 pname = "Mail-Maildir"; ··· 17997 18019 meta = { 17998 18020 description = "Test Net::LDAP code"; 17999 18021 homepage = "https://github.com/karpet/net-ldap-server-test"; 18022 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 18023 + }; 18024 + }; 18025 + 18026 + NetLibIDN2 = buildPerlModule { 18027 + pname = "Net-LibIDN2"; 18028 + version = "1.02"; 18029 + src = fetchurl { 18030 + url = "mirror://cpan/authors/id/T/TH/THOR/Net-LibIDN2-1.02.tar.gz"; 18031 + hash = "sha256-0fMK/GrPplQbAMCafkx059jkuknjJ3wLvEGuNcE5DQc="; 18032 + }; 18033 + propagatedBuildInputs = [ pkgs.libidn2 ]; 18034 + meta = { 18035 + description = "Perl bindings for GNU Libidn2"; 18036 + homepage = "https://github.com/gnuthor/Net--LibIDN2"; 18000 18037 license = with lib.licenses; [ artistic1 gpl1Plus ]; 18001 18038 }; 18002 18039 };