25f594
From eb8c0256997b8d7f2cccdd37ab78674fe9c769c1 Mon Sep 17 00:00:00 2001
25f594
From: Jan Synacek <jsynacek@redhat.com>
25f594
Date: Tue, 10 May 2016 13:34:05 +0200
25f594
Subject: [PATCH] postfix: fix column alignment in output
25f594
25f594
Some sections are clearly longer than 23 chars, which might result in a
25f594
misaligned output:
25f594
25f594
 3602   Connections                                  3,602
25f594
   82   Connections lost (inbound)                         82
25f594
 3602   Disconnections                               3,602
25f594
25f594
   12   Timeouts (inbound)                              12
25f594
   16   DNS lookup errors                               16
25f594
   46   Hostname verification errors (FCRDNS)                         46
25f594
   49   SMTP protocol violations                         49
25f594
 2154   TLS connections (server)                      2,154
25f594
25f594
Align to 39 chars now, which is currently the length of the longest
25f594
description in the output table plus one.
25f594
---
25f594
 scripts/services/postfix | 4 ++--
25f594
 1 file changed, 2 insertions(+), 2 deletions(-)
25f594
25f594
diff --git a/scripts/services/postfix b/scripts/services/postfix
25f594
index 9f8e07f..ddd5968 100755
25f594
--- a/scripts/services/postfix
25f594
+++ b/scripts/services/postfix
25f594
@@ -1360,7 +1360,7 @@ sub print_summary_report (\@) {
25f594
             my ($numfmt, $desc, $divisor) = ($sref->{FMT}, $sref->{TITLE}, $sref->{DIVISOR});
25f594
 
25f594
             my $fmt   = '%8';
25f594
-            my $extra = ' %25s';
25f594
+            my $extra = ' %9s';
25f594
             my $total = $Totals{$keyname};
25f594
 
25f594
             # Z format provides  unitized or unaltered totals, as appropriate
25f594
@@ -1383,7 +1383,7 @@ sub print_summary_report (\@) {
25f594
             }
25f594
             else {
25f594
                push @{$lines[$cur_level]}, 
25f594
-                  sprintf "$fmt  %-23s $extra\n", $total, $desc, commify ($Totals{$keyname});
25f594
+                  sprintf "$fmt  %-39s $extra\n", $total, $desc, commify ($Totals{$keyname});
25f594
             }
25f594
          }
25f594
       }
25f594
-- 
25f594
2.7.4
25f594