~ubuntu-branches/ubuntu/utopic/spamassassin/utopic-updates

« back to all changes in this revision

Viewing changes to .pc/10_change_config_paths/sa-learn.raw

  • Committer: Package Import Robot
  • Author(s): Noah Meyerhans
  • Date: 2014-02-14 22:45:15 UTC
  • mfrom: (0.8.1) (0.6.2) (5.1.22 sid)
  • Revision ID: package-import@ubuntu.com-20140214224515-z1es2twos8xh7n2y
Tags: 3.4.0-1
* New upstream version! (Closes: 738963, 738872, 738867)
* Scrub the environment when switching to the debian-spamd user in
  postinst and cron.daily. (Closes: 738951)
* Enhancements to postinst to better manage ownership of
  /var/lib/spamassassin, via Iain Lane <iain.lane@canonical.com>
  (Closes: 738974)

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
  'learnprob=f' => \$opt{'learnprob'},
113
113
  'randseed=i'  => \$opt{'randseed'},
114
114
  'stopafter=i' => \$opt{'stopafter'},
 
115
  'max-size=i'  => \$opt{'max-size'},
115
116
 
116
117
  'debug|debug-level|D:s' => \$opt{'debug'},
117
118
  'help|h|?'        => \$opt{'help'},
412
413
 
413
414
  my $tempfile; # will be defined if stdin -> tempfile
414
415
  push(@targets, @ARGV);
415
 
  @targets = ('-') unless @targets;
 
416
  @targets = ('-') unless @targets || $opt{folders};
416
417
 
417
418
  for(my $elem = 0; $elem <= $#targets; $elem++) {
418
419
    # ArchiveIterator doesn't really like STDIN, so if "-" is specified
455
456
 
456
457
  my $iter = new Mail::SpamAssassin::ArchiveIterator(
457
458
    {
458
 
      'opt_all' => 0,       # skip messages over 250k
 
459
        # skip messages larger than max-size bytes,
 
460
        # 0 for no limit, undef defaults to 256 KiB
 
461
      'opt_max_size' => $opt{'max-size'},
459
462
      'opt_want_date' => 0,
 
463
      'opt_from_regex' => $spamtest->{conf}->{mbox_format_from_regex},
460
464
    }
461
465
  );
462
466
 
469
473
 
470
474
  # if exit_status isn't already set to non-zero, set it to the reverse of the
471
475
  # run result (0 is bad, 1+ is good -- the opposite of exit status codes)
472
 
  eval { $exit_status ||= ! $iter->run(@targets); };
 
476
  my $run_ok = eval { $exit_status ||= ! $iter->run(@targets); 1 };
473
477
 
474
478
  print STDERR "\n" if ($opt{showdots});
475
479
  $progress->final() if ($opt{progress} && $progress);
483
487
    undef $tempfile;
484
488
  }
485
489
 
486
 
  if ($@) { die $@ unless ( $@ =~ /HITLIMIT/ ); }
 
490
  if (!$run_ok && $@ !~ /HITLIMIT/) { die $@ }
487
491
  1;
488
492
} or do {
489
493
  my $eval_stat = $@ ne '' ? $@ : "errno=$!";  chomp $eval_stat;
625
629
 --file                Ignored; historical compatibility
626
630
 --mbox                Input sources are in mbox format
627
631
 --mbx                 Input sources are in mbx format
 
632
 --max-size <b>        Skip messages larger than b bytes;
 
633
                       defaults to 256 KiB, 0 implies no limit
628
634
 --showdots            Show progress using dots
629
635
 --progress            Show progress using progress bar
630
636
 --no-sync             Skip synchronizing the database and journal