No answers to my query here so I went to comp.mail.sendmail
Here is one possibility that I can verify does work for me.
From a poster on comp.mail.sendmail
,----
| From: Andrzej Adam Filip <anfi(_at_)onet(_dot_)eu>
| Subject: Re: Logging a running count of processed mail [procmail]
| Newsgroups: comp.mail.sendmail
| Date: Tue, 19 Nov 2013 22:19:37 +0100 (23 hours, 28 minutes, 12 seconds ago)
| Message-ID: <yjlwclgzvf(_at_)dbj2(_dot_)huge(_dot_)strangled(_dot_)net>
|
| You may use perl with File::CounterFile module to get persistent
| counters. The module is provided by libfile-counterfile-perl module in
| Linux/Debian.
|
| Add the following line at begin of your procmail script. It may be
| safer to absolute path to counter file:
|
| COUNT=`perl -MFile::CounterFile -e 'print
| File::CounterFile->new("./COUNTER")->inc'`
`----
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail