diff --git a/README.md b/README.md index 0f7c4fe..4dab9b4 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ The script generates an HTML report based on rejected messages. Another script c ### PREREQUISITES PERL INTERPRETER Install Perl Package -- Once System is fully updated, you can install perl package through ```yum install perl``` command. +- Once System is fully updated, you can install perl package through ```dnf install perl``` command. Check Perl Version - Since the package is installed now, you can check the Perl version through ```perl -v``` command. @@ -64,4 +64,4 @@ Description Please note that the script ```postfix-bounce-report.sh``` always generates the day before. Note if there are no conflict with your log-rotation jobs. ## LICENSE -postfix-bounce-report and all individual scripts are under the BSD 3-Clause license unless explicitly noted otherwise. Please refer to the LICENSE +postfix-bounce-report and all individual scripts are under the BSD 3-Clause license unless explicitly noted otherwise. Please refer to the LICENSE \ No newline at end of file diff --git a/postfix-bounce-report.sh b/postfix-bounce-report.sh index 9d3796b..fc1c37f 100755 --- a/postfix-bounce-report.sh +++ b/postfix-bounce-report.sh @@ -11,6 +11,7 @@ renice -n 10 $$ > /dev/null export LC_ALL=de_DE.utf8 +# Read XML configuration file and create variables set CONFIGFILE="/root/postfix-bounce-report/config.xml" MAILLOG=$(xmllint --xpath 'string(/config/maillog)' $CONFIGFILE) LOGMAILFROM=$(xmllint --xpath 'string(/config/logmail_from)' $CONFIGFILE) @@ -26,6 +27,7 @@ TIME_START=$(date +"%s") ALLBOUNCES=`cat "${MAILLOG}" |grep "$(date -d '-'${PERIOD}' hour' '+%b %e')" |grep "${PATTERN}"` COUNTBOUNCES=$( [ -n "$ALLBOUNCES" ] && echo "$ALLBOUNCES" | wc -l || echo 0 ) +# Function for creating the HTML report if [ ${COUNTBOUNCES} -gt 0 ]; then MAILINFO='' MAILINFO+='