]> git.proxmox.com Git - pmg-api.git/commitdiff
fix #3758: allow empty `to` in noqueue case
authorMira Limbeck <m.limbeck@proxmox.com>
Wed, 1 Dec 2021 15:41:58 +0000 (16:41 +0100)
committerStoiko Ivanov <s.ivanov@proxmox.com>
Wed, 1 Dec 2021 18:08:54 +0000 (19:08 +0100)
Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
src/PMG/API2/MailTracker.pm

index 187decfd924230e7c4b34f47471c5a86ea4e3c91..b8b25ade2fac17d38cb8e4c62dc198cb978faf2a 100644 (file)
@@ -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:$/) {