File:  [PGP] / pgp / contrib / mail_tin / morepgp
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/local/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.

$|=1;
$topgp=0;
$logname = $ENV{'LOGNAME'};
$pager='/usr/ucb/more';
$pager = $ENV{'PAGER'} if ($ENV{'PAGER'});
open (PAGER, "|$pager") || die "cannot open pipe to $pager\n";
while (<STDIN>) {
    if (!$topgp) {print PAGER;}
    if (!$topgp && m/^-----BEGIN PGP .*-----/) {
        $topgp = 1;
        close PAGER;
        $tmpfile = "/tmp/.pgp.$$.$logname";
        unlink($tmpfile);
        open (TMPFILE, ">$tmpfile") || die "cannot open $tmpfile for output\n";
    }
    if ($topgp) {
        print TMPFILE $_;
        if (m/^-----END PGP .*-----/) {
            $topgp = 0;
            close TMPFILE;
            $clrfile = "/tmp/.clr.$$.$logname";
            `pgp $tmpfile -o $clrfile`;
            open (PAGER, "|$pager") || die "cannot open pipe to $pager\n";
            open (CLEAR, "<$clrfile");
                        print PAGER "-----BEGIN PGP TEXT-----\n";
            while (<CLEAR>) { print PAGER; }
            close CLEAR;
            unlink($clrfile);
            unlink($tmpfile);
            print PAGER "-----END PGP TEXT-----\n";
        }
    }
}
close PAGER;

unix.superglobalmegacorp.com

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