Newbie query: working on already delivered messages - batch mode?
D Ruggiero
jdavid at farfalle.com
Fri Jun 10 01:49:39 CEST 2005
So, Bogofilter's happily installed on my ancient RH 7.1 mail server (don't
ask) and is so much easier, more efficient, and accurate to the client-side
filter I had been using that it's laughable. So far, so good - thanks for
the great work.
However: due to my bizarro setup here, I'm only able to filter messages
after they're already delivered (ie, in my maildir as separate files, one
per message). Again, don't ask. :) What I really want to do is simply have
Bogofilter look at each message and insert its X-Bogosity header "in-situ",
without otherwise changing the message or its filename. Right now I'm doing
this with a bash script:
#!/bin/bash
cd [my maildir]
find . -type f -newer bogotime > /tmp/bogofiles
touch bogotime
xargs -i -r bash -c "/bin/mv {} bogotmp; bogofilter -peI bogotmp -O {}" \; <
/tmp/bogofiles
rm -f bogotmp /tmp/bogofiles
exit 0
Two problems with this: first, it seems like an ugly kluge, and second, it
requires a file move and a separate invocation of bogofilter for every
message. Surely there must be a better way? Is there method to get
Bogofilter to operate on all the found "new" messages all at once, adding
its header to each, and keeping them in the same file names, all in one fell
swoop?
(I have a feeling that "batch" mode is what I want, but I'm not sure how to
make that work on separate messages rather than one big input stream. I'm
also very hazy on the difference between "-b" and "-B"....)
Any advice or insight is appreciated.
-David
More information about the Bogofilter
mailing list