Compiling DSPAM on an Old Box

So I tried compiling DSPAM v3.6.8 on my old Red Hat 6 box. Why do I still run Red Hat 6? Because I’ve never had a reason to upgrade. The box is my mail server and has been churning mail since I got it from Penguin Computing in 1998. I once got 611 days of uptime out of it. Best box I’ve ever had so I’m not going to screw with it.

Anyway… So I tried compiling DSPAM. Since it is RH 6, it has an old GCC compiler, specifically:

1
2
3
[garry@mail garry]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)

DSPAM would not compile b/c it uses newer style C pre-processor directives and can’t find some time struct. I screwed with it for a while and finally got it to work. Here’s the patch:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--- dspam-3.6.8-stock/src/agent_shared.h        Tue May 30 08:05:57 2006
+++ dspam-3.6.8/src/agent_shared.h      Thu Dec 28 01:05:44 2006
@@ -34,7 +34,7 @@
 #ifndef _AGENT_SHARED_H
 #  define _AGENT_SHARED_H

-#define STATUS( ... )   snprintf(ATX->status, sizeof(ATX->status), __VA_ARGS__);
+#define STATUS( ARGS... )   snprintf(ATX->status, sizeof(ATX->status), ##ARGS);

 #define SYNTAX "Syntax: dspam [--client|--daemon] --mode=[toe|tum|teft|notrain] --user [user1 user2 ... userN] [--feature=[ch,no,wh,tb=N,sbph]] [--class=[spam|innocent]] [--source=[error|corpus|inoculation]] [--profile=[PROFILE]] [--deliver=[spam,innocent,summary]] [--process|--classify] [--stdout] [passthru-arguments]"

--- dspam-3.6.8-stock/src/client.c      Tue May 30 08:03:51 2006
+++ dspam-3.6.8/src/client.c    Thu Dec 28 01:13:00 2006
@@ -46,6 +46,7 @@
 #include <sys/stat.h>
 #include <sys/un.h>
 #include <sys/socket.h>
+#include <sys/time.h>
 #include <netdb.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>

--- dspam-3.6.8-stock/src/error.h       Sat May 13 05:17:30 2006
+++ dspam-3.6.8/src/error.h     Thu Dec 28 01:10:59 2006
@@ -45,7 +45,7 @@
 #endif

 #ifndef DEBUG
-#define LOGDEBUG( ... );
+#define LOGDEBUG( ARGS... );
 #else
 void LOGDEBUG (const char *err, ... );
 #endif

Download the patch here: dspam.diff

Put this diff in the root directory of your DSPAM source code and execute:

1
patch -p1 < dspam.diff
and you’ll be all set.

My experience with DSPAM so far has been great. This is the first time I’ve used it. It already has an amazing rate of accuracy even though I’ve been training it for just two days. My Inbox is now far cleaner than when I used SpamAssassin. And it has a cool web-based GUI for stats, history, and the quarantine.

I will have more to say about my DSPAM setup w/ qmail and VMailMgr. VMailMgr’s “vdeliver” LDA can be tricky to get working w/ DSPAM, but I’ve got it all dialed in now. Stay tuned…

Comments