Bug 54098 - improve parsing of non-standard date strings
Summary: improve parsing of non-standard date strings
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: 1.5
Platform: Mandrake RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 73585 73766 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-02-04 22:13 UTC by johnelliottmartin
Modified: 2012-07-14 09:17 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description johnelliottmartin 2003-02-04 22:13:28 UTC
Version:           1.5 (using KDE 3.1.0)
Installed from:    Mandrake Linux Cooker i586 - Cooker
Compiler:          gcc version 3.2.1 (Mandrake Linux 9.1 3.2.1-5mdk)
OS:          Linux (i686) release 2.4.21pre3-3mdkcustom

Hello,
I received an email whose date is shown as unknow. In the header the date is listed as:

Date: Tue, Feb 04, 2003 00:01:20 +0000

which seems to differ from other messages in that it has commas in it. Would it be possible to modify the parsing algorithm to handle dates of this format?
Comment 1 Ingo Klöcker 2003-02-05 23:26:50 UTC
Interpreting non-standard dates is a wish. 
 
Comment 2 Roger Ward 2003-12-15 20:16:21 UTC
I found another date that is parsed incorrectly.  Hope this helps when someone gets around to fixing the date parser.  I may do it if I manage to figure out the code... :)

Date: Mon Dec 15 11:04:05 PST 2003
Comment 3 Ingo Klöcker 2004-01-27 11:14:59 UTC
*** Bug 73585 has been marked as a duplicate of this bug. ***
Comment 4 Ingo Klöcker 2004-01-29 18:33:11 UTC
*** Bug 73766 has been marked as a duplicate of this bug. ***
Comment 5 Ben Davis 2004-02-15 21:42:47 UTC
I can accept that support for nonstandard date formats is a wish, but when the BBC E-mail News Service generates them, I would suggest it is quite an important wish.

I received one just like the last-mentioned:

Date: Thu Feb 12 07:03:13 GMT 2004
Comment 6 Ingo Klöcker 2004-02-16 11:49:53 UTC
Sorry, Ben, but the fact that the BBC E-mail News Service uses broken programs to send out their newsletters hardly qualifies as making this a more important wish (although I very well understand the inconvenience this is causing). I hope that you've already contacted the BBC ENS to tell them that they are sending out newsletters without standard-compliant Date headers.
Comment 7 Ben Davis 2004-02-19 05:17:04 UTC
Yes, I did contact the BBC.

Sorry, Ingo, but the importance of this wish is defined by the users who have made the wish, and I'm one of them. If you want to judge importance by your own standards, then use a closed bug tracking system instead.
Comment 8 Andreas Gungl 2004-02-19 13:06:54 UTC
On Thursday 19 February 2004 05:17, Ben Davis wrote:
> Sorry, Ingo, but the importance of this wish is defined by the users who
> have made the wish, and I'm one of them. If you want to judge importance
> by your own standards, then use a closed bug tracking system instead.

Ben, if you think it's that important for you to get this issue fixed, then 
feel free to download the sources and provide a patch. IMO it's the 
developers' own decision what they consider most important to work on in 
the moment.
Please remember that this is open source and also keep in mind that KMail is 
standard compliant while the date format used by BBC isn't.

Comment 9 Ben Davis 2004-02-20 00:46:45 UTC
I agree fully. In my opinion, the fact that this has been labelled as a wish as opposed to a bug report is adequate acknowledgement of your last sentence.

My complaint is simply as follows. This bug tracker encourages users to specify what they consider important - quantitively with votes and by reasonable extension qualitatively with comments - and yet one of your developers (I'm assuming Ingo is a developer) went against me rather rudely when I did just that. You should provide a clear message as to whether your users' opinions are important to you. This is an open tracker, after all.

Good work on KDE. Of course it is your choice what to work on and when. But it is my firm opinion that no amount of selfless open source work gives you an excuse to be rude to people without good reason.
Comment 10 Andreas Gungl 2004-02-20 21:18:54 UTC
On Freitag, 20. Februar 2004 00:46, Ben Davis wrote:
> Good work on KDE. Of course it is your choice what to work on and when.
> But it is my firm opinion that no amount of selfless open source work
> gives you an excuse to be rude to people without good reason.

As we agree that it's still a wish ;-) please let's clear another 
misunderstanding. Ingo is a developer (actually the maintainer) and his 
answer certainly wasn't meant to be rude.
Perhaps you don't know that many of the KMail developers aren't native 
English speakers. So it may happen that one or another statement is 
understood as being rude although it wasn't intended so at all.
Additonally only a few people deal with all the tons of reports about KMail 
problems, wishes, etc. They don't complain, but they have to be effective. 
So it might happen that an answer is not long enough for an outsider while 
the developer already has written more than usually and necessary (in his 
opinion).

Users (in positive sense) also don't know about the preferences in the 
development which are made for a certain timeframe or release. Sometimes a 
change seems to be so simple however it doesn't fit into what the 
developers do in that moment. The problem remains registered in the bug 
tracking system. It might be the next issue to be worked on or not. But who 
knows...

I hope I can convince you at least a little to change your mind about KMail 
development and developers. Enjoy KDE 3.2 and KDEPIM 3.3 once it will be 
out.

Regards,
Andreas

PS. Sorry, but even I can't tell you when this date parsing problem will be 
fixed.
Comment 11 Ben Davis 2004-02-21 03:48:47 UTC
Wow. You seem to be reading a lot into my last post that I didn't say. What exactly am I supposed to change my mind about?

Ingo's message quite clearly says, "Your opinion is wrong and you shouldn't have posted it here." I don't think you can reasonably argue that a language barrier is involved here; I can easily imagine a native English speaker making the same post, for either of the following reasons.

It's possible that Ingo missed the point of my first post. I was merely adding myself to the set of people who would like to see the wish implemented. He may have felt I was attacking KMail; I was not.

It's also possible that I was right all along and my opinion was rejected without good reason. Who knows, right?

In any case, I am sorry for being excessively rude in my first reply. (See, I can do it too: underestimate how rude I'm being!)
Comment 12 Mikolaj Machowski 2004-03-26 13:06:15 UTC
I see this is a problem:

I received recently mail with Date: header field in form:

Date: Tue Mar 23 18:00:02 2004

KMail showed date as 01.01.1970 01:00 (according to my locale)

According to RFC822 header should be:
=================================
  5.  DATE AND TIME SPECIFICATION

     5.1.  SYNTAX

     date-time   =  [ day "," ] date time        ; dd mm yy
                                                 ;  hh:mm:ss zzz
=================================

As you see, header of message was not RFC822 compliant and KMail was in
its right to not parse this but "be tolerant what you receive".
Comment 13 Mikolaj Machowski 2004-03-27 19:19:59 UTC
Ha, maybe

Date: Tue Mar 23 18:00:02 2004

isn't RFC compliant, but is POSIX compliant - check man ctime(1)



Comment 14 Ben Davis 2004-03-27 19:34:45 UTC
Unfortunately for those of us who want this bug fixed^H^H^H^H^H^H^H^H^Hwish granted, one of the RFCs does say explicitly that ctime's result does not pass as a valid Date header. :/

(Incidentally, ctime is in section 3 of the manual for me.)
Comment 15 Martin Koller 2009-08-30 18:09:25 UTC
@comment #2 and #5: this format has been implemented with https://bugs.kde.org/show_bug.cgi?id=117848#c1

The one from the original report is something I'm currently doing.
Comment 16 Martin Koller 2009-08-30 18:19:04 UTC
SVN commit 1017430 by mkoller:

FEATURE: 54098

Allow another non-RFC2822 conforming date to be parsed to be more tolerant.

Added unit test


 M  +34 -18    dw_date.cpp   [POSSIBLY UNSAFE: scanf]
 M  +6 -0      tests/CMakeLists.txt  
 A             tests/testdateparser.cpp   [License: LGPL (v2)]
 A             tests/testdateparser.h   [License: LGPL (v2)]


WebSVN link: http://websvn.kde.org/?view=rev&revision=1017430
Comment 17 Martin Koller 2012-07-14 09:12:36 UTC
Git commit d1786732b10d1df4e73fe3aac034d4db6d05447b by Martin Koller.
Committed on 14/07/2012 at 11:11.
Pushed by mkoller into branch 'KDE/4.9'.

enhance date-time parser to allow formats which were possible in KDE3
Related: bug 260761

M  +65   -17   kmime/kmime_header_parsing.cpp
M  +39   -0    kmime/tests/auto/headertest.cpp

http://commits.kde.org/kdepimlibs/d1786732b10d1df4e73fe3aac034d4db6d05447b
Comment 18 Martin Koller 2012-07-14 09:15:40 UTC
Git commit 7d8bbdfb09965fc0a2ec1bfdf1bb290497fa5464 by Martin Koller.
Committed on 14/07/2012 at 11:11.
Pushed by mkoller into branch 'master'.

enhance date-time parser to allow formats which were possible in KDE3
Related: bug 260761

M  +65   -17   kmime/kmime_header_parsing.cpp
M  +39   -0    kmime/tests/auto/headertest.cpp

http://commits.kde.org/kdepimlibs/7d8bbdfb09965fc0a2ec1bfdf1bb290497fa5464
Comment 19 Martin Koller 2012-07-14 09:17:36 UTC
Git commit 72d7e6063c2cf275ad9a09669357b8c7bcfc2d69 by Martin Koller.
Committed on 14/07/2012 at 11:11.
Pushed by mkoller into branch 'KDE/4.8'.

enhance date-time parser to allow formats which were possible in KDE3
Related: bug 260761

M  +65   -17   kmime/kmime_header_parsing.cpp
M  +39   -0    kmime/tests/auto/headertest.cpp

http://commits.kde.org/kdepimlibs/72d7e6063c2cf275ad9a09669357b8c7bcfc2d69