Click here to return to Newclient Main Help Page

pgpformmail.pl

Last Updated: November 14, 1996

  1. Installation
  2. Tips


Installation

The pgpformmail.pl script is an excellent way to transfer mail from your virtual server to a remote mail box in a secure format. For example, use the pgpformmail.pl script to send sensitive information such as credit card numbers from your Secure Virtual Server to your remote e-mail box without worrying about a third-party tampering with the information. To install the pgpformmail.pl script, telnet to your Virtual Server and do the following:

  1. Copy the pgpformmail.pl script located in the /usr/local/contrib area into your cgi-bin:
      % cp /usr/local/contrib/pgpformmail.pl ~/www/cgi-bin
    

  2. Create a form that you would like the contents mailed to some address. The form should include the follwing fields:
      pgpuserid = specifies the user id for the pgp executable
      recipient = specifies who mail is sent to
      username = specifies the remote users email address for replies
      realname = specifies the remote users real identity
      subject = specifies what you want the subject of your mail to be

      For example, the HTML source for your form may look like this:

        <form method="POST" action="/cgi-bin/pgpformmail.pl">
        <input type="hidden" name="pgpuserid" value="your_userid">
        <input type="hidden" name="recipient" value="order@yourdomain.com">
        <input type="hidden" name="subject" value="Order Request">
        Please Enter Your Name:<br>
        <input name="realname" size="40">
        <p>
        Please Enter Your Email Address:<br>
        <input name="username" size="40">
        <p>
        Please Enter The $$$ Amount:<br>
        <input name="amount" size="40">
        <p>
        .
        .
        .
        <input type="submit" value="Submit">
        <input type="reset" value="Reset">
        </form>
      
      Where your_userid is the user ID for your public key. If your user ID contains characters that could be misinterpreted by a web browser, such as '<' and '>', you will want to replace these characters with the proper escape sequences. For example if your user ID were:

        John Q. Smith <12345.6789@compuserve.com>

        represent the user ID with the following string (note the &lt; and &gt; escape sequences):

          John Q. Smith &lt;12345.6789@compuserve.com&gt;
           
          NOTE: In order to use the pgpformmail.pl script, you will have to install the pgp executable onto your virtual server, and either generate a public/secret key pair or have added an existing key file's contents to your public key ring.


        Tips

        One way to modify the pgpformmail.pl script is to include an autoresponder that emails the remote client some kind of response. To do this append something like the following to the bottom of the pgpformmail.pl script.
          # open a message to the remote client
          open (MAIL, "|$mailprog $FORM{'username'}") || die "Can't open $mailprog!\n";
          print MAIL "To: $FORM{'username'} ($FORM{'realname'})\n";
          print MAIL "Reply-To: $FORM{'recipient'}\n";
          print MAIL "From: $FORM{'recipient'}\n";
          print MAIL "Subject: $FORM{'subject'}\n\n";
        
          # write out a customized response to the mail message
          print MAIL "We have received your message and are delighted";
          print MAIL "you have chosen to do business with our company.";
          print MAIL "You will find that we are very responsive and will";
          print MAIL "get back with you shortly.  Have a great day!";
        
          # close the message
          close (MAIL);
        

        bd