my ( $files, $spam ) = @_;
my $processed = 0;
- my $cmd = $spam ? "learn_spam" : "learn_ham";
+ my $cmd = $spam ? "learn_spam" : "learn_ham";
my $args_quoted = shell_quote @{$files};
open( my $p, "$rspamc -t $timeout -c $classifier --compact -j -n $parallel $cmd $args_quoted |" )
or die "cannot spawn $rspamc: $!";
foreach my $f ( @{$files} ) {
my $args_quoted = shell_quote $f;
- my $fl = $spam ? "-s" : "-n";
+ my $fl = $spam ? "-s" : "-n";
`$bogofilter -I $args_quoted $fl`;
if ( $? == 0 ) {
$processed++;
foreach my $f ( @{$files} ) {
my $args_quoted = shell_quote $f;
- my $fl = $spam ? "--class=spam" : "--class=innocent";
+ my $fl = $spam ? "--class=spam" : "--class=innocent";
open( my $p, "|$dspam --user nobody --source=corpus --stdout --mode=toe $fl" )
or die "cannot run $dspam: $!";
# Deal with groups
my $group_id = 0;
foreach my $g (@symbols_groups) {
- my @symbols = split /,/, $g;
+ my @symbols = split /,/, $g;
my $group_name = "group$group_id";
foreach my $s (@symbols) {
# Process logs
foreach (@logs) {
my $ext = (/[^.]+\.?([^.]*?)$/)[0];
- my $dc = $decompressor{$ext} || 'cat';
+ my $dc = $decompressor{$ext} || 'cat';
open( $rspamd_log, "-|", "$dc $log_dir/$_" )
or die "cannot execute $dc $log_dir/$_ : $!";
}
else {
my $ext = ( $log_file =~ /[^.]+\.?([^.]*?)$/ )[0];
- my $dc = $decompressor{$ext} || 'cat';
+ my $dc = $decompressor{$ext} || 'cat';
open( $rspamd_log, "-|", "$dc $log_file" )
or die "cannot execute $dc $log_file : $!";
$spinner_update_time = 0; # Force spinner update
opendir( DIR, $dir ) or die $!;
my $pattern = join( '|', keys %decompressor );
- my $re = qr/\.[0-9]+(?:\.(?:$pattern))?/;
+ my $re = qr/\.[0-9]+(?:\.(?:$pattern))?/;
# Add unnumbered logs first
my @logs =