File:  [PGP] / pgp / contrib / elm_nn / postpgp
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:39:03 2018 UTC (8 years, 1 month ago) by root
Branches: phill, MAIN
CVS tags: pgp23a, pgp22, HEAD
PGP 2.2

#!/usr/bin/perl

# written by jason steiner, [email protected], Jan 1993
#
# if you use or make improvements to this program i would appreciate
# copies of your modifications & your PGP public key.

($visual = $ENV{'VISUAL'}) || ($visual = '/usr/ucb/vi');
system($visual,@ARGV);
while (!$q) {
        print "Sign this message? [Y]: ";
        $q = <STDIN>;
	$q =~ s/[ \t\n]//g;
	$q = substr ($q, 0, 1);
        if (($q eq 'Y') || ($q eq 'y') || ($q eq '')) {
                push(@opts,'-st','+clearsig=on');
                $q = "y";
        } elsif (($q ne 'N') && ($q ne 'n')) {
                $q = '';
        }
}
if (@opts) {
        $name = $ARGV[$#ARGV];
	umask(077);
        open(INPUT,$name);
        open(HEAD,">${name}.head");
        open(BODY,">${name}.body");
        while (<INPUT>) {
                if (1 .. /^$/) {
                        print HEAD;
			if (m/^From: / || m/^To: / || m/^Date: /) {
				print BODY;
			}
                } else {
                        print BODY;
                }
        }
        close(HEAD);
        close(BODY);
        system('pgp','-a',@opts,"${name}.body");
	if ($? == 0) {
        	unlink($name);
        	system "cat ${name}.head ${name}.body.asc > $name";
	}
        unlink("${name}.head");
        unlink("${name}.body");
        unlink("${name}.body.asc");
}


unix.superglobalmegacorp.com

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