How to use procmail

Adam Shostack adam at homeport.org
Wed Sep 4 19:40:05 PDT 1996


Martin Janzen wrote:

| New procmail users, listen to Adam!  (And read the man page, even
| though it's a bit intimidating at first.)

Yeah, Listen to me! Listen to me! (Its the new cypherpunks theme
song!)

More seriously, here's my .procmailrc.  I'm fond of it, but the cpunks
section could use some more work.  Other parts may be useful basis
for other people's hacking.

Adam

# $Id: .procmailrc,v 1.10 1996/08/05 04:54:46 adam Exp $
PATH=/bin:/usr/bin:/usr/local/bin:/usr/local/lib/mh
MAILDIR=$HOME/Mail/=      	#you'd better make sure it exists
DEFAULT=/var/spool/mail/adam
LOGFILE=$MAILDIR/.procmail.log
REALLF=$LOGFILE			# So I only have one path to LF
COMSAT=no			# don't tell comsat; its obstelete.
# VERBOSE=on		# bad bad bad!


#This first ruleset protets me from mailbombs from an automated service
#that I often send incorrect commands to, generating 5mb of reply.
# It also sorts based on sucsess of the command.

:0c :
.safe

:0
* From bal at swissnet.ai.mit.edu
{
   :0 h
   * >10000
   /dev/null

   :0 h
   *^Subject:.*no keys match
   /dev/null

   :0:
   *Subject: Your command, ADD
   $DEFAULT


   :0E
   | pgp +batchmode -fka
}


# This is a backup. Don't forget to cycle safe boxes.


# this is here because I don't want to hear about everything going in .safe.
# prevent duplicate messages from showing up in several folders.

LOGABSTRACT=all
# doesn't work
:0 Wh: msgid.lock
| formail -D 65536 .msgid.cache

# auto key retreival
#
# I have an elm alias, pgp, points to a keyserver
# The logfile gets unset briefly to keep the elm lines out of my
# logfile.

:0BW
* -----BEGIN PGP
*!^FROM_DAEMON
KEYID=|/home/adam/bin/sender_unknown

LOGFILE=

:0 ahc	# added h 8 jan 95
* ! ^X-Loop: Adams autokey retreival.
| formail -a"X-Loop: Adams akr" |elm -s"mget $KEYID" pgp



LOGFILE=$REALLF

:0
* (^TOCypherpunks|Sender:.*cypherpunks|^From owner-cypherpunks at toad.com)
{
   :0:
   * From.*owner-cp-lite at comsec.com
   cp-lite

   :0 h
   * Subject:.*(Delete|u*n*Sub*| add |leave|help|Undeliverable Message)
   * < 1000
   /dev/null
   
   :0 :rml.lock
   * ^From: Raph Levien
   * ^Subject: List of reliable remailers
   | cat /dev/null - > ~/sec/remailer-list

   :0:
   * 1^1 ^(From|To|Cc):.*david at sternlight.com
   * 1^1 ^Subject:.*CDA
   * 1^1 ^Subject:.*Assasination
   * 1^1 ^Subject:.*Reasons in support of crypto-anarchy
   * 1^1 ^Subject:.*Noise
   * 1^1 ^Subject:.*FV
   * 1^1 ^Subject:.*(PLEASE REPLY|test)
   cjunk


   :0B:
   * ^Alice de 'nonymous
   * an455120 at anon.penet.fi
   * ^P.S.  This post is in the public domain.
   | formail -a "Status: O" >> cjunk



# I really ought to make this a wieghted rule.
   :0:
   * ^From:.*(aba at atlas|adam at lighthouse|blancw|cdodhner|cfrye|chen|cman|cme|colin@|daw at cs|ddt|ebrandt|eric at remail|futplex|frissell|gnu|gtoal|habs|hallam|hfinney|hugh|jis|karn|loewenste|loki|mab|froomki|mpj|nate|nsb|perry|pfarrel|rah|rjc|rsalz|sameer|sandfort|schneier|ses|smb|stewarts|szabo|tcmay|trei|unicorn|usura at berserk|warlord|weidai|whitaker|Zimmerman)
   * !^From.*(anonymous|perry at jpunix.com|jonathan at Memexis|perry at psii.persci.com|gertstein|Schartman|don at cs.byu.edu|senate.gov|doug at eng)
   cpunks

   :0:
   cpunks-noise
}
:0:
* ^TOfirewalls
firewalls


:0:
*^From owner-fwtk-users at tis.com
fwtk

:0
*^TOcyberia-l
{
#   VERBOSE=on

   :0 HW
   FROM=|formail -x "From: "

   :0 f
   | formail -I"Reply-To: $FROM"

   :0 fw:cyberia.sed.lock
   * ^From: Timothy Arnold-Moore <tja at kbs.citri.edu.au>
   |sed 's/^ //g'

   :0:
   cyberia
}

:0:
* ^From procmail-request at informatik.rwth-aachen.de
procmail


# Thats it for the high volume lists.  Low volume lists I don't push
# through formail.

:0:
* ^TOyucks at cs.purdue.edu
* ^Subject: Yucks Digest
| formail +1 -ds cat >> yucks

:0:
* ^TObugtraq
bugtraq

:0
* ^TO .*(ietf|rfc-dist)
{
   :0h
   *^Subject:.*ON-SITE
   /dev/null
 
   :0:
   ietf
}


:0
* ^TOwww-buyinfo
{
   :0
   * ^From: rah at shipwright
   * ^Subject: .*(cpx)
   /dev/null

   :0:
   | formail -a "Status: O" >> wwwb
}

:0:
*^TOspki
spki

:0
*^TOssl-talk
{
   :0
   *^Subject:.*remove
   * < 2000
   /dev/null

   :0:
   ssl
}

:0:
*^TOwww-security at ns2.rutgers.edu
wwws

:0:
*^From owner-ssh
ssh


:0:
*^TOremailer-operators at c2.org
remailers

:0:
*From best-of-security
bos


:0:
* ^TObblisa
bblisa

:0:
*^TOcoderpunks
coderpunks


:0:
*^TOmix-l
mix-l

:0:
* ^TOphrack
v/phrack

:0:
*^TOsdadmin
sdadmin

:0:
* Precedence: (junk|bulk)
junk

:0:
* To: postmaster
postmaster

# basic file server.  Only sends whats in .outbound
:0 
* ^Subject: (SEND|get) [0-9a-z][-_/0-9a-z.]+$
* !^Subject:.*[ /.]\.
* !^FROM_DAEMON
{
   # FILE=`formail -x Subject: | sed 's/.* //'`
   FILE=`sed -n -e '/Subject:/s/.* //p' -e '/^$/q'`

  :0c 
  | (formail -rt -A"Precedence: junk";\
     cat $HOME/.outbound/$FILE) | $SENDMAIL -t

  :0: 
  $MAILDIR/.log
}


# This handles vacation messages.  Make sure .vacation.msg and
# .vacationlist exist

:0 hc:vaction.lock 	#  untested
* ?  [ -r $MAILDIR/.vacationlist ]
* !? [ -r $MAILDIR/.vacation.msg ]
| rm -f $MAILDIR/.vacationlist


:0
* ? [ -s $MAILDIR/.vacation.msg ] 
* !^Precedence:(junk|bulk)
* !^FROM_DAEMON
{
 FROM=`formail -rx To:`
 ALREADYSENT=$MAILDIR/.vacationlist
   :0 hc:
   * !? fgrep -e "$FROM" $ALREADYSENT
   | echo "$FROM" >> $ALREADYSENT;\
 	(formail -rA"Precedence: junk";\
	cat $MAILDIR/.vacation.msg ;\
   ) | $SENDMAIL -t
}





-- 
"It is seldom that liberty of any kind is lost all at once."
					               -Hume







More information about the cypherpunks-legacy mailing list