]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
workaround --headers bug with spamc(1)
authorEric Wong <e@80x24.org>
Thu, 7 Dec 2023 23:32:14 +0000 (23:32 +0000)
committerEric Wong <e@80x24.org>
Fri, 8 Dec 2023 00:06:43 +0000 (00:06 +0000)
As of SpamAssassin 4.0.0, spamc(1) corrupts messages with NUL in
the body when the `--headers' switch is used.  This increases
transport costs, but most spamc/spamd setups are via local
sockets, so it's unlikely to be significant.

Link: https://bugs.debian.org/1057749
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
lib/PublicInbox/Spamcheck/Spamc.pm
scripts/dc-dlvr

index 798de2185282f17296345cd3d290825a7a21d4e9..b4f95e2ba496ee192a62e2f7060230716f345ee9 100644 (file)
@@ -11,7 +11,7 @@ use Fcntl qw(SEEK_SET);
 sub new {
        my ($class) = @_;
        bless {
-               checkcmd => [qw(spamc -E --headers)],
+               checkcmd => [qw(spamc -E)],
                hamcmd => [qw(spamc -L ham)],
                spamcmd => [qw(spamc -L spam)],
        }, $class;
index 935a8312d8527970c2bb435fc7b5c6bda15bb46f..ef6033b95422114a1f0bbf3fdbf71a19ec6c505a 100755 (executable)
@@ -47,9 +47,9 @@ then
        rm_list="$rm_list $PREMSG"
        set +e
        mv -f $TMPMSG $PREMSG
-       $spamc -E --headers <$PREMSG >$TMPMSG
+       $spamc -E <$PREMSG >$TMPMSG
 else
-       $spamc -E --headers <$CDMSG >$TMPMSG
+       $spamc -E <$CDMSG >$TMPMSG
 fi
 err=$?