Subject: tiny pgp key server

From: Richard Coleman <[email-masked]>
Date: Mon, 23 Jan 1995 19:30:40 -0500

--------
I thought I would share a little recipe that I really like.
It is a recipe to send people your pgp key upon request.  I
got most of this code from Andrew Cosgriff.  I then added some
extra lines to add MIME headers so that mailers such as
exmh would recognize it as a pgp key.  With a little extra work,
this could be a full key server.

If anyone has any improvments to this, please let me know.

Richard Coleman           pgp key (keyID 0x71FB29E1) at keyservers (or)
system administrator      send me e-mail with subject "get pgp key"
[email-masked]   for automatic response.

###########
# VARIABLES
###########
MAILDIR=$HOME/Mail
MYADDR="[email-masked]"
WHOAMI="Richard Coleman <$MYADDR>"
FROMSIG="Richard Coleman's tiny PGP key server <$MYADDR>"

######################################################
# tiny PGP KEY SERVER
#
# If e-mail message has subject of "get pgp key" or
# "send pgp key", then this will reply with my pgp key
# and log the request in $MAILDIR/pgpkey-request.log
######################################################
:0 c
* ^Subject:.*(send|get) *pgp *key
* !^X-Loop: $MYADDR
{
	FROM=`formail -rt -xTo:`
	SUBJECT=`formail -xSubject:`

	:0 ch: pgp$LOCKEXT
	| (formail -rI"From: $FROMSIG" \
		-I"Reply-To: $MYADDR" \
		-I"Subject: PGP public key" \
		-I"Mime-Version: 1.0" \
		-I"Content-Type: application/pgp; format=keys-only" \
		-I"Content-Description: PGP key of $WHOAMI" \
		-I"Content-Transfer-Encoding: 7bit" \
		-I"X-Loop: $MYADDR" ;\
		sh -c "pgp -kxaf $MYADDR 2>/dev/null") \
	| $SENDMAIL -oi -t

	:0 w: pgpkey-requests$LOCKEXT
	| echo "`date` : $FROM : $SUBJECT" >> $MAILDIR/pgpkey-requests.log
}

---

From: [email-masked] (David W. Tamkin)
Date: Tue, 24 Jan 1995 11:42:22 -0600 (CST)

Richard Coleman asked,

I'm not up to reading most of it now, but here's a suggestion: instead of
extracting $SUBJECT with formail,

: :0 c
: * ^Subject:.*(send|get) *pgp *key
: * !^X-Loop: $MYADDR
: {
: 	FROM=`formail -rt -xTo:`
: 	SUBJECT=`formail -xSubject:`

put 

   LOGFILE=pgpkey-requests.log
   LOGABSTRACT=yes

right there; drop the `c' flag here (and the local lockfile; you don't need
one):

: 	:0 ch: pgp$LOCKEXT
: 	| (formail -rI"From: $FROMSIG" \
: 		-I"Reply-To: $MYADDR" \
: 		-I"Subject: PGP public key" \
: 		-I"Mime-Version: 1.0" \
: 		-I"Content-Type: application/pgp; format=keys-only" \
: 		-I"Content-Description: PGP key of $WHOAMI" \
: 		-I"Content-Transfer-Encoding: 7bit" \
: 		-I"X-Loop: $MYADDR" ;\
: 		sh -c "pgp -kxaf $MYADDR 2>/dev/null") \
: 	| $SENDMAIL -oi -t

and lose this recipe entirely:

: 	:0 w: pgpkey-requests$LOCKEXT
: 	| echo "`date` : $FROM : $SUBJECT" >> $MAILDIR/pgpkey-requests.log

and then close the braces.  The logfile will get From_ (with delivery time-
stamp) and Subject: from the original letter, since it wasn't filtered.

: }

David W. Tamkin  Box 3284  Skokie, Illinois  60076-6284
[email-masked]    MCI Mail: 426-1818   +1 312 714 5610