Re: can procmail report how many msgs it has processed during processing

Bart Schaefer <[email protected]>
Newsgroups gmane.mail.procmail
Message-ID <CABkvzcvUgitNh5pWeXhro1wPDGaohUPnFO179w94hkS6JBjAtw@mail.gmail.com>
On Fri, Sep 13, 2013 at 10:53 PM, Harry Putnam <[email protected]> wrote:
> Can anyone tell me if there is some handy way to have procmail report
> the number of messages as it is processing them.

Under all typical scenarios, one copy of procmail is executed for each
individual message.  So there is no way for each of those copies of
procmail by itself to know how many other copies were executed before
it.  So the count has to be maintained external to procmail, either by
the process that is invoking procmail or by using some kind of
persistent storage.

> I'm working in a sandbox with lots of messages.  Running piles of
> messages thru procmail and spamassassin.  A typical pile might be
> somewhere between 5 to 7 thousand.  It takes a good little while to
> process on my old hardware (intel P4 3.02 Ghz).

So how are you feeding those messages to procmail and spamassassin?
If, for example, you are using "formail -s" to explode a mailbox file
into "procmail -m" where the rcfile passed as procmail's argument
contains a recipe for spamassassin, then formail will maintain a
counter in the $FILENO environment variable, so you just need to add
to your rcfile something like

LOG="Processing message $FILENO
"

If you have files of individual messages, then something must be
walking that list of files and invoking procmail.  That "something" is
where you want to address this.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.