mirror of https://github.com/fail2ban/fail2ban
Add bcc and dontsend capabilities
parent
7f185a828e
commit
0d6ce7cad3
|
@ -49,6 +49,8 @@ actionban = oifs=${IFS};
|
||||||
IFS=${oifs}
|
IFS=${oifs}
|
||||||
IP=<ip>
|
IP=<ip>
|
||||||
FROM=<sender>
|
FROM=<sender>
|
||||||
|
BCC=<bcc>
|
||||||
|
DONTSEND=<dontsend>
|
||||||
SERVICE=<service>
|
SERVICE=<service>
|
||||||
FAILURES=<failures>
|
FAILURES=<failures>
|
||||||
REPORTID=<time>@<fq-hostname>
|
REPORTID=<time>@<fq-hostname>
|
||||||
|
@ -56,11 +58,16 @@ actionban = oifs=${IFS};
|
||||||
PORT=<port>
|
PORT=<port>
|
||||||
DATE=`LC_ALL=C date --date=@<time> +"%%a, %%d %%h %%Y %%T %%z"`
|
DATE=`LC_ALL=C date --date=@<time> +"%%a, %%d %%h %%Y %%T %%z"`
|
||||||
if [ ! -z "$ADDRESSES" ]; then
|
if [ ! -z "$ADDRESSES" ]; then
|
||||||
oifs=${IFS}; IFS=,; ADDRESSES=$(echo $ADDRESSES)
|
if [ ! -z "$DONTSEND" ]; then
|
||||||
IFS=${oifs}
|
for ckaddr in "${DONTSEND[@]}"; do
|
||||||
|
if [[ "$ADDRESSES" == *"$ckaddr"* ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
(printf -- %%b "<header>\n<message>\n<report>\n\n";
|
(printf -- %%b "<header>\n<message>\n<report>\n\n";
|
||||||
date '+Note: Local timezone is %%z (%%Z)';
|
date '+Note: Local timezone is %%z (%%Z)';
|
||||||
printf -- %%b "\n<ipmatches>\n\n<footer>") | <mailcmd> <mailargs> $ADDRESSES
|
printf -- %%b "\n<ipmatches>\n\n<footer>") | <mailcmd> <mailargs> $ADDRESSES $BCC
|
||||||
fi
|
fi
|
||||||
|
|
||||||
actionunban =
|
actionunban =
|
||||||
|
@ -141,3 +148,11 @@ sender = fail2ban@<fq-hostname>
|
||||||
# Notes.: This is the port number that received the login-attack
|
# Notes.: This is the port number that received the login-attack
|
||||||
port = 0
|
port = 0
|
||||||
|
|
||||||
|
# Option: bcc
|
||||||
|
# Notes: Allows the user to specify a user to receive a copy of the email
|
||||||
|
bcc =
|
||||||
|
|
||||||
|
# Option: dontsend
|
||||||
|
# Notes: Array of abuse emails to ignore. Eg.
|
||||||
|
# dontsend = ('email@one.com' 'email@two.com' 'email@three.com')
|
||||||
|
dontsend =
|
||||||
|
|
Loading…
Reference in New Issue