On Tue, Nov 08, 2005 at 05:28:19PM +0100, Frank Denis (Jedi/Sector One) wrote:
Here's an update to the first patch release of DSPAM 3.6.
An additionnal patch has been added to let it compile with gcc 2.x
(discussed on the dspam mailing list).
Here's an updated version, with the right gcc 2.x patch that has been
merged in the CVS tree.
diff -urN mail/dspam.orig/Makefile mail/dspam/Makefile
--- mail/dspam.orig/Makefile Fri Nov 4 11:22:40 2005
+++ mail/dspam/Makefile Tue Nov 8 16:07:25 2005
@@ -2,7 +2,7 @@
COMMENT= "anti-spam filter"
-VERSION= 3.6.0
+VERSION= 3.6.1
DISTNAME= dspam-${VERSION}
CATEGORIES= mail
diff -urN mail/dspam.orig/distinfo mail/dspam/distinfo
--- mail/dspam.orig/distinfo Mon Nov 7 19:05:31 2005
+++ mail/dspam/distinfo Tue Nov 8 16:11:02 2005
@@ -1,4 +1,4 @@
-MD5 (dspam-3.6.0.tar.gz) = d9ee63a8cf67ea933d711b00851ce916
-RMD160 (dspam-3.6.0.tar.gz) = eb4b7ff0f260a12508b47d5141a9bf1a0cf49326
-SHA1 (dspam-3.6.0.tar.gz) = 19c0064902544bde90d0302b5d657782a4f2cc8f
-SIZE (dspam-3.6.0.tar.gz) = 732042
+MD5 (dspam-3.6.1.tar.gz) = 615807289462859f6e2cd12e3f490a49
+RMD160 (dspam-3.6.1.tar.gz) = 74a711b42ae11d70ab6006eae31c1762e20f4fef
+SHA1 (dspam-3.6.1.tar.gz) = 9d7ed8754cffad0219af9e6c0c3587b2159e8096
+SIZE (dspam-3.6.1.tar.gz) = 739401
diff -urN mail/dspam.orig/patches/patch-UPGRADING
mail/dspam/patches/patch-UPGRADING
--- mail/dspam.orig/patches/patch-UPGRADING Thu Jan 1 01:00:00 1970
+++ mail/dspam/patches/patch-UPGRADING Tue Nov 8 23:45:02 2005
@@ -0,0 +1,16 @@
+$OpenBSD$
+--- UPGRADING.orig Tue Oct 25 14:32:09 2005
++++ UPGRADING Tue Nov 8 23:44:49 2005
+@@ -8,8 +8,10 @@ UPGRADING FROM < 3.6.1
+
+ - For users of hash_drv: A cssconvert tool has been provided to convert all
+ v3.6.0 databases to the correct, 8-byte aligned format used in all newer
+- versions. Please run cssconvert on all of your .css databases before
+- turning on your new version of dspam.
++ versions.
++
++ The OpenBSD port of DSPAM 3.6.0 already used the correctly aligned format,
++ so that you don't need to run cssconvert before upgrading to 3.6.1 and
later.
+
+ UPGRADING FROM < 3.6.0
+ ----------------------
diff -urN mail/dspam.orig/patches/patch-configure
mail/dspam/patches/patch-configure
--- mail/dspam.orig/patches/patch-configure Wed Oct 26 08:18:38 2005
+++ mail/dspam/patches/patch-configure Thu Jan 1 01:00:00 1970
@@ -1,12 +0,0 @@
-$OpenBSD: patch-configure,v 1.1 2005/10/26 06:18:38 jakob Exp $
---- configure.orig Mon Oct 17 02:50:02 2005
-+++ configure Tue Oct 18 18:02:03 2005
-@@ -20031,7 +20031,7 @@ fi
- done
-
-
--for ac_func in strsep
-+for ac_func in strsep strcasestr
- do
- as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
- echo "$as_me:$LINENO: checking for $ac_func" >&5
diff -urN mail/dspam.orig/patches/patch-src_agent_shared_c
mail/dspam/patches/patch-src_agent_shared_c
--- mail/dspam.orig/patches/patch-src_agent_shared_c Wed Oct 26 08:18:38 2005
+++ mail/dspam/patches/patch-src_agent_shared_c Thu Jan 1 01:00:00 1970
@@ -1,18 +0,0 @@
-$OpenBSD: patch-src_agent_shared_c,v 1.1 2005/10/26 06:18:38 jakob Exp $
---- src/agent_shared.c.orig Tue Oct 25 22:46:43 2005
-+++ src/agent_shared.c Tue Oct 25 22:47:02 2005
-@@ -1,4 +1,4 @@
--/* $Id: patch-src_agent_shared_c,v 1.1 2005/10/26 06:18:38 jakob Exp $ */
-+/* $Id: patch-src_agent_shared_c,v 1.1 2005/10/26 06:18:38 jakob Exp $ */
-
- /*
- DSPAM
-@@ -718,7 +718,7 @@ buffer * read_stdin(AGENT_CTX *ATX) {
- }
-
- if (_ds_match_attribute(agent_config, "DataSource", "document")) {
-- buffer_cat(msg, ".\n\n");
-+ buffer_cat(msg, ": \n\n");
- body = 1;
- }
-
diff -urN mail/dspam.orig/patches/patch-src_auto-config_h_in mail/dspam/patches/patch-src_auto-config_h_in
--- mail/dspam.orig/patches/patch-src_auto-config_h_in Wed Oct 26 08:18:38 2005
+++ mail/dspam/patches/patch-src_auto-config_h_in Thu Jan 1 01:00:00 1970
@@ -1,13 +0,0 @@
-$OpenBSD: patch-src_auto-config_h_in,v 1.1 2005/10/26 06:18:38 jakob Exp $
---- src/auto-config.h.in.orig Mon Oct 17 02:51:17 2005
-+++ src/auto-config.h.in Tue Oct 18 18:08:00 2005
-@@ -86,6 +86,9 @@
- /* Define to 1 if you have the `strsep' function. */
- #undef HAVE_STRSEP
-
-+/* Define to 1 if you have the `strcasestr' function. */
-+#undef HAVE_STRCASESTR
-+
- /* Define to 1 if you have the `strtok_r' function. */
- #undef HAVE_STRTOK_R
-
diff -urN mail/dspam.orig/patches/patch-src_daemon_c mail/dspam/patches/patch-src_daemon_c
--- mail/dspam.orig/patches/patch-src_daemon_c Wed Oct 26 08:18:38 2005
+++ mail/dspam/patches/patch-src_daemon_c Thu Jan 1 01:00:00 1970
@@ -1,21 +0,0 @@
-$OpenBSD: patch-src_daemon_c,v 1.1 2005/10/26 06:18:38 jakob Exp $
---- src/daemon.c.orig Tue Oct 25 22:46:43 2005
-+++ src/daemon.c Tue Oct 25 22:47:02 2005
-@@ -1,4 +1,4 @@
--/* $Id: patch-src_daemon_c,v 1.1 2005/10/26 06:18:38 jakob Exp $ */
-+/* $Id: patch-src_daemon_c,v 1.1 2005/10/26 06:18:38 jakob Exp $ */
-
- /*
- DSPAM
-@@ -732,8 +732,9 @@ GETCMD:
- /* Send a terminating '.' if --stdout in 'dspam' mode */
-
- if (ATX->sockfd_output) {
-- if (send_socket(TTX, ".")<=0)
-- goto CLOSE;
-+ if (!(ATX->flags & DAF_SUMMARY))
-+ if (send_socket(TTX, ".")<=0)
-+ goto CLOSE;
-
- /* Otherwise, produce standard delivery results */
-
diff -urN mail/dspam.orig/patches/patch-src_decode_c mail/dspam/patches/patch-src_decode_c
--- mail/dspam.orig/patches/patch-src_decode_c Wed Oct 26 08:18:38 2005
+++ mail/dspam/patches/patch-src_decode_c Thu Jan 1 01:00:00 1970
@@ -1,63 +0,0 @@
-$OpenBSD: patch-src_decode_c,v 1.1 2005/10/26 06:18:38 jakob Exp $
---- src/decode.c.orig Thu Oct 13 16:28:13 2005
-+++ src/decode.c Tue Oct 25 22:47:02 2005
-@@ -1,4 +1,4 @@
--/* $Id: patch-src_decode_c,v 1.1 2005/10/26 06:18:38 jakob Exp $ */
-+/* $Id: patch-src_decode_c,v 1.1 2005/10/26 06:18:38 jakob Exp $ */
-
- /*
- DSPAM
-@@ -528,11 +528,12 @@ _ds_analyze_header (
-
- if (!strcasecmp (header->heading, "Content-Type"))
- {
-+ int len = strlen(header->data);
- if (!strncasecmp (header->data, "text", 4)) {
- block->media_type = MT_TEXT;
-- if (!strncasecmp (header->data + 5, "plain", 5))
-+ if (len >= 5 && !strncasecmp (header->data + 5, "plain", 5))
- block->media_subtype = MST_PLAIN;
-- else if (!strncasecmp (header->data + 5, "html", 4))
-+ else if (len >= 5 && !strncasecmp (header->data + 5, "html", 4))
- block->media_subtype = MST_HTML;
- else
- block->media_subtype = MST_OTHER;
-@@ -541,7 +542,7 @@ _ds_analyze_header (
- else if (!strncasecmp (header->data, "application", 11))
- {
- block->media_type = MT_APPLICATION;
-- if (!strncasecmp (header->data + 12, "dspam-signature", 15))
-+ if (len >= 12 && !strncasecmp (header->data + 12, "dspam-signature",
15))
- block->media_subtype = MST_DSPAM_SIGNATURE;
- else
- block->media_subtype = MST_OTHER;
-@@ -550,9 +551,9 @@ _ds_analyze_header (
- else if (!strncasecmp (header->data, "message", 7))
- {
- block->media_type = MT_MESSAGE;
-- if (!strncasecmp (header->data + 8, "rfc822", 6))
-+ if (len >= 8 && !strncasecmp (header->data + 8, "rfc822", 6))
- block->media_subtype = MST_RFC822;
-- else if (!strncasecmp (header->data + 8, "inoculation", 11))
-+ else if (len >= 8 && !strncasecmp (header->data + 8, "inoculation", 11))
- block->media_subtype = MST_INOCULATION;
- else
- block->media_subtype = MST_OTHER;
-@@ -563,13 +564,13 @@ _ds_analyze_header (
- char boundary[128];
-
- block->media_type = MT_MULTIPART;
-- if (!strncasecmp (header->data + 10, "mixed", 5))
-+ if (len >= 10 && !strncasecmp (header->data + 10, "mixed", 5))
- block->media_subtype = MST_MIXED;
-- else if (!strncasecmp (header->data + 10, "alternative", 11))
-+ else if (len >= 10 && !strncasecmp (header->data + 10, "alternative",
11))
- block->media_subtype = MST_ALTERNATIVE;
-- else if (!strncasecmp (header->data + 10, "signed", 6))
-+ else if (len >= 10 && !strncasecmp (header->data + 10, "signed", 6))
- block->media_subtype = MST_SIGNED;
-- else if (!strncasecmp (header->data + 10, "encrypted", 9))
-+ else if (len >= 10 && !strncasecmp (header->data + 10, "encrypted", 9))
- block->media_subtype = MST_ENCRYPTED;
- else
- block->media_subtype = MST_OTHER;
diff -urN mail/dspam.orig/patches/patch-src_dspam_c
mail/dspam/patches/patch-src_dspam_c
--- mail/dspam.orig/patches/patch-src_dspam_c Wed Oct 26 08:18:38 2005
+++ mail/dspam/patches/patch-src_dspam_c Tue Nov 8 16:15:31 2005
@@ -1,6 +1,6 @@
$OpenBSD: patch-src_dspam_c,v 1.1 2005/10/26 06:18:38 jakob Exp $
---- src/dspam.c.orig Tue Oct 4 18:22:58 2005
-+++ src/dspam.c Mon Oct 17 14:48:42 2005
+--- src/dspam.c.orig Tue Oct 25 14:32:09 2005
++++ src/dspam.c Tue Nov 8 16:11:16 2005
@@ -382,7 +382,7 @@ process_message (
CTX->confidence = 1.0;
STATUS("A virus was detected in the message contents");
@@ -50,7 +50,7 @@
if (_ds_pref_val(ATX->PTX, "spamSubject")[0] != '\n' &&
_ds_pref_val(ATX->PTX, "spamSubject")[0] != 0)
{
-@@ -1572,7 +1572,7 @@ int process_users(AGENT_CTX *ATX, buffer
+@@ -1596,7 +1596,7 @@ int process_users(AGENT_CTX *ATX, buffer
if (parse_message == NULL) {
LOG(LOG_CRIT, ERR_MEM_ALLOC);
presult->exitcode = ERC_PROCESS;
diff -urN mail/dspam.orig/patches/patch-src_hash_drv_h
mail/dspam/patches/patch-src_hash_drv_h
--- mail/dspam.orig/patches/patch-src_hash_drv_h Wed Oct 26 08:18:39 2005
+++ mail/dspam/patches/patch-src_hash_drv_h Thu Jan 1 01:00:00 1970
@@ -1,17 +0,0 @@
-$OpenBSD: patch-src_hash_drv_h,v 1.1 2005/10/26 06:18:39 jakob Exp $
---- src/hash_drv.h.orig Sat Oct 1 00:15:00 2005
-+++ src/hash_drv.h Tue Oct 25 22:47:02 2005
-@@ -1,4 +1,4 @@
--/* $Id: patch-src_hash_drv_h,v 1.1 2005/10/26 06:18:39 jakob Exp $ */
-+/* $Id: patch-src_hash_drv_h,v 1.1 2005/10/26 06:18:39 jakob Exp $ */
-
- /*
- DSPAM
-@@ -39,6 +39,7 @@ typedef struct _hash_drv_header
- {
- unsigned long hash_rec_max;
- struct _ds_spam_totals totals;
-+ char padding[4]; /* Keep 8-byte alignment */
- } *hash_drv_header_t;
-
- typedef struct _hash_drv_map
diff -urN mail/dspam.orig/patches/patch-src_libdspam_c
mail/dspam/patches/patch-src_libdspam_c
--- mail/dspam.orig/patches/patch-src_libdspam_c Wed Oct 26 08:18:39 2005
+++ mail/dspam/patches/patch-src_libdspam_c Tue Nov 8 23:44:25 2005
@@ -1,46 +1,30 @@
-$OpenBSD: patch-src_libdspam_c,v 1.1 2005/10/26 06:18:39 jakob Exp $
---- src/libdspam.c.orig Mon Oct 17 02:48:46 2005
-+++ src/libdspam.c Mon Oct 17 14:48:42 2005
-@@ -594,9 +594,9 @@ dspam_process (DSPAM_CTX * CTX, const ch
+$OpenBSD$
+--- src/libdspam.c.orig Thu Nov 3 15:33:22 2005
++++ src/libdspam.c Tue Nov 8 23:44:12 2005
+@@ -1,4 +1,4 @@
+-/* $Id: libdspam.c,v 1.142 2005/11/02 19:39:28 jonz Exp $ */
++/* $Id: libdspam.c,v 1.143 2005/11/08 15:26:44 jonz Exp $ */
- if (CTX->class[0] == 0) {
- if (CTX->result == DSR_ISSPAM)
-- strcpy(CTX->class, LANG_CLASS_SPAM);
-+ strlcpy(CTX->class, LANG_CLASS_SPAM, sizeof (CTX->class));
- else if (CTX->result == DSR_ISINNOCENT)
-- strcpy(CTX->class, LANG_CLASS_INNOCENT);
-+ strlcpy(CTX->class, LANG_CLASS_INNOCENT, sizeof (CTX->class));
- }
+ /*
+ DSPAM
+@@ -672,6 +672,8 @@ dspam_getsource (
+ current_heading = (ds_header_t) node_nt->ptr;
+ if (!strcmp (current_heading->heading, "Received"))
+ {
++ char *data, *ptr, *tok;
++
+ // detect and skip "Received: (qmail..." lines
+ if (!strncmp(current_heading->data, "(qmail", 6))
+ {
+@@ -680,9 +682,8 @@ dspam_getsource (
+ continue;
+ }
- if (is_toe)
-@@ -768,9 +768,9 @@ _ds_operate (DSPAM_CTX * CTX, char *head
- goto bail;
- }
+- char *data = strdup (current_heading->data);
+- char *ptr = strstr (data, "from");
+- char *tok;
++ data = strdup (current_heading->data);
++ ptr = strstr (data, "from");
-- strcpy(CTX->signature->data, headers);
-- strcat(CTX->signature->data, "\001");
-- strcat(CTX->signature->data, body);
-+ strlcpy(CTX->signature->data, headers, CTX->signature->length);
-+ strlcat(CTX->signature->data, "\001", CTX->signature->length);
-+ strlcat(CTX->signature->data, body, CTX->signature->length);
- }
-
- if (!diction)
-@@ -962,7 +962,7 @@ _ds_operate (DSPAM_CTX * CTX, char *head
- if (CTX->flags & DSF_WHITELIST && do_whitelist) {
- LOGDEBUG("auto-whitelisting this message");
- CTX->result = DSR_ISINNOCENT;
-- strcpy(CTX->class, LANG_CLASS_WHITELISTED);
-+ strlcpy(CTX->class, LANG_CLASS_WHITELISTED, sizeof (CTX->class));
- }
-
- /* Update Totals */
-@@ -2282,7 +2282,7 @@ int _ds_instantiate_bnr(
- previous_bnr_probs[i] = previous_bnr_probs[i+1];
-
- previous_bnr_probs[BNR_SIZE-1] = _ds_round(ds_term->s.probability);
-- sprintf(bnr_token, "bnr.%c|", identifier);
-+ snprintf(bnr_token, sizeof (bnr_token), "bnr.%c|", identifier);
- for(i=0;i<BNR_SIZE;i++) {
- char x[6];
- snprintf(x, 6, "%01.2f_", previous_bnr_probs[i]);
+ if (ptr != NULL)
+ {
diff -urN mail/dspam.orig/patches/patch-src_util_c
mail/dspam/patches/patch-src_util_c
--- mail/dspam.orig/patches/patch-src_util_c Wed Oct 26 08:18:39 2005
+++ mail/dspam/patches/patch-src_util_c Tue Nov 8 16:15:32 2005
@@ -1,6 +1,6 @@
$OpenBSD: patch-src_util_c,v 1.1 2005/10/26 06:18:39 jakob Exp $
---- src/util.c.orig Sat Oct 1 06:32:19 2005
-+++ src/util.c Mon Oct 17 14:48:42 2005
+--- src/util.c.orig Wed Oct 26 19:39:32 2005
++++ src/util.c Tue Nov 8 16:13:59 2005
@@ -278,7 +278,7 @@ const char * _ds_userdir_path (char *pat
#endif
@@ -19,23 +19,7 @@
#endif
/* Use home/opt-in/ and home/opt-out/ to store opt files, instead of
-@@ -675,6 +675,7 @@ float _ds_round(float n) {
- return (r/100.0);
- }
-
-+#ifndef __HAVE_STRCASESTR__
- char *
- strcasestr(s, find)
- const char *s, *find;
-@@ -695,6 +696,7 @@ strcasestr(s, find)
- }
- return ((char *)s);
- }
-+#endif
-
- #ifndef HAVE_INET_NTOA_R
- /*
-@@ -746,6 +748,7 @@ inet_ntoa_r(struct in_addr in, char *buf
+@@ -748,6 +748,7 @@ inet_ntoa_r(struct in_addr in, char *buf
return(NULL);
}
diff -urN mail/dspam.orig/patches/patch-src_util_h mail/dspam/patches/patch-src_util_h
--- mail/dspam.orig/patches/patch-src_util_h Wed Oct 26 08:18:39 2005
+++ mail/dspam/patches/patch-src_util_h Thu Jan 1 01:00:00 1970
@@ -1,13 +0,0 @@
-$OpenBSD: patch-src_util_h,v 1.1 2005/10/26 06:18:39 jakob Exp $
---- src/util.h.orig Sat Oct 1 06:32:19 2005
-+++ src/util.h Tue Oct 18 18:04:58 2005
-@@ -40,7 +40,9 @@ void chomp (char *string);
- char * ltrim (char *str);
- char * rtrim (char *str);
- int lc (char *buff, const char *string);
-+#ifndef __HAVE_STRCASESTR__
- char * strcasestr (const char *, const char *);
-+#endif
-
- #define ALLTRIM(str) ltrim(rtrim(str))
-
diff -urN mail/dspam.orig/patches/patch-webui_cgi-bin_dspam_cgi mail/dspam/patches/patch-webui_cgi-bin_dspam_cgi
--- mail/dspam.orig/patches/patch-webui_cgi-bin_dspam_cgi Wed Oct 26
08:18:39 2005
+++ mail/dspam/patches/patch-webui_cgi-bin_dspam_cgi Thu Jan 1 01:00:00 1970
@@ -1,14 +0,0 @@
-$OpenBSD: patch-webui_cgi-bin_dspam_cgi,v 1.1 2005/10/26 06:18:39 jakob Exp $
---- webui/cgi-bin/dspam.cgi.orig Sun Oct 16 16:43:36 2005
-+++ webui/cgi-bin/dspam.cgi Mon Oct 17 22:57:56 2005
-@@ -195,8 +195,8 @@ sub DisplayHistory {
- }
- close (LINES);
-
-- $end = $all_lines - (($history_site-1) * $CONFIG{'HISTORY_PER_SITE'});
-- $begin = $end - $CONFIG{'HISTORY_PER_SITE'} + 1 ;
-+ $end = $all_lines - (($history_site-1) * $CONFIG{'HISTORY_PER_PAGE'});
-+ $begin = $end - $CONFIG{'HISTORY_PER_PAGE'} + 1 ;
-
- if ($begin < 0) {
- $begin = 1;
diff -urN mail/dspam.orig/pkg/PFRAG.hash mail/dspam/pkg/PFRAG.hash
--- mail/dspam.orig/pkg/PFRAG.hash Wed Oct 26 08:18:39 2005
+++ mail/dspam/pkg/PFRAG.hash Tue Nov 8 16:25:21 2005
@@ -1,4 +1,5 @@
@comment $OpenBSD: PFRAG.hash,v 1.1 2005/10/26 06:18:39 jakob Exp $
bin/cssclean
bin/csscompress
+bin/cssconvert
bin/cssstat