Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: foss-ml [...] wm1.at
Cc:
AdminCc:

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



Subject: Mbox: odd year causes seperator to be ignored
I'm trying to parse Thunderbird Mailboxes. Unfortunately, sometimes the separator is not detected because the year is 1965 From - Mon Jan 1 00:00:00 1965 I understand that the separators in mbox implementations are a hell to support in a generic way because of the differences in implementations. Could you make the detection of separators more configurable, for example by providing an way that allows the user to specify a custom separation detection function? I've worked around the problem for me by changing the corresponding line in Mail::Box::Parser:Perl: next if $sep eq 'From ' && $line !~ m/ \d{4}\b/;
Subject: Re: [rt.cpan.org #65572] Mbox: odd year causes seperator to be ignored
Date: Tue, 8 Feb 2011 22:44:09 +0100
To: Willi Mann via RT <bug-Mail-Box [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Willi Mann via RT (bug-Mail-Box@rt.cpan.org) [110208 20:26]: Show quoted text
> Tue Feb 08 15:25:50 2011: Request 65572 was acted upon. > Transaction: Ticket created by wmann > Queue: Mail-Box > Subject: Mbox: odd year causes seperator to be ignored > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65572 > > > I'm trying to parse Thunderbird Mailboxes. Unfortunately, sometimes the > separator is not detected because the year is 1965
> >From - Mon Jan 1 00:00:00 1965
> > I've worked around the problem for me by changing the corresponding line > in Mail::Box::Parser:Perl: > next if $sep eq 'From ' && $line !~ m/ \d{4}\b/;
This will mean certain death :-( Newest prices: From 1300 for 1200$ I have actually seen lines like that in real mail. I expected that there would not be any email from before epoch, 1-1-1970 but apparently there is. Or are those dates caused by errors? Internet started at ~1983 (my first email address on bitnet in 1984) I will change the rule to also accept the sixties and the upcoming 20's New rule in 2.098: && ($sep ne 'From ' || $line =~ m/ (?:19[6-9]|20[0-2])[0-9]\b/ ); -- Thanks, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
From: foss-ml [...] wm1.at
Show quoted text
> This will mean certain death :-( > Newest prices: > From 1300 for 1200$ > > I have actually seen lines like that in real mail.
Well, I expect it to work for me because most mails I'm dealing with are in German. It wasn't my intention to propose my code as solution. Show quoted text
> I expected that there would not be any email from before epoch, 1-1-1970 > but apparently there is. Or are those dates caused by errors?
I've just searched the mozilla source tree. The string in question is hardcoded - in code specifically written to import from OE 5: http://mxr.mozilla.org/seamonkey/source/mailnews/import/oexpress/nsOE5File.cpp#237 Internet Show quoted text
> started at ~1983 (my first email address on bitnet in 1984) > I will change the rule to also accept the sixties and the upcoming 20's > > New rule in 2.098: > && ($sep ne 'From ' || $line =~ m/ (?:19[6-9]|20[0-2])[0-9]\b/ );
Thanks.
Subject: Re: [rt.cpan.org #65572] Mbox: odd year causes seperator to be ignored
Date: Wed, 9 Feb 2011 12:15:57 +0100
To: Willi Mann via RT <bug-Mail-Box [...] rt.cpan.org>
From: Mark Overmeer <secretaris [...] nluug.nl>
* Willi Mann via RT (bug-Mail-Box@rt.cpan.org) [110209 10:52]: Show quoted text
Show quoted text
> > Newest prices: > > From 1300 for 1200$
> > Well, I expect it to work for me because most mails I'm dealing with are > in German. It wasn't my intention to propose my code as solution.
And in Germany you do not receive spam? My inbox is full of spam... and discussions about spam with attachments, etc. Don't be too flexible: never say never. Show quoted text
> > I expected that there would not be any email from before epoch, 1-1-1970 > > but apparently there is. Or are those dates caused by errors?
> > I've just searched the mozilla source tree. The string in question is > hardcoded - in code specifically written to import from OE 5:
Well found. I have put that node in the ChangeLog -- Thanks, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
got fixed in 2.098