fix bug in convert_mbox.pl
authorPaul Mangan <paul@claws-mail.org>
Mon, 12 May 2003 14:40:48 +0000 (14:40 +0000)
committerPaul Mangan <paul@claws-mail.org>
Mon, 12 May 2003 14:40:48 +0000 (14:40 +0000)
ChangeLog.claws
tools/convert_mbox.pl

index 65924c1c9b2b1eb90d78e63816ff615be89cbf5f..3dcf8b39827cc9106de515ab616ed14cad6d6bfd 100644 (file)
@@ -1,3 +1,8 @@
+2003-05-12 [paul]
+
+       * tools/convert_mbox.pl
+               bug fixed by Fred Marton
+
 2003-05-12 [paul]
 
        * sync with 0.9.0pre1
 2003-05-12 [paul]
 
        * sync with 0.9.0pre1
index fa1e8eef71ee69616856943b5a317abbe6d6f25a..16b5d9ee9b21c7f7b0f5ca0877fef1c24d4dfa5c 100644 (file)
@@ -45,11 +45,15 @@ $i = 0;
 open (IN, $mbox);
 while ($line = <IN>) {
 # check for the beginning of an e-mail
 open (IN, $mbox);
 while ($line = <IN>) {
 # check for the beginning of an e-mail
-   @word = split(/ /m,$line);
+   @word = split(/ +/m,$line);
+# some lines might start with "From ", so check
+# to see if the seventh word is a year
+   chomp($word[6]);
+   $year = $word[6];
 # ignore the MAILER-DAEMON message from pine
    if (@word[1] ne "MAILER-DAEMON") {
 # start a new file
 # ignore the MAILER-DAEMON message from pine
    if (@word[1] ne "MAILER-DAEMON") {
 # start a new file
-      if (@word[0] eq "From") {
+      if (@word[0] eq "From" && $year > 1970) {
          $i++;
          close (OUT);
          open (OUT, ">$mh/$i");
          $i++;
          close (OUT);
          open (OUT, ">$mh/$i");