On Wed, Oct 08, 2003 at 03:13:26PM -0500, Robert A. Hayden wrote:
I've found the following good in giving me a fairly accurate count:
grep "^From: " /var/spool/mail/rhayden | wc -l
It's not 100% accurate. if people forward you an email it can show up as
two messages, but it's pretty accurate.
I use the mbox 'From ' marker:
egrep '^From ' mbox | wc -l
Most MTAs will change lines beginning with 'From ' in the body of the
message to '>From ' so that the MTA doesn't get confused. This has
always worked with my setup, but won't work for MTAs that don't
correctly do mbox format. Counting "From:" lines is likely not to work
all the time for reasons you've already stated; "From:" is not
important to distinguish messages in mbox format while "From " is.
procmail mailing list