eg the free java mail server: james
http://james.apache.org
- You can fetch mails via pop
- You can write your own classes to extract info from mails
- ...
It's not exactly what you want, but it's an idea.
René