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}
|
||||
IP=<ip>
|
||||
FROM=<sender>
|
||||
BCC=<bcc>
|
||||
DONTSEND=<dontsend>
|
||||
SERVICE=<service>
|
||||
FAILURES=<failures>
|
||||
REPORTID=<time>@<fq-hostname>
|
||||
|
@ -56,11 +58,16 @@ actionban = oifs=${IFS};
|
|||
PORT=<port>
|
||||
DATE=`LC_ALL=C date --date=@<time> +"%%a, %%d %%h %%Y %%T %%z"`
|
||||
if [ ! -z "$ADDRESSES" ]; then
|
||||
oifs=${IFS}; IFS=,; ADDRESSES=$(echo $ADDRESSES)
|
||||
IFS=${oifs}
|
||||
if [ ! -z "$DONTSEND" ]; then
|
||||
for ckaddr in "${DONTSEND[@]}"; do
|
||||
if [[ "$ADDRESSES" == *"$ckaddr"* ]]; then
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
fi
|
||||
(printf -- %%b "<header>\n<message>\n<report>\n\n";
|
||||
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
|
||||
|
||||
actionunban =
|
||||
|
@ -141,3 +148,11 @@ sender = fail2ban@<fq-hostname>
|
|||
# Notes.: This is the port number that received the login-attack
|
||||
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