Comment You're talking about SQL storage of messages (Score 2, Informative) 61
http://www.dbmail.org/
is one starting point, but there are a few others.
You're basically replacing /var/spool/mail with an SQL back-end. Things like MBOX or IMAP will suck for dealing with millions of records/messages, but SQL should handle it easily.
is one starting point, but there are a few others.
You're basically replacing