A trick with perl

Tom Anderson tanderso at oac-design.com
Mon Jan 5 15:58:20 CET 2004


On Mon, 2004-01-05 at 09:28, Boris 'pi' Piwinger wrote:
> So I want to keep it open, to avoid many calls on bogofilter.

I tried this by first building an mbox out of all of the emails and then
feeding that to bogofilter.  Besides being much more memory-intensive,
it always locked on me for some reason after I closed the first mbox
(ham/spam) and then started the next.  I never solved that, and instead
moved to the one-by-one method.  Besides, this way it uses minimal
memory, though a little more CPU.

> 1) Is it OK to train with a different handle and still use
> the first open pipe (-TM to get ouput for each mail) to rate
> messages?

Not using Open2.  You have to close the write filehandle in order to
flush your output before bogofilter will finish reading and evaluate its
input.  Failing to close the write filehandle will result in a
deadlock.  The only way to feed multiple emails is by sending them as an
mbox or other folder type.

Unless bogofilter interprets some other EOF midstream?

Tom

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.bogofilter.org/pipermail/bogofilter/attachments/20040105/c6e1e4d8/attachment.sig>


More information about the Bogofilter mailing list