Skip Menu |

This queue is for tickets about the Mail-Box CPAN distribution.

Report information
The Basics
Id: 86864
Status: resolved
Priority: 0/
Queue: Mail-Box

People
Owner: Nobody in particular
Requestors: andy [...] andybev.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 2.109



Subject: Parsing more broken dates from mail clients
Date: Thu, 11 Jul 2013 20:32:36 +0100
To: bug-Mail-Box [...] rt.cpan.org
From: Andrew Beverley <andy [...] andybev.com>
Another case of broken mail clients. This time I have found some that incorrectly put periods between time elements instead of colons. For example: "Date: Tue, 9 Jul 2013 08.41.36 +0200". This is currently parsed as "02 Saturday 00:00 LMT". This patch provides a workaround and fixes that behaviour. It is patched against the previously updated file. --- Date-new.pm 2013-07-04 22:46:10.000000000 +0100 +++ /usr/local/share/perl/5.10.1/Mail/Message/Field/Date.pm 2013-07-11 20:27:49.000000000 +0100 @@ -31,8 +31,8 @@ \s+ ( [A-Z][a-z][a-z] ) \s+ # month ( 19[0-9][0-9] | 2[0-9]{3} ) \s+ # year ( [0-1]?[0-9] | 2[0-3] ) \s* # hour - \: ( [0-5][0-9] ) \s* # minute - (?: \: ( [0-5][0-9] ) )? \s+ # second + [\:\.] ( [0-5][0-9] ) \s* # minute + (?: [\:\.] ( [0-5][0-9] ) )? \s+ # second ( [+-][0-9]{4} | [A-Z]+ )? # zone \s* /x or return undef;
Subject: Re: [rt.cpan.org #86864] Parsing more broken dates from mail clients
Date: Thu, 11 Jul 2013 21:56:30 +0200
To: Andrew Beverley via RT <bug-Mail-Box [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Andrew Beverley via RT (bug-Mail-Box@rt.cpan.org) [130711 19:33]: Show quoted text
> Thu Jul 11 15:33:08 2013: Request 86864 was acted upon. > Transaction: Ticket created by abeverley > Queue: Mail-Box > Subject: Parsing more broken dates from mail clients > Requestors: andy@andybev.com > > Another case of broken mail clients. This time I have found some that > incorrectly put periods between time elements instead of colons. For > example: "Date: Tue, 9 Jul 2013 08.41.36 +0200". This is currently > parsed as "02 Saturday 00:00 LMT". This patch provides a workaround and > fixes that behaviour. It is patched against the previously updated file.
RFC 5322 section 3.3 forbids it... time = time-of-day zone time-of-day = hour ":" minute [ ":" second ] hour = 2DIGIT / obs-hour minute = 2DIGIT / obs-minute second = 2DIGIT / obs-second But it is too easy to support, so accepted. Show quoted text
> --- Date-new.pm 2013-07-04 22:46:10.000000000 +0100 > +++ /usr/local/share/perl/5.10.1/Mail/Message/Field/Date.pm 2013-07-11 > 20:27:49.000000000 +0100 > @@ -31,8 +31,8 @@ > \s+ ( [A-Z][a-z][a-z] ) \s+ # month > ( 19[0-9][0-9] | 2[0-9]{3} ) \s+ # year > ( [0-1]?[0-9] | 2[0-3] ) \s* # hour > - \: ( [0-5][0-9] ) \s* # minute > - (?: \: ( [0-5][0-9] ) )? \s+ # second > + [\:\.] ( [0-5][0-9] ) \s* # minute > + (?: [\:\.] ( [0-5][0-9] ) )? \s+ # second > ( [+-][0-9]{4} | [A-Z]+ )? # zone > \s* /x > or return undef;
-- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #86864] Parsing more broken dates from mail clients
Date: Thu, 11 Jul 2013 21:01:17 +0100
To: bug-Mail-Box [...] rt.cpan.org
From: Andrew Beverley <andy [...] andybev.com>
On Thu, 2013-07-11 at 15:56 -0400, Mark Overmeer via RT wrote: Show quoted text
> RFC 5322 section 3.3 forbids it...
I thought that would probably be the case, but there is so much broken code out there... Actually, I think the email was spam, but nonetheless I still need to handle it otherwise I get lots of warnings generated. Show quoted text
> But it is too easy to support, so accepted.
Thank you :)
Resolved in 2013