I need to know how many individual mails are in an mbox mail folder.
I don't know of any way to get the count directly from formail or
procmail, so it's on to formail -s <something> <mbox-to-count.
My question is: what's the most efficient <something>?
My current favorite is:
cat /dev/null >tempfile
formail -s echo blah >>tempfile <mbox-to-count
COUNT="`wc -l <tempfile`"
rm -f tempfile
This seems cleaner than saving a count in a file, reading it,
incrementing it, and resaving it. But I suspect better minds than
mine might have a simpler solution.
I'm using procmail 3.22.
procmail mailing list