Ticket #417 (new defect)

Opened 16 years ago

Last modified 13 years ago

Mailfs Bugs/Patches

Reported by: andrew_b Owned by:
Priority: trivial Milestone: Future Releases
Component: mc-vfs Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

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;

Change History

comment:1 Changed 16 years ago by angel_il

  • Milestone changed from 4.7.0-pre1 to 4.7

comment:2 Changed 15 years ago by storchaka

  • severity set to no branch

See http://www.qmail.org/man/man5/mbox.html:

The From_ line always looks like From envsender date
moreinfo. envsender is one word, without spaces or tabs; it
is usually the envelope sender of the message. date is the
delivery date of the message. It always contains exactly 24
characters in asctime format. moreinfo is optional; it may
contain arbitrary information.

comment:3 Changed 13 years ago by andrew_b

  • Branch state set to no branch
  • Milestone changed from 4.7 to Future Releases
Note: See TracTickets for help on using tickets.