Ticket #143: 0001-Add-configuration-parameter-xtc_header-which-specifi.patch
| File 0001-Add-configuration-parameter-xtc_header-which-specifi.patch, 2.5 kB (added by saragus, 2 years ago) |
|---|
-
a/Classifier/Bayes.pm
old new 271 271 272 272 $self->config_( 'subject_mod_pos', 1 ); 273 273 274 # Sets the string used as a key for the added text classification header 275 276 $self->config_( 'xtc_header', 'X-Text-Classification'); 277 274 278 # Get the hostname for use in the X-POPFile-Link header 275 279 276 280 $self->{hostname__} = hostname; … … 2925 2929 # Strip out the X-Text-Classification header that 2926 2930 # is in an incoming message 2927 2931 2928 next if ( $line =~ /^X-Text-Classification:/i ); 2932 my $xtc_header = $self->config_("xtc_header"); 2933 next if ( $line =~ /^$xtc_header:/i ); 2929 2934 next if ( $line =~ /^X-POPFile-Link:/i ); 2930 2935 2931 2936 # Store any lines that appear as though they may … … 3037 3042 $msg_head_after =~ s/\015\z/$crlf/; 3038 3043 3039 3044 # Add the XTC header 3040 3045 my $xtc_header = $self->config_("xtc_header"); 3041 3046 if ( ( $xtc_insertion ) && ( !$quarantine ) ) { 3042 $msg_head_after .= " X-Text-Classification: $classification$crlf";3047 $msg_head_after .= "$xtc_header: $classification$crlf"; 3043 3048 } 3044 3049 3045 3050 # Add the XPL header … … 3088 3093 print $client "To: $encoded_to$crlf"; 3089 3094 print $client "Date: " . $self->{parser__}->get_header( 'date' ) . "$crlf"; 3090 3095 print $client "Subject:$msg_subject$crlf" if ( defined( $msg_subject ) ); 3091 print $client " X-Text-Classification: $classification$crlf" if ( $xtc_insertion );3096 print $client "$xtc_header: $classification$crlf" if ( $xtc_insertion ); 3092 3097 print $client "X-POPFile-Link: $xpl$crlf" if ( $xpl_insertion ); 3093 3098 print $client "MIME-Version: 1.0$crlf"; 3094 3099 print $client "Content-Type: multipart/report; boundary=\"$slot\"$crlf$crlf--$slot$crlf";