read top level mailbox name - presume nothing
authorPaul Mangan <paul@claws-mail.org>
Mon, 26 Nov 2001 11:04:57 +0000 (11:04 +0000)
committerPaul Mangan <paul@claws-mail.org>
Mon, 26 Nov 2001 11:04:57 +0000 (11:04 +0000)
tools/README
tools/filter_conv.pl

index 47a6af7dce1f6c47a35660e9fa7538a1b5e74f5c..449f56ecadf80f8ee59b5c5a0ace8aa607db8e4e 100644 (file)
 
   This perl script provides easy conversion of your filtering rules
   form sylpheed's old filter system to the new filtering system used
 
   This perl script provides easy conversion of your filtering rules
   form sylpheed's old filter system to the new filtering system used
-  in sylpheed-claws. It reads 'filterrc' and outputs 'filteringrc'.
+  in sylpheed-claws. It reads '~/.sylpheed/filterrc' and outputs 
+  '~/.sylpheed/filteringrc'.
+  
+  Your old filter settings are preserved, if you want to go back to
+  the original filter system simply delete ~/.sylpheed/filteringrc
 
   HOW TO USE IT
 
 
   HOW TO USE IT
 
-  Issue the following command:
+  Issue the following command from the 'tools' directory:
 
         perl filter_conv.pl
 
 
         perl filter_conv.pl
 
index e932a5c258221c207296b497bf47d5bbf7d4fc94..68ccf74b2badcf0c36e846753c072c28421929b3 100644 (file)
 #  *
 
 chdir;
 #  *
 
 chdir;
-chdir '.sylpheed' || die("You don't appear to have Sylpheed installed");
+chdir '.sylpheed' || die("You don't appear to have Sylpheed installed\n");
 
 
-open(FOLDERLIST, "<folderlist.xml") || warn("Can't find folderlist.xml, guessing that you use 'Mail'");
+open(FOLDERLIST, "<folderlist.xml") || die("Can't find folderlist.xml\n");
 @folderlist = <FOLDERLIST>;
 close FOLDERLIST;
 
 foreach $folderlist (@folderlist) {
        if ($folderlist =~ m/<folder type="mh"/) {
 @folderlist = <FOLDERLIST>;
 close FOLDERLIST;
 
 foreach $folderlist (@folderlist) {
        if ($folderlist =~ m/<folder type="mh"/) {
-                if ($folderlist =~ m/name="Mailbox"/) {
-                       $TOPBOXIS = "Mailbox";
-                } else {
-                       $TOPBOXIS = "Mail";
-                }
+               $folderlist =~ s/<folder type="mh" name="//;
+                $folderlist =~ s/" path="[A-Z0-9]+">\n//ig;
+                $folderlist =~ s/^ +//;
+                $mailbox = $folderlist;
         }
 }
 
         }
 }
 
-if (!$TOPBOXIS) {
-       $TOPBOXIS = "Mail";
-}
-
-open (FILTERRC, "<filterrc") || die("Can't find your old filter rules");
+open (FILTERRC, "<filterrc") || die("Can't find your old filter rules\n");
 @input_file = <FILTERRC>;
 close FILTERRC;
 
 @input_file = <FILTERRC>;
 close FILTERRC;
 
@@ -62,7 +57,7 @@ $WRITE_THIS .= "from match \"$split_lines[1]\"";
 if (!$split_lines[5]) {
 $WRITE_THIS .= " delete";
 } elsif ($split_lines[8] == "m"){
 if (!$split_lines[5]) {
 $WRITE_THIS .= " delete";
 } elsif ($split_lines[8] == "m"){
-$WRITE_THIS .= " move \"\#mh/$TOPBOXIS/$split_lines[5]\"";
+$WRITE_THIS .= " move \"\#mh/$mailbox/$split_lines[5]\"";
 }
 $WRITE_THIS .= "\n";
 
 }
 $WRITE_THIS .= "\n";