If you looking to roll your own using a search engine that can handle
all of the complex queries that you want to run, I can't recommend
Lucene highly enough.  This would be suited to the task far better
than a sql database.

http://lucene.apache.org/java/docs/

What would be left to you is writing code to turn your e-mail into
appropriately structured lucene "documents" - to feed into the
indexer.

Dan