From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id B6FAC1FF13C for ; Thu, 11 Jun 2026 11:26:10 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 676F034892; Thu, 11 Jun 2026 11:26:10 +0200 (CEST) From: Dominik Csapak To: pmg-devel@lists.proxmox.com Subject: [PATCH pmg-api] utils: analyze custom check: remove trailing newline for error output Date: Thu, 11 Jun 2026 11:25:30 +0200 Message-ID: <20260611092536.1329194-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.049 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [utils.pm] Message-ID-Hash: FYMTEES6LCEDI2I3GFPLKQWSSZ53LERB X-Message-ID-Hash: FYMTEES6LCEDI2I3GFPLKQWSSZ53LERB X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Output from a custom check script on stderr gets printed to the syslog with the qid in front so it gets picked up by the log tracker. This would resulut in the log tracker output being something like: `pmg-smtp-filter[4509]: 1093B6A2A7C7E9C6C9: custom check: DEBUG:#012` remove the trailing newline in `log_err` with `chomp` to prevent the `#012` ending up in the syslog and thus log-tracker output. Signed-off-by: Dominik Csapak --- src/PMG/Utils.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PMG/Utils.pm b/src/PMG/Utils.pm index 913679b..80fab76 100644 --- a/src/PMG/Utils.pm +++ b/src/PMG/Utils.pm @@ -404,6 +404,7 @@ sub analyze_custom_check { my $log_err = sub { my ($errmsg) = @_; + chomp ($errmsg); syslog('err', '%s', "$queue->{logid}: custom check: $errmsg"); }; -- 2.47.3