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

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


On Thu, 09 Jun 2005 17:22:07 -0700
David R wrote:

...[snip]...

> I did have to compile bogofilter from sources, couldn't use a pre-rolled RPM 
> because of dependency problems.

The pre-built binary rpms are created by me -- currently using a
Mandrake 10.2 system.  'Tis good the RH 7.1 build from source went
without incident.  Not everyone building from source is so fortunate.

You had asked about '-b' vs '-B'.  '-B' uses filenames from the command
line, while '-b' uses filenames from stdin.  To score all the messages in
'maildir' you can use either of:

   cd maildir; bogofilter -v -B *

or

   ls maildir/* | bogofilter -v -b

More generally using find you could do:

   find maildir -type f | bogofilter -v -b

or

   find maildir -name "*$PATTERN*" | bogofilter -v -b

> >That's probably not a good idea to do it to the exact same file name.
> >What happens when your bogofilter script runs and the message is popped
> >off the server at that moment?
> 
> Not a problem. The script is triggered by/from the (hacked) POP server 
> executable itself, so it's nothing will happen to the maildir while it's 
> running.
> 
> >and then go through those and move them into the ./Maildir/new
> >directory using the "safecat" program:
> >   http://jeenyus.net/~budney/linux/software/safecat.html
> 
> I'll look at it, but that still doesn't solve the problem (scoring and 
> adding the bogosity header to N emails without invoking bogofilter N 
> separate times).
> 
> >What you're doing sounds like its requires processing on each individual
> >email beyond a simple "score this email" -- you're actually writing
> >information to the file.
> 
> No, I'm just wanting to score it and record the score in the message via the 
> X-Bogosity header, so I can filter and sort it later at the client level.

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.

Hope this helps,

David




More information about the Bogofilter mailing list