Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date in mail is in localized format which cause mail client behave weird #70

Ansud opened this issue Aug 4, 2012 · 8 comments


Copy link

@Ansud Ansud commented Aug 4, 2012

Thunderbird think, that mail came from 1970 year.

To solve this problem, you should change in config files:

  • Date: `date -u +"%%a, %%d %%h %%Y %%T +0000"`
  • Date: `date --rfc-2822 -u +"%%a, %%d %%h %%Y %%T +0000"`
Copy link

@yarikoptic yarikoptic commented Aug 6, 2012

more like date --rfc-2822 -u I guess... My dilemma is that this option is not supported on OS X... although this proprietary system is of no interest/priority for me, it still would be nice to not break compatibility with it -- any ideas?

Copy link

@Ansud Ansud commented Aug 10, 2012

Hm, you are in python, so can get properly formatted date there. And then put it inside action script via template as it already done for or

Copy link

@simonbcn simonbcn commented Jan 2, 2013

Same problem since several hours. Before it worked well.
Server sends: mié, 02 ene 2013 13:03:56 +0000 and this is the relevant part of source mail received: Date: mié, 02 ene 2013 13:03:01 +0000

# locale

Why is it necessary define date field in conf file? I think It isn't necessary. I suppressed the Date:... lines and now it works well. The mail system establishes the date field of mail in the same moment that it receives the mail send petition.

Copy link

@alick alick commented Feb 26, 2013

Any update for this issue? I've met it on Fedora 18 now.

Copy link

@JohnDoe42 JohnDoe42 commented Mar 3, 2013

Same Problem here - seems to me that the current date request sends an german ä in "Mär" instead of "Mar".

Copy link

@iGeorgeX iGeorgeX commented Mar 7, 2013

A solution could be
LC_TIME=en_US.UTF-8; date -u +"%%a, %%d %%h %%Y %%T +0000"
this way you don't break compatibility with OS X.

Copy link

@grooverdan grooverdan commented Apr 29, 2013

@iGeorgeX good idea. No need for ; and =C is hopefully more commonly installed than en_US.UTF-8

yarikoptic added a commit to yarikoptic/fail2ban that referenced this issue May 3, 2013
* master:
  ENH: "is None" instead of "== None" + tune ups in headers
  BF: log error only if there were missed config files that couldn't be read
  DOC: missing cinfo tags are ok. Log error for self referencing definitions
  DOC: s/defination/definition/g learn to spell
  Changelog entry for the previous commit and some untabify
  BF: pyinotify backend should also handle IN_MOVED_TO events
  ENH: remove stats of config files and use results of to facilitate meaningful error messages
  DOC: credits for fail2bangh-70 fix
  BF: ensure dates in email are in the C locale. Thanks iGeorgeX
  DOC: ChangeLog for recursive tag substition
  ENH: allow recursive tag substitution in action files.
  DOC: document <br> tag
  DOC: ChangeLog for named-refused entry
  ENH: Account for views in named filter. By Romain Riviere in gentoo bug #259458
  DOC: release documentation and distributor contacts
  DOC: changelog entry for enhanced ssh filter
  BF: Rename mentioning of README to (Fixes fail2ban#187)
  updated to hyperlink, add travis and coversall
  Moving README into a markup for github's goodnesses

Copy link

@coderua coderua commented Jun 16, 2014

In Linux Debian:
You can edit /etc/init.d/fail2ban and add at the beginning of the file, before definition 'PATH' variable:
export LC_TIME=C

And than restart fail2ban.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
8 participants