public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [PATCH pmg-api 2/2] pmg-smtp-filter: log-headers: trim trailing whitespace
Date: Thu, 11 Jun 2026 10:57:01 +0200	[thread overview]
Message-ID: <20260611085708.1121041-3-s.ivanov@proxmox.com> (raw)
In-Reply-To: <20260611085708.1121041-1-s.ivanov@proxmox.com>

Reported-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 src/bin/pmg-smtp-filter | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/bin/pmg-smtp-filter b/src/bin/pmg-smtp-filter
index 7f9cdb85..7aa5865c 100755
--- a/src/bin/pmg-smtp-filter
+++ b/src/bin/pmg-smtp-filter
@@ -714,6 +714,7 @@ sub handle_smtp {
                 $value = PMG::Utils::decode_rfc1522($value);
                 # remove non-printable and Unicode format chars to avoid log injection and spoofing
                 $value =~ s/[^\p{XPosixPrint}]|\p{Cf}/ /g;
+                $value =~ s/^\s+|\s+$//g;;
                 return encode('UTF-8', substr($value, 0, 512));
             };
             # separate line on purpose, so the log-tracker does not parse it as an event
-- 
2.47.3





  parent reply	other threads:[~2026-06-11  8:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11  8:56 [PATCH pmg-api 0/2] small improvements for log-header functionality Stoiko Ivanov
2026-06-11  8:57 ` [PATCH pmg-api 1/2] config: add log-headers to pmg-smtp-filter parameters Stoiko Ivanov
2026-06-11  9:06   ` Dominik Csapak
2026-06-11  8:57 ` Stoiko Ivanov [this message]
2026-06-11  9:09   ` [PATCH pmg-api 2/2] pmg-smtp-filter: log-headers: trim trailing whitespace Dominik Csapak
2026-06-11 10:16 ` superseded: [PATCH pmg-api 0/2] small improvements for log-header functionality Stoiko Ivanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260611085708.1121041-3-s.ivanov@proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal