I found an error in the fail2ban configuration files for sending a mail after an action via sendmail. To set the Mailheader Date:, it simply uses the date-command. Unfortunately it does not ensure the system locale to be C, or equivalent, so the send date can be invalid depending on the system locale. The attacted patch fixes the situation by explicitly setting the locatle the "C" when calling the date-command. Reproducible: Always
Created attachment 314863 [details, diff] Patch to fix bug
Please comment the output of `emerge -pv net-analyzer/fail2ban`
Sorry, forgotten input, but there it goes: b079 ~ # emerge -pv fail2ban These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] net-analyzer/fail2ban-0.8.6 USE="(-selinux)" 0 kB Total: 1 package (1 reinstall), Size of downloads: 0 kB b079 ~ #
I can confirm this bug for LC_TIME=de_DE.UTF-8 locale. I fixed it by switching from sendmail-whois to mail-whois action. The latter does not set the date header manually. Shouldn't the patch set LC_TIME variable instead of LANG?
Upstream bug report: https://github.com/fail2ban/fail2ban/issues/70
*** Bug 437646 has been marked as a duplicate of this bug. ***
Fixed in 0.8.9.
* [945ad3d9] Fix dates on email actions to work in different locals. Closes gh-70. Thanks to iGeorgeX for the idea.