Ticket #92: Classifier_Bayes.pm.diff
| File Classifier_Bayes.pm.diff, 2.1 kB (added by amatubu, 3 years ago) |
|---|
-
Classifier/Bayes.pm
old new 2842 2842 # Add the Subject line modification or the original line back again 2843 2843 # Don't add the classification unless it is not present 2844 2844 2845 if ( ( $subject_modification ) && ( !$quarantine ) ) { 2845 my $original_msg_subject = $msg_subject; 2846 2847 if ( $subject_modification ) { 2846 2848 if ( !defined( $msg_subject ) ) { # PROFILE BLOCK START 2847 2849 $msg_subject = " $modification"; 2848 2850 } elsif ( $msg_subject !~ /\Q$modification\E/ ) { … … 2850 2852 } # PROFILE BLOCK STOP 2851 2853 } 2852 2854 2853 if ( defined( $msg_subject ) ) { 2854 $msg_head_before .= "Subject:$msg_subject$crlf"; 2855 if ( $quarantine ) { 2856 if ( defined( $original_msg_subject ) ) { 2857 $msg_head_before .= "Subject:$original_msg_subject$crlf"; 2858 } 2859 } else { 2860 if ( defined( $msg_subject ) ) { 2861 $msg_head_before .= "Subject:$msg_subject$crlf"; 2862 } 2855 2863 } 2856 2864 2857 2865 # Add LF if $msg_head_after ends with CR to avoid header concatination … … 2914 2922 print $client "From: $encoded_from$crlf"; 2915 2923 print $client "To: $encoded_to$crlf"; 2916 2924 print $client "Date: " . $self->{parser__}->get_header( 'date' ) . "$crlf"; 2917 # Don't add the classification unless it is not present 2918 if ( ( defined( $msg_subject ) && ( $msg_subject !~ /\[\Q$classification\E\]/ ) ) && # PROFILE BLOCK START 2919 ( $subject_modification == 1 ) ) { # PROFILE BLOCK STOP 2920 $msg_subject = " $modification$msg_subject"; 2921 } 2922 print $client "Subject:$msg_subject$crlf"; 2925 print $client "Subject:$msg_subject$crlf" if ( defined( $msg_subject ) ); 2923 2926 print $client "X-Text-Classification: $classification$crlf" if ( $xtc_insertion ); 2924 2927 print $client "X-POPFile-Link: $xpl$crlf" if ( $xpl_insertion ); 2925 2928 print $client "MIME-Version: 1.0$crlf";