Subject: Re: MH/procmail examples

From: Richard Coleman <[email-masked]>
Date: Mon, 13 Mar 1995 19:07:27 -0500

--------
> 	 I was wondering if people who use procmail with MH instead of
> slocal might send me some examples.  I have a simple .procmailrc file
> flying, but I'd like to do some more complicated things and before I
> seriously dive into the man pages, I thought I'd look into seeing what
> others have already done.

I can't live without procmail and mh/exmh.  They work great together.
Here's a copy of my current .procmailrc if it helps any.

Richard Coleman            pgp key (keyID 0x71FB29E1) at key servers (or)
System Administrator       send me e-mail with subject "get pgp key"
School of Mathematics      for automatic response.
[email-masked]

###################################################################
# .procmailrc
# Richard Coleman  <[email-masked]>
# Created 1/18/95
#
# $Revision: 1.4 $
# $Date: 1995/02/23 22:19:24 $
#
###################################################################
# To use procmail, put the next line in .forward
# "|IFS=' ' && exec /usr/local/bin/procmail -f- || exit 75 #coleman"
# The double quotes should not be removed.
# Your .forward needs to be world-readable, but not world-writable.
###################################################################
# This .procmailrc is written for use with mh/xmh/exmh
###################################################################

###########
# VARIABLES
###########
VERBOSE=off
PATH=/bin:/usr/bin:/usr/local/bin:/usr/local/mh/bin:/usr/local/mh/lib
MAILDIR=$HOME/Mail
LOGFILE=$MAILDIR/procmail.log
MYADDR="[email-masked]"
WHOAMI="Richard Coleman <$MYADDR>"
FROMSIG="Richard Coleman's tiny PGP key server <$MYADDR>"

##########################
# MAIL FOR ROOT/POSTMASTER
##########################
:0 w: root/$LOCKEXT
* ^TO(root|postmaster|MAILER-DAEMON)
| rcvstore +root

###############
# MAILING LISTS
###############
:0 w: amanda/$LOCKEXT
* ^TOamanda-hackers
| rcvstore +amanda

:0 w: auto-net/$LOCKEXT
* ^TOauto-net
| rcvstore +auto-net

:0 w: backup/$LOCKEXT
* ^TObackup
| rcvstore +backup

:0 w: cert-tools/$LOCKEXT
* ^TOcert-tools
| rcvstore +cert-tools

:0 w: csr/$LOCKEXT
* ^TOcsr
| rcvstore +csr

:0 w: exmh/$LOCKEXT
* ^TOexmh-users|exmh-announce
| rcvstore +exmh

:0 w: mathsys/$LOCKEXT
* ^TOmathsys
| rcvstore +mathsys

:0 w: msql/$LOCKEXT
* ^TOmsql-list
| rcvstore +msql

:0 w: procmail/$LOCKEXT
* ^TOprocmail
| rcvstore +procmail

:0 w: tex-k/$LOCKEXT
* ^TOtex-k
| rcvstore +tex-k

:0 w: smartlist/$LOCKEXT
* ^TOsmartlist
| rcvstore +smartlist

:0 w: xsh/$LOCKEXT
* ^TOxsh-workers
| rcvstore +xsh

:0 w: zsh/$LOCKEXT
* ^TOzsh-list|zsh-announce
| rcvstore +zsh

######################################################
# 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
}

###########################################
#  This catches mail to [email-masked]
###########################################
:0 w: zsh/$LOCKEXT
* ^TOzsh
| rcvstore +zsh

################
# DEFAULT ACTION
################
:0 w: inbox/$LOCKEXT
| rcvstore +inbox