Counting e-mail messages?

There is a post at Hack A Day that might be useful to you.