Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 420473 - net-analyzer/fail2ban-0.8.6 violates Date-Mailheader standards when using sendmail*-actions and having set non-english locale
Summary: net-analyzer/fail2ban-0.8.6 violates Date-Mailheader standards when using sen...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords: UPSTREAM
: 437646 (view as bug list)
Depends on: 469950
Blocks:
  Show dependency tree
 
Reported: 2012-06-10 11:39 UTC by Jan Kohnert
Modified: 2013-06-06 16:41 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to fix bug (action.d.patch,3.40 KB, patch)
2012-06-10 11:40 UTC, Jan Kohnert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kohnert 2012-06-10 11:39:06 UTC
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
Comment 1 Jan Kohnert 2012-06-10 11:40:18 UTC
Created attachment 314863 [details, diff]
Patch to fix bug
Comment 2 Michael Weber (RETIRED) gentoo-dev 2012-06-11 10:28:44 UTC
Please comment the output of `emerge -pv net-analyzer/fail2ban`
Comment 3 Jan Kohnert 2012-06-11 22:56:16 UTC
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 ~ #
Comment 4 Mario Kicherer 2012-12-17 10:17:19 UTC
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?
Comment 5 Mario Kicherer 2012-12-17 10:26:39 UTC
Upstream bug report: https://github.com/fail2ban/fail2ban/issues/70
Comment 6 Sergey Popov gentoo-dev 2012-12-17 11:17:57 UTC
*** Bug 437646 has been marked as a duplicate of this bug. ***
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2013-06-06 16:32:27 UTC
Fixed in 0.8.9.
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2013-06-06 16:41:28 UTC
   * [945ad3d9] Fix dates on email actions to work in different locals. Closes
     gh-70. Thanks to iGeorgeX for the idea.