From 487d32d5fbd4e71f43a6341adfaf8ee0f832a30e Mon Sep 17 00:00:00 2001 From: Jordi Sanfeliu Date: Fri, 24 Nov 2023 10:21:21 +0100 Subject: [PATCH] fixed the error message 'Use of uninitialized value '[5]' in join or string at /usr/lib/monitorix/mail.pm line 668 --- lib/mail.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/mail.pm b/lib/mail.pm index 0ad023d..ac1c640 100644 --- a/lib/mail.pm +++ b/lib/mail.pm @@ -630,19 +630,19 @@ sub mail_update { $gen[4] /= 60 if lc($mail->{stats_rate}) eq "per_second"; } + $gen_h[5] = $gen[5] = 0; + $gen_h[6] = $gen[6] = 0; + $gen_h[7] = $gen[7] = 0; + $gen_h[8] = $gen[8] = 0; + $gen_h[9] = $gen[9] = 0; + if(lc($mail->{greylist}) eq "milter-greylist") { - $gen_h[5] = $gen[5] = 0; $gen_h[6] = $gen[6] = int($gl_records) || 0; $gen_h[7] = $gen[7] = int($gl_greylisted) || 0; $gen_h[8] = $gen[8] = int($gl_whitelisted) || 0; $gen_h[9] = $gen[9] = int($gl_delayed) || 0; } if(lc($mail->{greylist}) eq "postgrey") { - $gen_h[5] = $gen[5] = 0; - $gen_h[6] = $gen[6] = 0; - $gen_h[7] = $gen[7] = 0; - $gen_h[8] = $gen[8] = 0; - $gen_h[9] = $gen[9] = 0; # avoid initial peak if(!$first_read) { $gen[6] = int($gl_records);