I noticed today, that the output from the fail2ban script is a bit weired:
root@mail:/# fail2ban
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
Banned in postfix-sasl:
Banned in postfix-sasl:
Banned in postfix-sasl: 58.57.4.238
Banned in postfix-sasl:
iptables: No chain/target/match by that name.
Banned in sshd:
Banned in sshd:
Banned in sshd: 58.57.4.238
Banned in sshd:
My iptables at the time:
root@mail:/# iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
f2b-postfix-sasl tcp -- 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain f2b-postfix-sasl (1 references)
target prot opt source destination
DROP all -- 58.57.4.238 0.0.0.0/0
RETURN all -- 0.0.0.0/0 0.0.0.0/0
As you can see, only one IP is blocked in the f2b-postfix-sasl chain.
However the script reports a lot of empty lines "Banned in " + also falsely reports the IP banned in the sshd chain.
I copied over the version before the refactoring #1654, which outputs correctly:
root@mail:/# bash fail2ban.old
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
Banned in postfix-sasl: 58.57.4.238
iptables: No chain/target/match by that name.
/usr/local/bin/fail2ban
always
Incorrect output
Same output as before the refactoring.
None yet. I will take a closer look by the end of the week. @aendeavor do you have an idea what could be the cause?
Probably due to sloppy work on my side. I will look at this too when I have time. Thanks @casperklein for noticing!
I'm working on it and may have a fix this evening noon. Prepare for review:D