Репозитории ALT
5.1: | 3.9.0-alt1.beta2 |
4.1: | 3.8.0-alt1.8 |
4.0: | 3.8.0-alt1.4 |
3.0: | 3.4.8-alt1 |
Другие репозитории
Upstream: | 3.8.0 |
Группа :: Сети/Почта
Пакет: dspam
Главная Изменения Спек Патчи Исходники Загрузить Gear Bugs and FR Repocop
#!/usr/bin/perl
use strict;
use vars qw { @spam @ham $USER };
$USER = shift;
if ($USER eq "") {
$USER = "global";
}
opendir(DIR, "./ham");
@ham = grep(!/^\.\.?$/, readdir(DIR));
closedir(DIR);
opendir(DIR, "./spam");
@spam = grep(!/^\.\.?$/, readdir(DIR));
closedir(DIR);
print "$#ham ham entries\n";
print "$#spam spam entries\n";
print "Training user '$USER'...\n";
while($#ham>=0) {
my($file) = shift(@ham);
print "training $file as HAM...\n";
system("dspam --user $USER --corpus --inoculate < ./ham/$file");
}
while($#spam>=0) {
my($file) = shift(@spam);
print "training $file as SPAM...\n";
system("dspam --user $USER --corpus --addspam --inoculate < ./spam/$file");
}
#print "\nFinished. Running dspam_clean -p0 $USER...\n";
#system("dspam_clean -p0 $USER");
print "\nFinished.\n";