Update of /cvsroot/popfile/engine/Classifier
In directory sc8-pr-cvs1:/tmp/cvs-serv13269
Modified Files:
Bayes.pm
Log Message:
Perform insertion before questionable header content (lines without : or whitespace at start)
[ 732181 ] Header inserted after <HTML> tag
Index: Bayes.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v
retrieving revision 1.142
retrieving revision 1.143
diff -C2 -d -r1.142 -r1.143
*** Bayes.pm 7 May 2003 22:20:58 -0000 1.142
--- Bayes.pm 14 May 2003 03:20:03 -0000 1.143
***************
*** 790,793 ****
--- 790,794 ----
my $msg_head_before = ''; # Store the message headers that come before Subject here
my $msg_head_after = ''; # Store the message headers that come after Subject here
+ my $msg_head_q = ''; # Store questionable header lines here
my $msg_body = ''; # Store the message body here
***************
*** 861,871 ****
# Strip out the X-Text-Classification header that is in an incoming message
! if ( ( $line =~ /^X-Text-Classification:/i ) == 0 ) {
if ( $msg_subject eq '' ) {
! $msg_head_before .= $line;
} else {
! $msg_head_after .= $line;
}
}
}
} else {
--- 862,882 ----
# Strip out the X-Text-Classification header that is in an incoming message
!
! next if ( $line =~ /^X-Text-Classification:/i );
!
! if ( $line =~ /(^[ \t])|([:])/ ) {
if ( $msg_subject eq '' ) {
! $msg_head_before .= $msg_head_q . $line;
} else {
! $msg_head_after .= $msg_head_q . $line;
}
+ $msg_head_q = '';
+ } else {
+ # Gather up any lines that are questionable
+
+ $msg_head_q .= $line;
}
+
+
}
} else {
***************
*** 934,938 ****
}
! $msg_head_after .= "$eol";
# Echo the text of the message to the client
--- 945,949 ----
}
! $msg_head_after .= $msg_head_q . "$eol";
# Echo the text of the message to the client
|