Bug 2092 - Yet another extra CRLF in Report field
Summary: Yet another extra CRLF in Report field
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: PC All
: P5 normal
Target Milestone: 2.60
Assignee: Theo Van Dinter
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-19 04:57 UTC by Andrew A. Vasilyev
Modified: 2003-06-20 02:55 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status
trivial patch ... everything that calls _process_header will add a newline, so we can trim extra newlines ... :) patch None Theo Van Dinter [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew A. Vasilyev 2003-06-19 04:57:37 UTC
Headers (empty line before Content-Length: after X-Spam-Report:):

Subject: XXX
Date: Thu, 19 Jun 2003 12:57:02 +0400
Organization: ZAO Demos-Internet
MIME-Version: 1.0
Content-Type: text/plain;
 charset="windows-1251"
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
X-Spam-Checker-Version: SpamAssassin 2.60-cvs-mail.demos
(1.193-2003-06-13-exp)
X-Spam-Level: +
X-Spam-Status: No, hits=1.1 required=5.0 tests=RU_WORD_SPAM2 autolearn=no
 version=2.60-cvs-mail.demos
X-Spam-Report: * RU_WORD_SPAM2 1.1 (BODY: Spam word)

Content-Length: 1550
Status:

  local.cf:

rewrite_subject 1
subject_tag *****SPAM*****
report_safe 0
fold_headers 1
add_header Flag spam _YESNOCAPS_
add_header Status all _YESNO_, hits=_HITS_ required=_REQD_ tests=_TESTS(,)_ 
autolearn=_AUTOLEARN_ version=_VERSION_
add_header Level all _STARS(+)_
add_header Checker-Version all SpamAssassin _VERSION_ (_SUBVERSION_)
add_header Report all _REPORT_
#
Comment 1 Theo Van Dinter 2003-06-19 10:28:52 UTC
have a nice 1 line patch for this. :)
Comment 2 Theo Van Dinter 2003-06-19 10:32:41 UTC
Created attachment 1061 [details]
trivial patch ...  everything that calls _process_header will add a newline, so we can trim extra newlines ... :)
Comment 3 Daniel Quinlan 2003-06-19 11:51:42 UTC
Do we have a test case for this?
Comment 4 Duncan Findlay 2003-06-19 16:56:28 UTC
+1 Sure
Comment 5 Theo Van Dinter 2003-06-19 18:09:13 UTC
no, we don't have a test case for this.

I suppose we could go make a small test message via GTUBE, pass it through SA, 
and make sure we end up with X paragraphs.
Comment 6 Daniel Quinlan 2003-06-19 21:31:22 UTC
Sorry, by test case, I just meant a real-life example that triggered the problem.

Comment 7 Justin Mason 2003-06-19 22:32:04 UTC
hmm... doesn't that need a /s on that regexp to match \n?
Comment 8 Theo Van Dinter 2003-06-20 08:04:59 UTC
Subject: Re:  Yet another extra CRLF in Report field

On Thu, Jun 19, 2003 at 09:31:22PM -0700, bugzilla-daemon@hughes-family.org wrote:
> Sorry, by test case, I just meant a real-life example that triggered the problem.

Oh.  Take any message, add the _REPORT_ header, run through SA.

The problem is that the REPORT lines have newlines at the end of each
line.  Then when it's added to the header, another newline is added.

Comment 9 Theo Van Dinter 2003-06-20 08:07:53 UTC
Subject: Re:  Yet another extra CRLF in Report field

On Thu, Jun 19, 2003 at 10:32:04PM -0700, bugzilla-daemon@hughes-family.org wrote:
> hmm... doesn't that need a /s on that regexp to match \n?

I don't think so.  /s lets . match \n, but we're not using . anywhere.
I just want to trim the final newline off the string.

Comment 10 Theo Van Dinter 2003-06-20 10:55:05 UTC
committed.