Update of /cvsroot/popfile/engine/Classifier
In directory sc8-pr-cvs1:/tmp/cvs-serv27368/Classifier
Modified Files:
Bayes.pm
Log Message:
Small modifications to Bayes to clean up code and make sure that very large quarantined messages get the trailing MIME boundary
Index: Bayes.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v
retrieving revision 1.166
retrieving revision 1.167
diff -C2 -d -r1.166 -r1.167
*** Bayes.pm 11 Jul 2003 05:29:21 -0000 1.166
--- Bayes.pm 11 Jul 2003 21:52:55 -0000 1.167
***************
*** 1197,1221 ****
}
! if ( $got_full_body == 0 ) {
! if ( $echo ) {
! $self->echo_to_dot_( $mail, $client, ">>" . $temp_file );
! } else {
! $self->echo_to_dot_( $mail, undef, ">>" . $temp_file );
! }
! } else {
! if ( $classification ne 'unclassified' ) {
! if ( ( $self->{parameters__}{$classification}{quarantine} == 1 ) && $echo ) {
! print $client "$eol--$temp_file--$eol";
! }
}
! print $client "$eol.$eol" if ( $echo );
}
if ( $nosave ) {
unlink( $temp_file );
! }
!
! if ( !$nosave ) {
$self->history_write_class($class_file, undef, $classification, undef, ($self->{magnet_used__}?$self->{magnet_detail__}:undef));
--- 1197,1217 ----
}
! if ( !$got_full_body ) {
! $self->echo_to_dot_( $mail, $echo?$client:undef, '>>' . $temp_file );
! }
!
! if ( $classification ne 'unclassified' ) {
! if ( ( $self->{parameters__}{$classification}{quarantine} == 1 ) && $echo ) {
! print $client "$eol--$temp_file--$eol";
}
+ }
! if ( $echo ) {
! print $client "$eol.$eol";
}
if ( $nosave ) {
unlink( $temp_file );
! } else {
$self->history_write_class($class_file, undef, $classification, undef, ($self->{magnet_used__}?$self->{magnet_detail__}:undef));
***************
*** 1465,1468 ****
--- 1461,1468 ----
my ( $self, $bucket ) = @_;
+ if ( !defined( $self->{total__}{$bucket} ) ) {
+ return;
+ }
+
my $bucket_directory = $self->config_( 'corpus' ) . "/$bucket";
***************
*** 1490,1493 ****
--- 1490,1497 ----
my ( $self, $old_bucket, $new_bucket ) = @_;
+ if ( !defined( $self->{total__}{$old_bucket} ) ) {
+ return;
+ }
+
rename($self->config_( 'corpus' ) . "/$old_bucket" , $self->config_( 'corpus' ) . "/$new_bucket");
***************
*** 1509,1512 ****
--- 1513,1523 ----
my ( $self, $bucket, @files ) = @_;
+ # Verify that the bucket exists. You must call create_bucket before this
+ # when making a new bucket.
+
+ if ( !defined( $self->{total__}{$bucket} ) ) {
+ return;
+ }
+
my %words;
***************
*** 1585,1588 ****
--- 1596,1606 ----
{
my ( $self, $file, $bucket ) = @_;
+
+ # Verify that the bucket exists. You must call create_bucket before this
+ # when making a new bucket.
+
+ if ( !defined( $self->{total__}{$bucket} ) ) {
+ return;
+ }
my %words;
|