Newbie query: working on already delivered messages - batch mode?

David Relson relson at osagesoftware.com
Fri Jun 10 03:59:10 CEST 2005


On Thu, 09 Jun 2005 18:45:55 -0700
David Ruggiero wrote:

> David:
> 
> Thanks. I recognize your name as the FAQ maintainer (see, people do read 
> them :).
> 
> >Tis good the RH 7.1 build from source went
> >without incident.  Not everyone building from source is so fortunate.
> 
> Indeed. I was surprised myself, but "config" + "make" + "make install" did 
> me just fine, even with the older Berkeley db.
> 
> Mind you, I'm on the latest possible kernel and glibc, etc, that RH provided 
> for 7.1, so I had a leg up there...
> 
> >As you've seen there is no good way add X-Bogosity "in-place".  In the
> >normal, mail delivery environment, bogofilter works in a pipe
> >environment, as in:    cat incoming | bogofilter -p | cat > outgoing
> >or   bogofilter -p < incoming > outgoing
> >A script using mv to rename is as good a way as any I know to process
> >an already delivered message.
> 
> Okay, thanks for the confirmation that I wasn't missing anything obvious. I 
> mostly was just trying to not invoke Bogofilter N times for N mails, but for 
> my purposes (perhaps ~500 incoming/day at present) it's really just for 
> style that I asked. Given my small mail load (unlike Mr. Acme's :), my 
> machine can certainly keep up doing it the way I showed in the posting.
> 
> Still...hmmm...adding an option to make the input file and the output file 
> the same to allow the "in-place" update would seem to me not to be terribly 
> difficult, and would be a nifty feature to add. Maybe I'll dust off my C 
> coding skills on this one and take a look at the source when time permits...
> 
> Thanks for the hard work and a great product. I was shocked, especially 
> after running bogotune, how good it got at sorting my spam/ham corpus. Cool.
> 
> yours,
> David

Hi David,

I prefer to think of myself as chief developer and bottle washer,
rather than FAQ maintainer :-)

Two thoughts:  "bogofilter -v -B *" generates output with 1 file name
plus X-Bogosity on each line.  It might be usable as a kind of index.

Bogofilter has "-I name" and "-O name" options suitable for single
message file operation.  I've never tried using the same name for both,
but it might work.  On the other hand, since there's code to use "file
rewind" to avoid keeping the whole message in ram if not necessary, so
it might _not_ work.  Experiment and let us know what happens.

In any case, looking at how the '-I' and '-O' options are handled may
lead you in the right direction.  My prediction is that you'll find it
easy to do what you want or else you'll become totally frustrated, as
in trying to make a square peg fit in a round hole.  Remember that an
in-place operation has opportunity to nuke the file if anything goes
wrong.

Good luck,

David



More information about the Bogofilter mailing list