1 From edb00a8d76a625bf03227ee2f6e915c9a0d90bad Mon Sep 17 00:00:00 2001
2 From: Mark Martinec <mmartinec@apache.org>
3 Date: Tue, 11 Apr 2017 18:37:20 +0000
4 Subject: [PATCH] Bug 7404: Bad regexp (and logic) in
5 MS::PerMsgStatus::get_content_preview
7 git-svn-id: https://svn.apache.org/repos/asf/spamassassin/trunk@1791010 13f79535-47bb-0310-9956-ffa450edef68
9 lib/Mail/SpamAssassin/PerMsgStatus.pm | 8 ++++----
10 1 file changed, 4 insertions(+), 4 deletions(-)
12 diff --git a/lib/Mail/SpamAssassin/PerMsgStatus.pm b/lib/Mail/SpamAssassin/PerMsgStatus.pm
13 index f8c55061b..126157bf5 100644
14 --- a/lib/Mail/SpamAssassin/PerMsgStatus.pm
15 +++ b/lib/Mail/SpamAssassin/PerMsgStatus.pm
16 @@ -896,16 +896,16 @@ sub get_content_preview {
17 $str .= shift @{$ary};
20 - chomp ($str); $str .= " [...]\n";
22 # in case the last line was huge, trim it back to around 200 chars
24 - $str =~ s/^(.{,200}).*$/$1/gs;
25 + $str =~ s/^(.{200}).+$/$1 [...]/gm;
26 + chomp ($str); $str .= "\n";
28 # now, some tidy-ups that make things look a bit prettier
29 - $str =~ s/-----Original Message-----.*$//gs;
30 + $str =~ s/-----Original Message-----.*$//gm;
31 $str =~ s/This is a multi-part message in MIME format\.//gs;
32 - $str =~ s/[-_\*\.]{10,}//gs;
33 + $str =~ s/[-_*.]{10,}//gs;
36 # add "Content preview:" ourselves, so that the text aligns