From: <jgr...@us...> - 2003-02-25 02:04:15
|
Update of /cvsroot/popfile/engine/Classifier In directory sc8-pr-cvs1:/tmp/cvs-serv6692/Classifier Modified Files: MailParse.pm Log Message: Merge kinematics patch that fixes bug 679405 and gives us magnets on multi-line headers and add his tests and fix a broken test and improve the test runner Index: MailParse.pm =================================================================== RCS file: /cvsroot/popfile/engine/Classifier/MailParse.pm,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** MailParse.pm 24 Feb 2003 23:08:48 -0000 1.89 --- MailParse.pm 25 Feb 2003 02:04:12 -0000 1.90 *************** *** 57,64 **** $self->{color} = 0; ! # This will store the from, to and subject from the last parse $self->{from} = ''; $self->{to} = ''; $self->{subject} = ''; --- 57,65 ---- $self->{color} = 0; ! # This will store the from, to, cc and subject from the last parse $self->{from} = ''; $self->{to} = ''; + $self->{cc} = ''; $self->{subject} = ''; *************** *** 757,760 **** --- 758,762 ---- $self->{from} = ''; $self->{to} = ''; + $self->{cc} = ''; $self->{subject} = ''; $self->{ut} = ''; *************** *** 833,836 **** --- 835,857 ---- if ( $header =~ /^(From|To|Cc|Reply\-To)/i ) { + + # Concatenate multi-line fields (To, CC) + + if ( ( $header =~ /^To/i ) || ( $header =~ /^Cc/i ) ) { + my $currpos = tell MSG; + my $tempread = <MSG>; + while ( $tempread =~ s/^[ \t]+(.*?)[\r\n]+// ) { + if ( $1 ne '' ) { + $argument .= $1; + $currpos = tell MSG; + $tempread = <MSG>; + } else { + last; + } + } + seek MSG, $currpos, 0; + print "\n$header: [[$argument]]\n" if $self->{debug}; + } + if ( $argument =~ /=\?(.{1,40})\?/ ) { update_word( $self, $1, 0, '', '', 'charset' ); *************** *** 847,855 **** $self->{to} = $self->decode_string( $argument ) if ( ( $header =~ /^To/i ) && ( $self->{to} eq '' ) ); while ( $argument =~ s/<([[:alpha:]0-9\-_\.]+?@([[:alpha:]0-9\-_\.]+?))>// ) { update_word($self, $1, 0, ';', '&',$prefix); add_url($self, $2, 0, '@', '[&<]',$prefix); } ! while ( $argument =~ s/([[:alpha:]0-9\-_\.]+?@([[:alpha:]0-9\-_\.]+))// ) { update_word($self, $1, 0, '', '',$prefix); --- 868,879 ---- $self->{to} = $self->decode_string( $argument ) if ( ( $header =~ /^To/i ) && ( $self->{to} eq '' ) ); + $prefix = 'cc' if ( $header =~ /^Cc/i ); + $self->{cc} = $self->decode_string( $argument ) if ( ( $header =~ /^Cc/i ) && ( $self->{cc} eq '' ) ); + while ( $argument =~ s/<([[:alpha:]0-9\-_\.]+?@([[:alpha:]0-9\-_\.]+?))>// ) { update_word($self, $1, 0, ';', '&',$prefix); add_url($self, $2, 0, '@', '[&<]',$prefix); } ! while ( $argument =~ s/([[:alpha:]0-9\-_\.]+?@([[:alpha:]0-9\-_\.]+))// ) { update_word($self, $1, 0, '', '',$prefix); |