After using Taskwarrior to manage my todo list from the command line, I'd like to do something similar with email. A program that behaves like the below. Am I imagining something that doesn't exist, or can existing tools do this? I don't believe pine or mutt have any non-interactive invocation modes. They take you to their own shells, which I don't want. I want to be able to pipe the output into another unix command.
$ mail_program list inbox
From Subject Received
---- ------- ----
mom re: Hi 2011-09-17
$ mail_program list inbox | grep mom
mom re: Hi 2011-09-17
$