From 6a36ff1a4a4e0b6bf01cf062d56449a7554da506 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Mon, 19 Aug 2013 22:36:58 +1000 Subject: [PATCH] BF: order mailx arguments with dest email address last - redhat bugzilla 998020. Closes gh-328 --- ChangeLog | 9 ++++++--- THANKS | 1 + config/action.d/complain.conf | 2 +- config/action.d/dshield.conf | 6 +++--- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 51539e8c..0d088e0b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,9 +27,12 @@ ver. 0.8.11 (2013/XX/XXX) - loves-unittests Daniel Black & Мернов Георгий * filter.d/dovecot.conf -- Fix when no TLS enabled - line doesn't end in , Daniel Black - * action.d/hostsdeny -- NOTE: new dependancy 'ed'. Switched to use 'ed' across - all platforms to ensure permissions are the same before and after a ban - - closes gh-266. hostsdeny supports daemon_list now too. + * action.d/hostsdeny -- NOTE: new dependancy 'ed'. Switched to use 'ed' across + all platforms to ensure permissions are the same before and after a ban - + closes gh-266. hostsdeny supports daemon_list now too. + Rolf Fokkens + * action.d/dshield.conf and complain.conf -- reorder mailx arguements. + https://bugzilla.redhat.com/show_bug.cgi?id=998020 - New Features: Daniel Black & ykimon * filter.d/3proxy.conf -- filter added diff --git a/THANKS b/THANKS index b853c0dc..ac9eee30 100644 --- a/THANKS +++ b/THANKS @@ -42,6 +42,7 @@ Patrick Börjesson Raphaël Marichez René Berber Robert Edeker +Rolf Fokkens Russell Odom Sebastian Arcus Sireyessire diff --git a/config/action.d/complain.conf b/config/action.d/complain.conf index 4c2de92b..57f19135 100644 --- a/config/action.d/complain.conf +++ b/config/action.d/complain.conf @@ -58,7 +58,7 @@ actioncheck = actionban = ADDRESSES=`whois | perl -e 'while () { next if /^changed|@(ripe|apnic)\.net/io; $m += (/abuse|trouble:|report|spam|security/io?3:0); if (/([a-z0-9_\-\.+]+@[a-z0-9\-]+(\.[[a-z0-9\-]+)+)/io) { while (s/([a-z0-9_\-\.+]+@[a-z0-9\-]+(\.[[a-z0-9\-]+)+)//io) { if ($m) { $a{lc($1)}=$m } else { $b{lc($1)}=$m } } $m=0 } else { $m && --$m } } if (%%a) {print join(",",keys(%%a))} else {print join(",",keys(%%b))}'` IP= if [ ! -z "$ADDRESSES" ]; then - (printf %%b "\n"; date '+Note: Local timezone is %%z (%%Z)'; grep '' ) | "Abuse from " $ADDRESSES + (printf %%b "\n"; date '+Note: Local timezone is %%z (%%Z)'; grep '' ) | "Abuse from " $ADDRESSES fi # Option: actionunban diff --git a/config/action.d/dshield.conf b/config/action.d/dshield.conf index ca68e638..29ed3043 100644 --- a/config/action.d/dshield.conf +++ b/config/action.d/dshield.conf @@ -39,7 +39,7 @@ actionstart = # Values: CMD # actionstop = if [ -f .buffer ]; then - cat .buffer | "FORMAT DSHIELD USERID TZ `date +%%z | sed 's/\([+-]..\)\(..\)/\1:\2/'` Fail2Ban" + cat .buffer | "FORMAT DSHIELD USERID TZ `date +%%z | sed 's/\([+-]..\)\(..\)/\1:\2/'` Fail2Ban" date +%%s > .lastsent fi rm -f .buffer .first @@ -80,7 +80,7 @@ actionban = TZONE=`date +%%z | sed 's/\([+-]..\)\(..\)/\1:\2/'` LASTREPORT=$(($NOW - `cat .lastsent`)) LINES=$( wc -l .buffer | awk '{ print $1 }' ) if [ $LINES -ge && $LASTREPORT -gt ] || [ $LOGAGE -gt ]; then - cat .buffer | "FORMAT DSHIELD USERID TZ $TZONE Fail2Ban" + cat .buffer | "FORMAT DSHIELD USERID TZ $TZONE Fail2Ban" rm -f .buffer .first echo $NOW > .lastsent fi @@ -95,7 +95,7 @@ actionunban = if [ -f .first ]; then NOW=`date +%%s` LOGAGE=$(($NOW - `cat .first`)) if [ $LOGAGE -gt ]; then - cat .buffer | "FORMAT DSHIELD USERID TZ `date +%%z | sed 's/\([+-]..\)\(..\)/\1:\2/'` Fail2Ban" + cat .buffer | "FORMAT DSHIELD USERID TZ `date +%%z | sed 's/\([+-]..\)\(..\)/\1:\2/'` Fail2Ban" rm -f .buffer .first echo $NOW > .lastsent fi