Subject: Re: PGP interface for Pine 3.92?

From: [email-masked] (Rick Troxel)
Date: Wed, 3 Apr 1996 18:03:18 GMT

In article
<[email-masked]>
[email-masked] (Barry Cornelius) writes:

   In order to run pgp on messages that I view (i.e., other people's
   messages), I have set display-filters variable to be:
      _LEADING("-----BEGIN PGP SIGNED MESSAGE-----")_ /usr/local/bin/pgp

   Although I am happy with the outgoing bit, I would like more control over
   the display-filters: (a) it's difficult to see what pgp is telling me ---
   it leaves the screen too quickly, (b) it would be nice to be able to
   toggle display-filtering on and off.  Having said that, these hooks in
   Pine 3.92 that enable me to do digital signatures a lot easier are great.

   How are other people enabling Pine 3.92 for PGP?

I too was bothered about (a), so I wrote the following script that I
invoke instead of pgp.  N.B. Originally I tried a shell script instead
of perl, but it would occasionally hang at the point of its pgp
invocation (when pgp tries to rewrite one's screen, after having
announced its view of the attached key), hanging pine in a very strange
state that required killing the process.

Hope some of you find this useful.

#!/usr/local/bin/perl
#
# authenticate: Indicates a PGP signature is present, then tries to
#		verify its authenticity.  For use as a mail filter.
# Time-stamp: <96/04/03 12:52:14 rick>

# The following two strings suggest a PGP signature is present and
# delimit the signed message.  Individualize them, so that a forgery
# would be unlikely to employ them.  (For certainty, save the message
# and view it to see whether it is signed.)
$herald = "xxx\n\n";
$signoff = "yyy\n";

# Set the following string to the pathname by which to invoke PGP
$pgp = "/usr/local/bin/pgp";

# Okay, here we go!
################################################################

$| = 1;				# flush after the first print
print $herald;
$| = 0;

open(PGP, "| $pgp") || die "Can't open pipe: $!\n";
while (<>) {
    print PGP;
}
close(PGP);

print $signoff;

# Local variables:
# mode:perl
# End:
--
Rick Troxel  [email-masked]   [email-masked]  301/435-2983
  http://www.access.digex.net/%7Erobjen/dc-sage/bios/rick_troxel/
///////////////////////////////////////////////////////////////////
 All effort and exertion put forth by man from the fullness of his
 heart is worship, if it  is prompted  by the  highest motives and
 the will to do service to humanity.                 --Abdu'l-Baha