From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 801DE1F406; Thu, 7 Dec 2023 23:32:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1701991934; bh=W6nT9XuSrn0lJH/5nkeXWv653IzOSoX6ozb5pU6/xIk=; h=Date:From:To:Cc:Subject:From; b=ebBTKsktpa6L2gpvMGlHEMMT8RJipFirh1uhKEu28DAnmf1U+AIJR/guaBATQue6i m15g482UJ4CfzCsseMWQyrO9nRG1PSIafcBYx05zOqbj4cNGq8PtH55RL+QPTNdpNc fQA++VUClYxzDTsl9uUGGPgihQDKQFjpg674ipDs= Date: Thu, 7 Dec 2023 23:32:14 +0000 From: Eric Wong To: meta@public-inbox.org Cc: Andrew Cooper Subject: [PATCH] workaround --headers bug with spamc(1) Message-ID: <20231207233214.M492093@dcvr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline List-Id: 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 --- More C projects should take a hint from git and ban most str*(3) functions :P lib/PublicInbox/Spamcheck/Spamc.pm | 2 +- scripts/dc-dlvr | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/Spamcheck/Spamc.pm b/lib/PublicInbox/Spamcheck/Spamc.pm index 798de218..b4f95e2b 100644 --- a/lib/PublicInbox/Spamcheck/Spamc.pm +++ b/lib/PublicInbox/Spamcheck/Spamc.pm @@ -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; diff --git a/scripts/dc-dlvr b/scripts/dc-dlvr index 935a8312..ef6033b9 100755 --- a/scripts/dc-dlvr +++ b/scripts/dc-dlvr @@ -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=$?