I accually have written such a script my self and posted it
here
I use the Mail::* modules to handle all my mail parsing (very simple & keeps me sane)
The issue Iam having is parsing the email in such a way that I dirive threads from said email
lindex
/****************************/
jason@gost.net, wh@ckz.org
http://jason.gost.net
/*****************************/