From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id E5DAAC467 for ; Mon, 28 Nov 2022 19:18:16 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B325336FDE for ; Mon, 28 Nov 2022 19:17:46 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 28 Nov 2022 19:17:44 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id B7AD744EF9 for ; Mon, 28 Nov 2022 19:17:43 +0100 (CET) From: Stoiko Ivanov To: pmg-devel@lists.proxmox.com Date: Mon, 28 Nov 2022 19:17:28 +0100 Message-Id: <20221128181729.63076-2-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221128181729.63076-1-s.ivanov@proxmox.com> References: <20221128181729.63076-1-s.ivanov@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.164 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pmg-devel] [PATCH pmg-api 1/2] user-bl: use custom description of USER_IN_BLACKLIST consistently X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2022 18:18:16 -0000 The USER_IN_BLACKLIST spamassassin hit is created by the Spam What object, if the sending e-mail is in the receivers blacklist. This 'hit' is kept on the PMG only - it is not written to the SPAMINFO macro - and only visible in the quarantine interface afaict. The description shown in the quarantine interface, however is read from SpamAssassin sources. They have recently changed to include a 'DEPRECATED' prefix, since the rules containing 'blacklist' and 'whitelist' have been renamed to 'blocklist' and 'welcomelist' for the upcoming 4.0 series of spamassassin. In any case we should keep our description consistent, thus the move to a sub of its own for reusing in both locations. The mechanism for welcomlisted/whitelisted mails does not create an 'internal' sa-rule (but simply drops the SA hits for analysis) - so no symmetric change is needed. Reported-by: Thomas Lamprecht Signed-off-by: Stoiko Ivanov --- src/PMG/RuleDB/Spam.pm | 2 +- src/PMG/Utils.pm | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/PMG/RuleDB/Spam.pm b/src/PMG/RuleDB/Spam.pm index bc1d422..d7bfb63 100644 --- a/src/PMG/RuleDB/Spam.pm +++ b/src/PMG/RuleDB/Spam.pm @@ -221,7 +221,7 @@ sub what_match_targets { sa_data => [{ rule => 'USER_IN_BLACKLIST', score => 100, - desc => 'From: address is in the user black-list', + desc => PMG::Utils::user_bl_description(), }], sa_hits => 'USER_IN_BLACKLIST', }; diff --git a/src/PMG/Utils.pm b/src/PMG/Utils.pm index e20fc91..b9b1478 100644 --- a/src/PMG/Utils.pm +++ b/src/PMG/Utils.pm @@ -1166,6 +1166,10 @@ sub bencode_header { return $res; } +sub user_bl_description { + return 'From: address is in the user black-list'; +} + sub load_sa_descriptions { my ($additional_dirs) = @_; @@ -1202,6 +1206,7 @@ sub load_sa_descriptions { } $res->{'ClamAVHeuristics'}->{desc} = "ClamAV heuristic tests"; + $res->{'USER_IN_BLACKLIST'}->{desc} = user_bl_description();; return $res; } -- 2.30.2