Chapter 11. Shared Memory SPAM Filtering with Cyclone and -fastfilter

Table of Contents
11.1. The Shared Memory API
11.2. Protocol Initialization
11.3. Request Specification
11.4. Shared Memory Article Structure
11.5. Response Specification
11.6. Building the Fast Filter API

As of Cyclone 2.0, -fastfilter is an option that enables a shared memory API to filter articles. Traditionally, a SPAM filter that used the -program option would bind STDIN and STDOUT to send articles to and from Cyclone (and all Highwinds Software products). Since that method of article transfer involved memory copying for articles already in memory, the shared memory API was developed to speed article transfer from Cyclone to the SPAM filter and back again.

11.1. The Shared Memory API

The shared memory API is similar to the traditional API, in that the server forks and executes a filter program, communicating with it through STDIN/STDOUT. The difference is that instead of sending the entire article to the filter, the server only sends the messageID of the article, plus the offset to the shared memory location where the full article text can be found.

The other major difference is that instead of simply returning <response_code>\r\n to the server, the filter must now return <response_code> <message-id>\r\n.

A Perl Module, Openwave::FilterAPI, is available to encapsulate many of the details of implementing this protocol in Perl.