]> git.proxmox.com Git - pmg-api.git/commitdiff
api: mail tracker: cleanup strang assginment of declaration pattern
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 13 May 2020 11:46:45 +0000 (13:46 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 13 May 2020 11:46:45 +0000 (13:46 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PMG/API2/MailTracker.pm

index 88ece6efdb5d61bb97d03165171b25439309e613..c4779ed03e3fbb9e44436de4c29c2462aea76525 100644 (file)
@@ -126,17 +126,19 @@ my $run_pmg_log_tracker = sub {
            } elsif ($line =~ m/^CTIME:\s+([0-9A-F]+)$/) {
                # ignore ?
            } elsif ($line =~ m/^TO:([0-9A-F]+):([0-9A-F]+):([0-9A-Z]):\s+from <([^>]*)>\s+to\s+<([^>]+)>\s+\((\S+)\)$/) {
-               my $new = {};
-               $new->{size} = $entry->{size} // 0,
+               my $new = {
+                   size => $entry->{size} // 0,
+                   time => hex($1) - $timezone,
+                   qid => $2,
+                   dstatus => $3,
+                   from => $4,
+                   to => $5,
+                   relay => $6,
+               };
                $new->{client} = $entry->{client} if defined($entry->{client});
                $new->{msgid} = $entry->{msgid} if defined($entry->{msgid});
-               $new->{time} = hex($1) - $timezone;
-               $new->{dstatus} = my $dstatus = $3;
-               $new->{qid} = my $qid = $2;
-               $new->{from} = $4;
-               $new->{to} = my $to = $5;
-               $new->{relay} = $6;
 
+               my $dstatus = $new->{dstatus};
                if ($dstatus =~ /P|D|R/) {
                    my $before_queue_status = {
                        P => '2',
@@ -148,6 +150,8 @@ my $run_pmg_log_tracker = sub {
                }
 
                push @$list, $new;
+
+               my ($qid, $to) = $new->@{'qid', 'to'};
                $lookup_hash->{$qid}->{$to} = $new;
            } elsif ($line =~ m/^(SMTP|FILTER|QMGR):/) {
                if ($logids->{$entry->{qid}}) {