id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	branch_state	votes
417	Mailfs Bugs/Patches	andrew_b		"From mc-devel at gnome dot org
Author: Peter Daum <gator_ml at yahoo dot de>

----

With the current mailfs implementation, I ran into some problems:

1.) By definition (see e.g. http://www.qmail.org/man/man5/mbox.html),
    in a Berkeley MBox File,the beginning of a message is marked by a line
    starting with ""From "" (_exactly_ like this)
    at the beginning of the file or after an empty line.
    So the regex {{{/^from\s+\w+(\.\w+)*@/i}}} currently used is just wrong, because
    - any other capitalization of ""from"" does _not_ introduce a new message
    - anything else following afterwards is optional
2.) malformed date headers currently will produce a warning

----

{{{
--- mailfs.mc_dist 2009-01-25 13:36:48.000000000 +0100
+++ mailfs 2009-06-17 10:25:39.000000000 +0200
@@ -15,7 +15,7 @@
     import Date::Parse;
     $parse_date=
  sub {
- local $ftime = str2time($_[0],$TZ);
+ local $ftime = str2time($_[0],$TZ) || return $fallback;
  $_ = localtime($ftime);
  /^(...) (...) ([ \d]\d) (\d\d:\d\d):\d\d (\d\d\d\d)$/;
  if ($ftime + 6 * 30 * 24 * 60 * 60 < $now ||
@@ -135,7 +135,7 @@
 
     while(<IN>) {
  s/\r$//;
- if($blank && /^from\s+\w+(\.\w+)*@/i) { # Start of header
+ if($blank && /^From /) { # Start of header
  print_dir_line unless (!$msg_nr);
  $size=length;
  $msg_nr++;
@@ -160,7 +160,7 @@
     my $blank = 1;
     while(<IN>) {
  s/\r$//;
- if($blank && /^from\s+\w+(\.\w+)*@/i) {
+ if($blank && /^From /) {
  $msg_nr++;
  exit(0) if ($msg_nr > $nr);
  $blank= 0;
}}}"	defect	new	trivial	Future Releases	mc-vfs	master						no branch	
