Hi Folks,

I've got a small problem that somebody may be able to help solve - it's starting to do my head in!

I'm trying to generate an archive of all email being processed by my mail server for audit purposes. At the moment I have a php script which accepts emails on stdin from an exim router, extracts the sender, subject and recipient from the message headers and drops them into a mysql database. The message body is then saved into a file, the location of which is then stored in the mysql database. Spot the flaw in this system? I've got a harddisk filling up with hundreds of unecrypted emails - some of which are of a confidential nature.

What I need is a means by which I can encrypt the message body using RSA/some other asymmetric encryption system. The decryption key is then stored off server and only used when messages are retrieved.

I tried the PHP/PEAR Crypt_RSA package which does exactly what I need, though (bearing in mind it's PHP) is extremely slow even on small emails. I've had a read up on PGP / GNUPG though keychains etc seems far too OTT for what I'm trying to achieve.

Anybody have any ideas?



Oh, if possible I'd also like to have a PHP frontend for this system (over HTTPS of course) which allows the (unencrypted) header info in the database to be searched, and the message body retrieved when the decryption key is provided.