[pmg-devel] [PATCH api] fix #3758: allow empty `to` in noqueue case

Mira Limbeck m.limbeck at proxmox.com
Wed Dec 1 16:41:58 CET 2021


Signed-off-by: Mira Limbeck <m.limbeck at 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





More information about the pmg-devel mailing list