public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Mira Limbeck <m.limbeck@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH api] fix #3758: allow empty `to` in noqueue case
Date: Wed,  1 Dec 2021 16:41:58 +0100	[thread overview]
Message-ID: <20211201154158.322637-2-m.limbeck@proxmox.com> (raw)
In-Reply-To: <20211201154158.322637-1-m.limbeck@proxmox.com>

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
---
 src/PMG/API2/MailTracker.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/PMG/API2/MailTracker.pm b/src/PMG/API2/MailTracker.pm
index 187decf..b8b25ad 100644
--- a/src/PMG/API2/MailTracker.pm
+++ b/src/PMG/API2/MailTracker.pm
@@ -171,13 +171,14 @@ my $run_pmg_log_tracker = sub {
 		$entry->{client} = $1;
 	    } elsif ($line =~ m/^CTIME:\s+([0-9A-F]+)$/) {
 		# ignore ?
-	    } elsif ($line =~ m/^TO:([0-9A-F]+):(T[0-9A-F]+L[0-9A-F]+):([0-9A-Z]):\s+from <([^>]*)>\s+to\s+<([^>]+)>$/) {
+	    } elsif ($line =~ m/^TO:([0-9A-F]+):(T[0-9A-F]+L[0-9A-F]+):([0-9A-Z]):\s+from <([^>]*)>\s+to\s+<([^>]*)>$/) {
 		my $e = {};
 		$e->{client} = $entry->{client} if defined($entry->{client});
 		$e->{time} = hex($1) - $timezone;
 		$e->{id} = $2;
 		$e->{dstatus} = $3;
 		$e->{from} = $4;
+		die "empty to address only allowed in NOQUEUE case\n" if !$5 && $e->{dstatus} ne 'N';
 		$e->{to} = $5;
 		push @$list, $e;
 	    } elsif ($line =~ m/^LOGS:$/) {
-- 
2.30.2





  reply	other threads:[~2021-12-01 15:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01 15:41 [pmg-devel] [PATCH log-tracker] fix #3758: fix `to` filter with empty NoqueueEntry `to` field Mira Limbeck
2021-12-01 15:41 ` Mira Limbeck [this message]
2021-12-01 18:13   ` [pmg-devel] applied: [PATCH api] fix #3758: allow empty `to` in noqueue case Stoiko Ivanov
2021-12-01 18:19     ` Thomas Lamprecht
2021-12-01 18:21 ` [pmg-devel] applied: [PATCH log-tracker] fix #3758: fix `to` filter with empty NoqueueEntry `to` field 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=20211201154158.322637-2-m.limbeck@proxmox.com \
    --to=m.limbeck@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