Ticket #92: Classifier_Bayes.pm.diff

File Classifier_Bayes.pm.diff, 2.1 kB (added by amatubu, 3 years ago)

Patch for Bayes.pm

  • Classifier/Bayes.pm

    old new  
    28422842    # Add the Subject line modification or the original line back again 
    28432843    # Don't add the classification unless it is not present 
    28442844 
    2845     if ( ( $subject_modification ) && ( !$quarantine ) ) { 
     2845    my $original_msg_subject = $msg_subject; 
     2846 
     2847    if ( $subject_modification ) { 
    28462848        if ( !defined( $msg_subject ) ) {   # PROFILE BLOCK START 
    28472849            $msg_subject = " $modification"; 
    28482850        } elsif ( $msg_subject !~ /\Q$modification\E/ ) { 
     
    28502852        }                                   # PROFILE BLOCK STOP 
    28512853    } 
    28522854 
    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        } 
    28552863    } 
    28562864 
    28572865    # Add LF if $msg_head_after ends with CR to avoid header concatination 
     
    29142922           print $client "From: $encoded_from$crlf"; 
    29152923           print $client "To: $encoded_to$crlf"; 
    29162924           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 ) ); 
    29232926           print $client "X-Text-Classification: $classification$crlf" if ( $xtc_insertion ); 
    29242927           print $client "X-POPFile-Link: $xpl$crlf" if ( $xpl_insertion ); 
    29252928           print $client "MIME-Version: 1.0$crlf";