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