Annotation of pgp/contrib/misc/pgpnohdr.sh, revision 1.1.1.1

1.1       root        1: Subject: Re: PGP with mail/news
                      2: Date: Fri, 8 Jan 1993 05:14:09 GMT
                      3: From: [email protected] (Rob Stampfli)
                      4: Lines: 50
                      5: 
                      6: >}one feature i discovered that would be nice to have in PGP: a switch
                      7: >}that tells it to sign only the body of a message, instead of the whole
                      8: >}thing.
                      9: 
                     10: This is really very easy to accomplish external to pgp.  Here is an example
                     11: of a shell script that sits between the mailer program and /bin/mail, which
                     12: does exactly what you want.  It was written before the implemenation of
                     13: +clearsig, but it should work just fine with it.
                     14: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                     15: # This script is invoked by adding the line "set sendmail=pgpmail" to your
                     16: # .mailrc file.  mailx then invokes pgpmail instead of /bin/mail to deliver
                     17: # email.  This script checks whether outbound encryption is specified, and
                     18: # automatically performs it as required.
                     19: 
                     20: trap "" 1 2 3                          # req'd since this can run in bg
                     21: exec 2>/dev/tty                                # can be "exec 2>/dev/null"
                     22: 
                     23: nl="" en="" sg=""
                     24: for i                                  # for each argument...
                     25: do
                     26:   case "$i" in                         # look for encryption specifier...
                     27: #  *encrypt=*) en="`sed 's/.*=//'`"    # this line req'd if SHELL=sh
                     28:   *encrypt=*)  en="${i#*=}";;          # this line is faster if SHELL=ksh
                     29:   *sig=*)      sg="${i#*=}";;          # a pgp signature specification...
                     30:   *)           nl="$nl $i";;           # a real mail address...
                     31:   esac
                     32: done
                     33: 
                     34: [ X = "X$en" ] && exec /bin/rmail "$@" # encryption was not requested
                     35: 
                     36: (                                      # encryption *was* specified
                     37:        OIFS="$IFS"                     # needed to preserve tabs in header
                     38:        IFS='
                     39: '
                     40:        while read x                    # read and process header intact
                     41:        do
                     42:        print - "$x"
                     43:        [ "" = "$x" ] && break
                     44:        done
                     45:        IFS="$OIFS"                     # reset field separators
                     46:        if [ X = "X$sg" ]; then         # no signature specified:
                     47:          pgp -feat "$en"               #   feed the rest to encryption pgm
                     48:        else                            # a signature was specified:
                     49:          pgp -feast "$en" -u "$sg"     #   feed pgp...
                     50:        fi
                     51:        echo "Encryption phase completed" 1>&2
                     52: ) | /bin/rmail $nl
                     53: -- 
                     54: Rob Stampfli  [email protected]      The neat thing about standards:
                     55: 614-864-9377  HAM RADIO: [email protected]  There are so many to choose from.
                     56: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.