- Plug two problems related to spamassassin 3.0:

- #10488 	Milter adding blank line with Spamassassin-3.0.0
    - #10531 	reject with SA 3.0.0

PR:		ports/72591
Submitted by:	ume
This commit is contained in:
Pav Lucistnik 2004-10-15 13:50:21 +00:00
parent 325ed1f757
commit eedbbdade0
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=119502
2 changed files with 23 additions and 3 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= spamass-milter
PORTVERSION= 0.2.0
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_SAVANNAH}
MASTER_SITE_SUBDIR= spamass-milt

View File

@ -1,5 +1,5 @@
--- spamass-milter.cpp.orig Thu Jun 26 16:10:44 2003
+++ spamass-milter.cpp Thu Jun 10 11:46:12 2004
+++ spamass-milter.cpp Wed Oct 13 00:52:23 2004
@@ -102,6 +102,10 @@
#include <csignal>
#include <string>
@ -29,7 +29,27 @@
update_or_insert(assassin, ctx, assassin->spam_flag(), &SpamAssassin::set_spam_flag, "X-Spam-Flag");
update_or_insert(assassin, ctx, assassin->spam_status(), &SpamAssassin::set_spam_status, "X-Spam-Status");
@@ -1341,7 +1349,11 @@
@@ -365,7 +373,7 @@
{
int score, rv;
const char *spam_status = assassin->spam_status().c_str();
- rv = sscanf(spam_status,"%*s hits=%d", &score);
+ rv = sscanf(spam_status,"%*s score=%d", &score);
if (rv != 1)
debug(D_ALWAYS, "Could not extract score from <%s>", spam_status);
else
@@ -539,6 +547,10 @@
}
}
+ /* if the header line ends in \r\n, don't return the \r */
+ 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 );
@@ -1341,7 +1353,11 @@
{
// assuming we have a recipient in the form: <username@somehost.somedomain>
// we return 'username'