Other tools:
acroread2sylpheed.pl Send PDFs from Adobe Reader 7
- filter_conv.pl Convert old-style filters to new filtering
+ filter_conv_new.pl Convert new-style Sylpheed filters to filtering
+ filter_conv.pl Convert old-style Sylpheed filters to filtering
nautilus2sylpheed.sh Send files from Nautilus
OOo2sylpheed.pl Send documents from OpenOffice.org
sylprint.pl Printing engine, explained in README.sylprint
Contact: Paul Mangan <claws@thewildbeast.co.uk>
+* filter_conv_new.pl
+
+ WHAT IT DOES
+ This perl script provides easy conversion of your filtering rules from
+ sylpheed's new filter system (>= 0.9.99) to the filtering system used in
+ sylpheed-claws. (Disabled rules are ignored)
+ It reads '~/.sylpheed-2.0/filter.xml' or '~/.sylpheed/filter.xml' and
+ writes '~/[CLAWS CONFIG DIR]/matcherrc'
+
+ HOW TO USE IT
+ Issue the following command from the 'tools' directory:
+
+ perl filter_conv_new.pl
+
+ That's it, the claws' filtering system is now implemented with your
+ previous rules applied.
+
+ REQUIREMENTS
+ XML::SimpleObject
+
+ Contact: Paul Mangan <claws@thewildbeast.co.uk>
+
+
* filter_conv.pl
WHAT IT DOES
This perl script provides easy conversion of your filtering rules
- form sylpheed's old filter system (pre version 0.9.99) to the new
- filtering system used in sylpheed-claws.
- It reads '~/.sylpheed/filterrc' and outputs '~/.sylpheed-claws/matcherrc'.
+ from sylpheed's old filter system (< 0.9.99) to the filtering system
+ used in sylpheed-claws.
+ It reads '~/.sylpheed/filterrc' and writes '~/.sylpheed-claws/matcherrc'
HOW TO USE IT
Issue the following command from the 'tools' directory:
use XML::SimpleObject;
my $old_config = "$ENV{HOME}/.sylpheed-2.0/filter.xml";
-my $config_dir = `sylpheed-claws --config-dir`;
+my $older_config = "$ENV{HOME}/.sylpheed/filter.xml";
+my $old_filters;
+
+my $config_dir = `sylpheed-claws --config-dir` or die("ERROR:
+ You don't appear to have Sylpheed-Claws installed\n");
chomp $config_dir;
-chdir($ENV{ HOME } . "/$config_dir")
- or die("You don't appear to have Sylpheed-Claws installed\n");
+chdir($ENV{HOME} . "/$config_dir") or die("ERROR:
+ Sylpheed-Claws config directory not found [~/$config_dir]
+ You need to run Sylpheed-Claws once, quit it, and then rerun this script\n");
--e $old_config or die("Can't find old filters [$old_config]\n");
+if (-e $old_config) {
+ $old_filters = $old_config;
+} elsif (-e $older_config) {
+ $old_filters = $older_config;
+} else {
+ print "ERROR:\n\tSylpheed filter not found\n\t[$old_config]\n\t[$older_config]\n";
+ exit;
+}
my $parser = XML::Parser->new(ErrorContext => 2, Style => "Tree");
-my $xmlobj = XML::SimpleObject->new($parser->parsefile($old_config));
+my $xmlobj = XML::SimpleObject->new($parser->parsefile($old_filters));
my @conditions = ('match-header','match-to-or-cc','match-any-header',
'match-body-text','command-test','size','age');
my @new_filters = ("[filtering]");
+my $disabled = 0;
my $bool;
## rules list
}
if ($element->attribute("enabled")) {
if ($element->attribute("enabled") eq "false") {
+ $disabled++;
next; # skip disabled rules
}
}
$new_filter .= "matchcase ";
}
}
- my $value = $sibling->value;
- $value = clean_me($value);
+ my $value = clean_me($sibling->value);
if ($condition =~ m/$numeric_matches/) {
$new_filter .= "$value";
} else {
$new_filter .= " stop";
}
if ($sibling->value) {
- my $value = $sibling->value;
- $value = clean_me($value);
+ my $value = clean_me($sibling->value);
if ($action eq "color-label") {
$new_filter .= " $value";
} else {
close(MATCHERRC);
print "Converted ". ($#new_filters-1) . " filters\n";
+if ($disabled) {
+ print "[$disabled disabled filter(s) not converted]\n";
+}
exit;