DSPAM update to 3.6.1

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

DSPAM update to 3.6.1

Frank Denis (Jedi/Sector One)-3
  Hello,

  Here's an update to the first patch release of DSPAM 3.6.
 
  Some patches from the previous port were removed as they were merged
upstream.

  An additionnal patch has been added to let it compile with gcc 2.x
(discussed on the dspam mailing list).

  Best regards,
 
       -Frank.

 
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 16:35:35 2005
@@ -0,0 +1,16 @@
+$OpenBSD$
+--- UPGRADING.orig Tue Oct 25 14:32:09 2005
++++ UPGRADING Tue Nov  8 16:34:38 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 16:48:18 2005
@@ -1,46 +1,25 @@
 $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
+--- src/libdspam.c.orig Tue Nov  8 16:46:51 2005
++++ src/libdspam.c Tue Nov  8 16:48:04 2005
+@@ -672,6 +672,10 @@ dspam_getsource (
+     current_heading = (ds_header_t) node_nt->ptr;
+     if (!strcmp (current_heading->heading, "Received"))
+     {
++      char *data = strdup (current_heading->data);
++      char *ptr = strstr (data, "from");
++      char *tok;
++
+       // detect and skip "Received: (qmail..." lines
+       if (!strncmp(current_heading->data, "(qmail", 6))
+       {
+@@ -679,10 +683,6 @@ dspam_getsource (
+         node_nt = c_nt_next (current_block->headers, &c);
+         continue;
+       }
+-
+-      char *data = strdup (current_heading->data);
+-      char *ptr = strstr (data, "from");
+-      char *tok;
 
-   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));
-   }
-
-   if (is_toe)
-@@ -768,9 +768,9 @@ _ds_operate (DSPAM_CTX * CTX, char *head
-       goto bail;
-     }
-
--    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_libdspam_c.orig mail/dspam/patches/patch-src_libdspam_c.orig
--- mail/dspam.orig/patches/patch-src_libdspam_c.orig Thu Jan  1 01:00:00 1970
+++ mail/dspam/patches/patch-src_libdspam_c.orig Tue Nov  8 16:15:32 2005
@@ -0,0 +1,46 @@
+$OpenBSD: patch-src_libdspam_c,v 1.1 2005/10/26 06:18:39 jakob Exp $
+--- src/libdspam.c.orig Thu Nov  3 15:33:22 2005
++++ src/libdspam.c Tue Nov  8 16:11:16 2005
+@@ -601,9 +601,9 @@ dspam_process (DSPAM_CTX * CTX, const ch
+
+   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));
+   }
+
+   if (is_toe)
+@@ -820,9 +820,9 @@ _ds_operate (DSPAM_CTX * CTX, char *head
+       goto bail;
+     }
+
+-    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)
+@@ -1013,7 +1013,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 */
+@@ -2344,7 +2344,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]);
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



--
Frank - my stupid blog: http://00f.net
L'annuaire des professionnels de la manucure et de la pedicure :
http://www.manucure-pro.com

Reply | Threaded
Open this post in threaded view
|

Re: DSPAM update to 3.6.1

Frank Denis (Jedi/Sector One)-3
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

Reply | Threaded
Open this post in threaded view
|

Re: DSPAM update to 3.6.1 [last one !]

Frank Denis (Jedi/Sector One)-3
  Last-minute change...
 
  DSPAM author has just repackaged dspam 3.6.1 without any version bump
in order to merge the gcc 2.x fix that was considered as a showstopper.

  As the hashes and file size of the tarball have changed, here's a final
update to the 3.6.1 update.

  The "daemon" flavor has been nuked by the way. Having it enabled for all
supported backends has no overhead and the spamc command is always built
regardless of the support for the daemon mode.

diff -urN mail/dspam.orig/Makefile mail/dspam/Makefile
--- mail/dspam.orig/Makefile Wed Oct 26 08:18:38 2005
+++ mail/dspam/Makefile Wed Nov  9 00:11:26 2005
@@ -2,7 +2,7 @@
 
 COMMENT= "anti-spam filter"
 
-VERSION= 3.6.0
+VERSION= 3.6.1
 DISTNAME= dspam-${VERSION}
 CATEGORIES= mail
 
@@ -40,7 +40,7 @@
 EXAMPLESDIR= ${PREFIX}/share/examples/dspam
 DRIVER=
 
-FLAVORS= sqlite3 sqlite mysql pgsql hash daemon clamav ldap
+FLAVORS= sqlite3 sqlite mysql pgsql hash clamav ldap
 FLAVOR?= sqlite3
 
 .if ${FLAVOR:L:Mmysql}
@@ -107,18 +107,12 @@
 
 .if ${FLAVOR:L:Mldap}
 CONFIGURE_ARGS+= --enable-ldap
-LIB_DEPENDS= ldap_r.7,lber.7::databases/openldap
+LIB_DEPENDS= ldap_r.8,lber.8::databases/openldap
 CONFIGURE_ENV= CPPFLAGS="-I${DEPBASE}/include" \
  LDFLAGS="-L${DEPBASE}/lib"
 .endif
 
-.if ${FLAVOR:L:Mdaemon}
-.if ${FLAVOR:L:Msqlite3}
-BROKEN= daemon mode is currently incompatible with sqlite3
-.endif
-.if ${FLAVOR:L:Msqlite}
-BROKEN= daemon mode is currently incompatible with sqlite
-.endif
+.if empty(FLAVOR:L:Msqlite3) && empty(FLAVOR:L:Msqlite)
 CONFIGURE_ARGS+= --enable-daemon
 .endif
 
diff -urN mail/dspam.orig/distinfo mail/dspam/distinfo
--- mail/dspam.orig/distinfo Sat Nov  5 17:14:28 2005
+++ mail/dspam/distinfo Wed Nov  9 00:04:26 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) = 6aad568823f297852dff4989da332e22
+SHA1 (dspam-3.6.1.tar.gz) = 864cd85d44350c6b4d203cde40d025cf5015af82
+RMD160 (dspam-3.6.1.tar.gz) = d93f73ad87ea0061e3b2c3d4dc84578872bce74d
+SIZE (dspam-3.6.1.tar.gz) = 739389
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 Thu Jan  1 01:00:00 1970
@@ -1,46 +0,0 @@
-$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
-
-   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));
-   }
-
-   if (is_toe)
-@@ -768,9 +768,9 @@ _ds_operate (DSPAM_CTX * CTX, char *head
-       goto bail;
-     }
-
--    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]);
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/DESCR mail/dspam/pkg/DESCR
--- mail/dspam.orig/pkg/DESCR Wed Oct 26 08:18:39 2005
+++ mail/dspam/pkg/DESCR Wed Nov  9 00:09:07 2005
@@ -9,11 +9,6 @@
 
 Available flavors are:
 
-- daemon: add the ability to run dspam as multiple clients connecting to a
-central server. This flavor is required in order to use the --daemon and
---client command-line switches. However, the daemon mode is currently
-incompatible with sqlite.
-
 - clamav: enable usage of the clam antivirus.
 
 - ldap: include support for LDAP verification.
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

Reply | Threaded
Open this post in threaded view
|

Re: DSPAM update to 3.6.1 [last one !]

Jakob Schlyter
On Wed, 9 Nov 2005, Frank Denis (Jedi/Sector One) wrote:

> Last-minute change...
>  DSPAM author has just repackaged dspam 3.6.1 without any version bump
> in order to merge the gcc 2.x fix that was considered as a showstopper.
>
> As the hashes and file size of the tarball have changed, here's a final
> update to the 3.6.1 update.

can I get some confirmations that this is tested by current dspam users?

  jakob

Reply | Threaded
Open this post in threaded view
|

Re: DSPAM update to 3.6.1 [last one !]

Frank Denis (Jedi/Sector One)-3
On Fri, Nov 11, 2005 at 10:29:08AM +0100, Jakob Schlyter wrote:
>can I get some confirmations that this is tested by current dspam users?

  DSPAM 3.6.1 seems to work fine on i386 and amd64 and there are very few
changes between 3.6.0+patches from the previous port and 3.6.1.

  I got a report that multiple dependencies were not properly handled, due
to LIB_DEPENDS= usage instead of LIB_DEPENDS+=. This is fixed in the
attached diff.

diff -urN mail/dspam.orig/Makefile mail/dspam/Makefile
--- mail/dspam.orig/Makefile Wed Oct 26 08:18:38 2005
+++ mail/dspam/Makefile Fri Nov 11 15:17:03 2005
@@ -2,7 +2,7 @@
 
 COMMENT= "anti-spam filter"
 
-VERSION= 3.6.0
+VERSION= 3.6.1
 DISTNAME= dspam-${VERSION}
 CATEGORIES= mail
 
@@ -40,7 +40,7 @@
 EXAMPLESDIR= ${PREFIX}/share/examples/dspam
 DRIVER=
 
-FLAVORS= sqlite3 sqlite mysql pgsql hash daemon clamav ldap
+FLAVORS= sqlite3 sqlite mysql pgsql hash clamav ldap
 FLAVOR?= sqlite3
 
 .if ${FLAVOR:L:Mmysql}
@@ -83,7 +83,7 @@
 CONFIGURE_ARGS+= --with-storage-driver=sqlite_drv \
  --with-sqlite-includes=${LOCALBASE}/include \
  --with-sqlite-libraries=${LOCALBASE}/lib
-LIB_DEPENDS= sqlite::databases/sqlite
+LIB_DEPENDS+= sqlite.8::databases/sqlite
 DRIVER= sqlite
 .endif
 
@@ -96,29 +96,23 @@
 CONFIGURE_ARGS+= --with-storage-driver=sqlite3_drv \
  --with-sqlite-includes=${LOCALBASE}/include \
  --with-sqlite-libraries=${LOCALBASE}/lib
-LIB_DEPENDS= sqlite3::databases/sqlite3
+LIB_DEPENDS+= sqlite3.8::databases/sqlite3
 DRIVER= sqlite
 .endif
 
 .if ${FLAVOR:L:Mclamav}
 CONFIGURE_ARGS+= --enable-clamav
-LIB_DEPENDS= clamav.1::security/clamav
+LIB_DEPENDS+= clamav.1::security/clamav
 .endif
 
 .if ${FLAVOR:L:Mldap}
 CONFIGURE_ARGS+= --enable-ldap
-LIB_DEPENDS= ldap_r.7,lber.7::databases/openldap
+LIB_DEPENDS+= ldap_r.8,lber.8::databases/openldap
 CONFIGURE_ENV= CPPFLAGS="-I${DEPBASE}/include" \
  LDFLAGS="-L${DEPBASE}/lib"
 .endif
 
-.if ${FLAVOR:L:Mdaemon}
-.if ${FLAVOR:L:Msqlite3}
-BROKEN= daemon mode is currently incompatible with sqlite3
-.endif
-.if ${FLAVOR:L:Msqlite}
-BROKEN= daemon mode is currently incompatible with sqlite
-.endif
+.if empty(FLAVOR:L:Msqlite3) && empty(FLAVOR:L:Msqlite)
 CONFIGURE_ARGS+= --enable-daemon
 .endif
 
diff -urN mail/dspam.orig/distinfo mail/dspam/distinfo
--- mail/dspam.orig/distinfo Sat Nov  5 17:14:28 2005
+++ mail/dspam/distinfo Wed Nov  9 00:04:26 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) = 6aad568823f297852dff4989da332e22
+SHA1 (dspam-3.6.1.tar.gz) = 864cd85d44350c6b4d203cde40d025cf5015af82
+RMD160 (dspam-3.6.1.tar.gz) = d93f73ad87ea0061e3b2c3d4dc84578872bce74d
+SIZE (dspam-3.6.1.tar.gz) = 739389
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 Thu Jan  1 01:00:00 1970
@@ -1,46 +0,0 @@
-$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
-
-   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));
-   }
-
-   if (is_toe)
-@@ -768,9 +768,9 @@ _ds_operate (DSPAM_CTX * CTX, char *head
-       goto bail;
-     }
-
--    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]);
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/DESCR mail/dspam/pkg/DESCR
--- mail/dspam.orig/pkg/DESCR Wed Oct 26 08:18:39 2005
+++ mail/dspam/pkg/DESCR Wed Nov  9 00:09:07 2005
@@ -9,11 +9,6 @@
 
 Available flavors are:
 
-- daemon: add the ability to run dspam as multiple clients connecting to a
-central server. This flavor is required in order to use the --daemon and
---client command-line switches. However, the daemon mode is currently
-incompatible with sqlite.
-
 - clamav: enable usage of the clam antivirus.
 
 - ldap: include support for LDAP verification.
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