procmail
[Top] [All Lists]

Re: counting msgs in mbox

2003-10-08 13:31:06
Why not just:

    formail -s echo | wc -l

Steve

Jim Osborn wrote:

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.

TIA,

Jim

Attachment: pgpdOTY7G9t5M.pgp
Description: PGP signature

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail
<Prev in Thread] Current Thread [Next in Thread>