|Thu 1998-10-08 dave(_at_)magic(_dot_)geol(_dot_)ucsb(_dot_)edu (Dave Robbins)
list.procmail
| Any caveats or suggestions are *appreciated*. I've tested this
| quite a bit but have not yet implemented it. Thanks.
-- perhaps $FORMAIL to speed up calling binary
-- use formail -rt (see Era's faq)
-- "HB:" doesn't need lock
-- If your echo knowss \n, you can optimise echos to:
echo "....\n" \
"....\n" \
"....\n"
jari
| DEFAULT=/var/mail/mylist
| MAILDIR=/pathto/mylist/.procmail
| LOCKFILE=$MAILDIR/.lockfile
| LOGFILE=$MAILDIR/.log
| VERBOSE=on
| LOGABSTRACT=yes
| EGREP=/usr/local/bin/egrep
| ML=/usr/local/lib/aliases
| ACCEPTLIST="$ML/mylist.accept $ML/everyone $ML/others"
| FROM=`formail -rzxTo:`
|
| :0
| * ? echo "$FROM" | $EGREP -i -f $ACCEPTLIST
| * ? test -r $ACCEPTLIST -a -s $ACCEPTLIST
| {
| :0 HB:
| ! `cat $ML/mylist`
| }
| :0
| * !^FROM_DAEMON
| * !^FROM_MAILER
| * !^X-Loop: mylist(_at_)magic(_dot_)geol(_dot_)ucsb(_dot_)edu
| | (formail -rk \
| -A "X-Loop: mylist(_at_)magic(_dot_)geol(_dot_)ucsb(_dot_)edu" \
| -A "Precendence: junk"; \
| echo "Your post to mylist(_at_)magic(_dot_)geol(_dot_)ucsb(_dot_)edu was not
successful";\
| echo "because the mailing list is restricted to submissions";\
| echo "from only certain individuals and groups. Sorry." ) \
| | $SENDMAIL -t -oi
|
| #{
| # EXITCODE = 77
| # :0h:
| # | gzip -fc >> $MAILDIR/.headers.gz
| #}