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
- Issue the following command:
+ Issue the following command from the 'tools' directory:
perl filter_conv.pl
# *
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"/) {
- 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;
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";