Here is the script.

I wrote this script because I needed a way to collect sensitive information and preserve the security from the website to my mailbox. Using SSL to deliver sensitive data to a website is only half the job. The other half is getting the data to the person who needs it without letting it become compromised.

The GnuPG encryption package provides very effective protection of data like email messages, so I got it installed and working as a first step. The next problem was figuring out how to allow the web server to send email when it runs under the 'nobody' account with heavy restrictions. I've been running PHP as a CGI using CGIwrap before, so I started playing with that in the context of a form mailer that encrypted the message body.

The script requires the following packages to work:

I am not going to describe how to get each of these packages installed, but once they are each working independantly, the steps to get the GPGsend script working are fairly trivial.