Spamass-Milter Patch for recent Spamassassin 3.1.1 PerMsgStatus.pm
changes...
Forrest Aldrich
forrie at forrie.com
Thu Mar 23 17:46:26 UTC 2006
The recent change to SA-3.1.1 in PerMsgStatus.pm caused some headers to
leak into the displayed message when using spamass-milter, due to the
handing of LF/CR.
I corresponded with Dan Nelson, the author of Spamass-Milter, and he
kindly replicated the problem and provided the following patch, which
I've verified as working.
It should be checked in to CVS as "patch-aa" in the files section of the
port:
--- spamass-milter.cpp 2 Jun 2005 18:30:25 -0000 1.89
+++ spamass-milter.cpp 23 Mar 2006 05:51:39 -0000
@@ -679,9 +679,16 @@
if (header[field_end-1] == '\r')
field_end--;
- // Maybe remove the whitespace picked up when a header wraps - this
- // might actually be a requirement
- return header.substr( field_start, field_end - field_start );
+ string data = header.substr( field_start, field_end - field_start );
+
+ /* Replace all CRLF pairs with LF */
+ idx = 0;
+ while ( (idx = data.find("\r\n", idx)) != string::npos )
+ {
+ data.replace(idx,2,"\n");
+ }
+
+ return data;
}
Thanks.
Forrest
More information about the freebsd-ports
mailing list