Build-it-Yourself SpamAssassin Trainer

Over the past while, I've been working on a build-it-yourself interface for configuring my SpamAssassin Training script.

Keep in mind, I'm not the author of SpamAssassin, nor its included utility called "sa-learn". My Perl script simply tells the sa-learn utility how to find your mailboxes to train it on spam/non-spam.

After fielding several support requests over the past year which usually result from basic syntax errors or confusion over which option(s) to use, I decided to write a front-end for the script, asking which of several scenarios are best suited to the user, and then have PHP do a search-and-replace on the Perl script to build the configuration the user ultimately needs to install on their web hosting account.

So far this has been very successful. I've had several users write in saying it's much easier for them to manage.

I'll have to tweak the next version of the script, though, to alert other users to visit the build-it-yourself page to download a new copy of the script whenever I make a change.

The other thing that might be handy, of course, is to separate out the logic of the scanning script from the configuration, and just have the main portion of the script download a new copy of the scanning logic whenever a new version is detected ... I'll have to think about that one a little longer.

I also promised about a year ago to write a PHP version of the training script, since some users just don't understand Perl or execution permissions or what a "500" error means or how to work around it, etc., but truth be told, PHP is a bit of a pain to write output of shell-executed programs while they run. In my experience, PHP waits for everything to be finished before displaying any output.

Does anyone know of the equivalent command in PHP that unbuffers output like $|=1; does in Perl for PHP calls like exec() or passthru()?