> cool solutions home   > cool tools home
Anti-Spam Agent for Novell NetMail
Open Source Anti-Spam Agent for Novell NetMail.
Reader Rating    from ratings rate this article
View a Printer Friendly Version of this Page Send this page to a friend
Updated: 24 Jun 2004
File Size: 44KB
License: Perl Artistic License
Download 1:  spamd.raw
Home Page: http://netmail.sourceforge.net/
Publisher: Pascal
E-mail: Pascal666@Users.SourceForge.Net
Please read the note from our friends in legal before using this file.

I just released a new version containing support for the -f option. When specified, this option tells the agent to add the header "X-Spam-Flag: YES" to spam instead of deleting it. Information on configuring your clients to use this option can be found here.

When upgrading the agent, installing SpamAssassin from a package, or adding the agent to an existing SpamAssassin install, you can copy the downloaded spamd.raw over the installed spamd with minor modifications. There are four lines at the top of each file that need to be copied over. These lines contain options that are normally substituted at 'make' time. They are located directly below the license. You will also need to flag the file as executable using "chmod +x" or similar.

Remember to subscribe to the announce mailing list to receive future updates via e-mail.


This project is dedicated to creating a real anti-spam agent for Novell NetMail. The anti-spam agent included with NetMail only supports blocking email from particular domains. This is of course nearly worthless with the current volume of spam. Rather than "reinventing the wheel", the current plan is to simply create a connector to SpamAssassin. SpamAssassin is written in Perl, and so should run on most of the platforms that NetMail runs on. For this reason I will be writing my agent in Perl as well.

The current implementation is a replacement for SpamAssassin's spamd. Simply copy it over spamd.raw in the SpamAssassin distribution before installing SpamAssassin. You can specify the IP address and port NMAP is running on using the -i and -p options. If not specified it is assumed NetMail is running on the same box as SpamAssassin and on its default port. The new spamd will use this information to tell the NetMail server to send all new e-mail to it for spam checking. If SpamAssassin determines that the e-mail is spam, it is deleted, otherwise it continues through the NetMail queues. Note that due to problems with Novell's implementation of Perl for NetWare (as documented below), NetWare is not currently a supported platform. If your NetMail server is running on NetWare you will have to run SpamAssassin on a different box and connect to NMAP over the network via the -i option.

SpamAssassin v2 is released under the Perl Artistic License. SpamAssassin v3 will change to the Apache Software License. To keep things simple, my versions of spamd, which use large parts of the original spamd, will be released under these same licenses. All of my small programs used in the development of the agent are released under the GNU GPL.

Development notes

NetMail is designed with modularity in mind. Once a message is received by the STMP agent, it is run though the message queues by NMAP. Agents attached to each queue can then modify, delete, or pass the message to the next queue. As I develop this new agent I will be posting notes on this page to assist others in developing NetMail agents. I will also be adding small programs to CVS that I have written along the way. Novell's NetMail SDK can be found here. The developer support forum is here. The user support forum is here.

The first problem I ran into when I began this project was with registering my agent with NMAP. Novell's NMAP protocol specification lists the agent registration command as "QWAIT <identifier> <queue> <port>" when the actual command is "QWAIT <queue> <port> <identifier>".

The next problem was a little harder to workaround. As NetMail is heavily multithreaded, any NetMail agent must also be. Since my NetMail servers run on NetWare, I was using NetWare as my development platform. Unfortunately, per the Perl for NetWare readme, the "fork method is not yet implemented on NetWare." Not too big a problem though, I can always use threads. Except "scripts that use the 'Thread' and 'threads' modules may not work as desired." Ok, no problem, guess I'll just have to use non-blocking IO. Unfortunately my tests indicate IO::Select does not work on NetWare either. Bottom line, there is no way I can see to do this in Perl on NetWare. Luckily NetMail is designed so its agents can be on multiple servers. From this point on development was geared toward running SpamAssassin and the agent on a Linux box connecting to NMAP over the network.