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

Closed
Ansud opened this Issue Aug 4, 2012 · 8 comments

Comments

Projects
None yet
8 participants

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"`
    
Owner

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?

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

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
LANG=es_ES.UTF-8
LC_CTYPE="es_ES.UTF-8"
LC_NUMERIC="es_ES.UTF-8"
LC_TIME="es_ES.UTF-8"
LC_COLLATE=C
LC_MONETARY="es_ES.UTF-8"
LC_MESSAGES="es_ES.UTF-8"
LC_PAPER="es_ES.UTF-8"
LC_NAME="es_ES.UTF-8"
LC_ADDRESS="es_ES.UTF-8"
LC_TELEPHONE="es_ES.UTF-8"
LC_MEASUREMENT="es_ES.UTF-8"
LC_IDENTIFICATION="es_ES.UTF-8"
LC_ALL=

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.

alick commented Feb 26, 2013

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

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

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.

@grooverdan grooverdan added a commit to grooverdan/fail2ban that referenced this issue Apr 29, 2013

@grooverdan grooverdan DOC: credits for gh-70 fix f91ad7e
Contributor

grooverdan commented Apr 29, 2013

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

@yarikoptic yarikoptic added a commit to yarikoptic/fail2ban that referenced this issue May 3, 2013

@yarikoptic yarikoptic Merge branch 'master' into 0.9
* 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 SafeConfigParserWithIncludes.read to facilitate meaningful error messages
  DOC: credits for gh-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 README.md (Fixes #187)
  updated README.md to hyperlink, add travis and coversall
  Moving README into a markup README.md for github's goodnesses

Conflicts:
	DEVELOP
	README.md
	fail2ban/client/configreader.py
	fail2ban/server/datedetector.py
b65205d

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