diff --git a/Makefile.PL b/Makefile.PL index 41a5ef9..6e4ca8f 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -312,6 +312,12 @@ EXCLUDE_RELAY addr1\@domain1.com|addr2\@domain2.com # When enabled it allow email subjects to be shown in detailed view. Of course # The log file must contain this information. SHOW_SUBJECT 0 + +# When activated, remove domain part of the syslog hostname. Some programme +# use FQDN instead of the single hostname. Set it to 1 if you have two report +# for the same hostname but one with the domain part. +NO_HOST_DOMAIN 0 + }; close(OUTCFG); diff --git a/sendmailanalyzer b/sendmailanalyzer index ec75ace..f251ddc 100755 --- a/sendmailanalyzer +++ b/sendmailanalyzer @@ -459,6 +459,10 @@ sub parse_common_fields # Get current system time my $ctime = &format_time(localtime(time)); + # Remove domain part of the host + if ($CONFIG{NO_HOST_DOMAIN}) { + $host =~ s/\..*//; + } my $date = ''; if ($month =~ /(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)/) { $date = "$1$2$3";