Solr would help you on the search side, but has nothing to do with archiving. Look at Solr DIH, there was a contrib module (I think) that reads IMAP sources.
Regarding archiving, that is a very large area... there are many questions you must answer:
- you want to store mails as a whole, or decompose its parts so you can deduplicate also parts that are repeated in different mails.
- I would lean towards storing on filesystem, but watch out for:
- you need to devise a way to detect deduplication
- store smartly over a tree of dirs so you dont slow each dir browsing.
- compress when needed (not smaller ones or imcompressible ones)