
SpamAssassin at evanscorp
Jan 7, 2004, 3:45 PM
Post #3 of 6
(135 views)
Permalink
|
Yep, the threading issue was the one I picked as being the show-stopper. Unix RPC is no big deal (just to be obtuse we could implement Windows named pipes instead), syslog is no big deal and someone who writes Perl can fix the logging routines. I know what spamd is about and I thought it would be easier to write a wrapper that hosts a (single) Perl interpreter which is invoked from multiple threads controlled by the host. I think this must be done in the Perl ISAPI plugin somehow. The design for spamdpp *does* have only one Perl interpreter loaded but it's when it is called from multiple threads that I get problems. It could be something to do with the Perl stack not using TLS or similar - I just don't know. Perhaps I'll have to go hunting through the ActivePerl source.... In any case, the idea was to maintain the architecture/design of spamd just move the stuff that ActivePerl doesn't do well (ie: fork) into an environment that does do that well (ie: C++). Phil. -----Original Message----- From: Sidney Markowitz [mailto:sidney [at] sidney] Sent: Thursday, 8 January 2004 6:52 AM To: Phillip Evans Cc: spamassassin-dev [at] incubator Subject: Re: spamC/D on Win32 Phillip Evans wrote: > I have been working on precisely this, sorta. I have taken a slightly > different tact, however, and re-implemented in C++ using Windows API > calls and am calling it spamcpp. Not to minimize your work on this, but the Windows port of spamc is working fine and is just about all checked in to the source tree. So give this a lower priority than getting spamd working. There may be some awkward bits in the code and bit too many #ifdef, but it does just build and run. Spamd would be useful. Here are the issues: The four things used by spamd that are not supported in the Windows perl are forking of processes, signals, unix RPC sockets, and syslog. The unix rpc sockets are no big deal -- It would be fine to have the Windows version of spamd use only tcp/ip sockets. Syslog is easy to work around, ideally by writing a log routine that can use syslog in unix and the event log under Windows. ActivePerl does have an interface for using the event log. The big problem is the way spamd uses child processes and signals. The whole idea of spamd is to run one instance of the perl interpreter/runtime that instantiates SpamAssassin and to spin off a separate process or thread to process individual messages. The documentation at http://aspn.activestate.com/ASPN/docs/ActivePerl/lib/Pod/perlfork.html gets into some of the deficiencies in the Windows implementation of perl fork(). It may be that it can all be made to work with the latest 5.8.x versions of ActivePerl. But writing a C wrapper for spamd doesn't solve the big problem, which is getting a single instance of the perl interpreter running SpamAssassin and forking off smaller children to process individual messages. And if you can solve that part, there really isn't any need for the C wrapper, since the starting up an instance and listening part of spamd should be easy to make portable. If spamd can be made to work under Windows, a wrapper would be needed to make it into a service and have it use the event log instead of syslog. That would be really handy. I don't mean to be discouraging -- I think this is a good idea, but we need someone with some expertise on getting the fork stuff to work in ActivePerl. I have read up some on the problems, but I'm not a perl expert (yet). -- sidney
|