Store your mails in a CouchDB and view them with mutt. Supports searching by metadata.