home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume38
/
procmail
/
part02
< prev
next >
Wrap
Text File
|
1993-07-05
|
55KB
|
1,701 lines
Newsgroups: comp.sources.misc
From: berg@pool.informatik.rwth-aachen.de (Stephen R. van den Berg)
Subject: v38i021: procmail - mail processing package v2.90, Part02/11
Message-ID: <1993Jul1.150725.20489@sparky.imd.sterling.com>
X-Md4-Signature: 89ee1787751bab7d98b6b7c2f63fd314
Sender: kent@sparky.imd.sterling.com (Kent Landfield)
Organization: Sterling Software
Date: Thu, 1 Jul 1993 15:07:25 GMT
Approved: kent@sparky.imd.sterling.com
Submitted-by: berg@pool.informatik.rwth-aachen.de (Stephen R. van den Berg)
Posting-number: Volume 38, Issue 21
Archive-name: procmail/part02
Environment: sendmail, smail, MMDF, mailsurr, UNIX, POSIX
Supersedes: procmail: Volume 35, Issue 21-32,124,125
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 2 (of 11)."
# Contents: procmail/Manifest procmail/examples/1procmailrc
# procmail/examples/2procmailrc procmail/examples/3procmailrc
# procmail/examples/3rmail procmail/mailinglist/FEATURES
# procmail/mailinglist/bin/procbounce
# procmail/mailinglist/bin/removelist
# procmail/mailinglist/bin/sendmails
# procmail/mailinglist/bin/showlink
# procmail/mailinglist/bin/unsubscribe
# procmail/mailinglist/bin/x_command
# procmail/mailinglist/etc/help.txt
# procmail/mailinglist/etc/rc.archive
# procmail/mailinglist/etc/rc.custom
# procmail/mailinglist/etc/rc.post procmail/mailinglist/install.sh3
# procmail/man/mansed procmail/src/exopen.c procmail/src/exopen.h
# procmail/src/formisc.h procmail/src/misc.h procmail/src/pipes.h
# procmail/src/procmail.h procmail/src/recommend.c
# Wrapped by berg@tubastos on Thu Jul 1 14:06:14 1993
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'procmail/Manifest' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/Manifest'\"
else
echo shar: Extracting \"'procmail/Manifest'\" \(2087 characters\)
sed "s/^X//" >'procmail/Manifest' <<'END_OF_FILE'
XMakefile We all know what that is.
XREADME Important, read it.
XINSTALL A description of what has to be done to install procmail.
X
Xconfig.h The file to edit if you want to change, yes, the configuration.
X
XFAQ Lists the things you are too lazy to figure out yourself.
XHISTORY Recent and ancient changes, features (or bugs) documented.
XFEATURES A summary of all the things procmail is particularly good at.
XManifest You guessed it.
Xinitmake A shell script that performs some preliminary tests on your
X system and prepares the Makefiles.
XMakefile.1 Used by initmake to customise the Makefile.
X
Xsrc/* The C-sources (in general).
Xsrc/Makefile.0 Used by initmake to customise the Makefile.
X
Xsrc/includes.h System include files are all referenced here.
Xsrc/autoconf The shell script that seizes your compiler and machine,
X and then creates a file called autoconf.h describing the
X kludges that are going to be applied for your installation.
X
Xnew/* After a "make", all the files that will be installed can be
X found here (for inspection, if you like).
X
Xman/* Yes, the man pages (made in a labour camp) and two additional
X files which make these man pages auto-adapting.
Xman/Makefile.0 Used by initmake to customise the Makefile.
Xexamples/mailstat
X A summary generator for procmail generated logfiles.
Xexamples/?procmailrc
X Sample .procmailrc files.
Xexamples/?rmail
X Sample shell scripts that demonstrate how to use
X lockfiles while reading the mail (to ensure mail integrity
X as soon as you exit the mail program).
Xexamples/dirname
X Substitute dirname program, for the deprived.
Xexamples/forward
X A sample .forward file (MMDF users should disregard this file
X and look in the man page).
Xexamples/advanced
X Some extra info for network mounted mailboxes, examples of
X advanced .procmailrc expressions and using procmail as
X a local delivery agent.
Xmailinglist/* All you need to start up a mailinglist.
Xmailinglist/FEATURES
X A summary of all the things this mailinglist package will take
X care of.
Xmailinglist/INTRO
X Comprehensive introduction on maintaining a mailinglist.
END_OF_FILE
if test 2087 -ne `wc -c <'procmail/Manifest'`; then
echo shar: \"'procmail/Manifest'\" unpacked with wrong size!
fi
# end of 'procmail/Manifest'
fi
if test -f 'procmail/examples/1procmailrc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/examples/1procmailrc'\"
else
echo shar: Extracting \"'procmail/examples/1procmailrc'\" \(644 characters\)
sed "s/^X//" >'procmail/examples/1procmailrc' <<'END_OF_FILE'
X# Please check if all the paths in PATH are reachable, remove the ones that
X# are not.
X
XPATH=$HOME/bin:/usr/bin:/usr/ucb:/bin:/usr/local/bin:.
XMAILDIR=$HOME/Mail # You'd better make sure it exists
XDEFAULT=$MAILDIR/mbox
XLOGFILE=$MAILDIR/from
XLOCKFILE=$HOME/.lockmail
X
X:0 # Anything from thf
X* ^From.*thf@somewhere.someplace
Xtodd # will go to $MAILDIR/todd
X
X:0 # Anything from people at uunet
X* ^From.*@uunet
Xuunetbox # will go to $MAILDIR/uunetbox
X
X:0 # Anything from Henry
X* ^From.*henry
Xhenries # will go to $MAILDIR/henries
X
X# Anything that has not been delivered by now will go to $DEFAULT
X# using LOCKFILE=$DEFAULT$LOCKEXT
END_OF_FILE
if test 644 -ne `wc -c <'procmail/examples/1procmailrc'`; then
echo shar: \"'procmail/examples/1procmailrc'\" unpacked with wrong size!
fi
# end of 'procmail/examples/1procmailrc'
fi
if test -f 'procmail/examples/2procmailrc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/examples/2procmailrc'\"
else
echo shar: Extracting \"'procmail/examples/2procmailrc'\" \(1989 characters\)
sed "s/^X//" >'procmail/examples/2procmailrc' <<'END_OF_FILE'
X# Please check if all the paths in PATH are reachable, remove the ones that
X# are not.
X
XPATH=$HOME/bin:/usr/bin:/usr/ucb:/bin:/usr/local/bin:.
XMAILDIR=$HOME/Mail # You'd better make sure it exists
XDEFAULT=$MAILDIR/mbox
X # We don't use a global lockfile here now.
X # Instead we use local lockfiles everywhere.
X # This allows mail to arrive in all mailboxes
X # concurrently, or allows you to read one mailbox
X # while mail arrives in another.
X
X# The next recipe will split up Digests into their individual messages.
X# Don't do this if you use a global lockfile before this recipe (deadlock)
X
X:0
X* ^Subject:.*Digest
X|formail +1 -d -s procmail
X
XLOGFILE=$MAILDIR/from # Put it here, in order to avoid logging
X # the arrival of the digest.
X
X# An alternative and probably more efficient solution to splitting up a digest
X# would be (only works for standard format mailbox files though):
X
X:0:
X* ^Subject:.*Other Digest
X|formail +1 -ds cat >>this_lists_mailbox
X
X# Notice the double : in the next recipe, this will cause a lockfile
X# named "$MAILDIR/todd.lock" to be used if and only if this mail is going
X# into the file "todd".
X
X:0: # Anything from thf
X* ^From.*thf@somewhere.someplace
Xtodd # will go to $MAILDIR/todd
X
X
X# The next recipe will likewise use $MAILDIR/uunetbox.lock as a lock file.
X
X:0: # Anything from people at uunet
X* ^From.*@uunet
Xuunetbox # will go to $MAILDIR/uunetbox
X
X
X# And here the lockfile will be $MAILDIR/henries.lock of course.
X
X:0: # Anything from Henry
X* ^From.*henry
Xhenries # will go to $MAILDIR/henries
X
X
X# But you can specify any lockfile you want, like "myfile". The following
X# recipe will use "$MAILDIR/myfile" as the lock file.
X
X:0:myfile # All 'questions' will go to
X* ^Subject:.*questions
Xtoread # $MAILDIR/toread
X
X# Anything that has not been delivered by now will go to $DEFAULT
X
X# After procmail sees the end of the rcfile, it pretends that it sees a
X# LOCKFILE=$DEFAULT$LOCKEXT
X# Therefore $DEFAULT is always locked.
END_OF_FILE
if test 1989 -ne `wc -c <'procmail/examples/2procmailrc'`; then
echo shar: \"'procmail/examples/2procmailrc'\" unpacked with wrong size!
fi
# end of 'procmail/examples/2procmailrc'
fi
if test -f 'procmail/examples/3procmailrc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/examples/3procmailrc'\"
else
echo shar: Extracting \"'procmail/examples/3procmailrc'\" \(1533 characters\)
sed "s/^X//" >'procmail/examples/3procmailrc' <<'END_OF_FILE'
X# Please check if all the paths in PATH are reachable, remove the ones that
X# are not.
X
XPATH=$HOME/bin:/usr/bin:/global/bin:/usr/ucb:/bin:/usr/local/bin:
XMAILDIR = $HOME/Mail # You'd better make sure it exists
XDEFAULT = $MAILDIR/mbox
XLOGFILE = $MAILDIR/from
XLOCKFILE= $HOME/.lockmail
X
X # This will create a local lockfile named todd.lock
X:0: # *if* the condition matches
X* ^From.*thf
Xtodd
X
XLOCKFILE=$MAILDIR/whatever # This will remove the global lockfile
X # $HOME/.lockmail and the new lockfile
X # will be $MAILDIR/whatever
X
X
X # The next recipe will
X # filter out all messages from "at"
X # jobs and will put them in a terse format
X # (only the date and the body) in
X # a file called $MAILDIR/atjunk
X:0 fh
X* ^From root
X* ^Subject: Output from "at" job
X|egrep "^Date:"
X # The next recipe will only be used if
X # the previous one matched
X:0 A
Xatjunk
X
X
X
XMAILDIR=$HOME/News # This will change the current directory
X
X
X # The next recipe will create a local lockfile
X # named $HOME/News/dustbin.lock (*if* the condition
X # matches), and will feed the body of the message
X # through `sort` (sorry, couldn't come up with anything
X # better :-), after which the result will be
X # appended to $HOME/News/dustbin
X:0 b:
X* ^Subject:.*rubbish
X|sort >>dustbin
X
X # The next recipe will use the games directory as a MH
X # folder (of course you need MH to read the mail then)
X:0
X* ^Subject:.*games
Xgames/.
X
X# Anything not delivered by now will go to $HOME/Mail/mbox
X# Using LOCKFILE=$HOME/Mail/mbox.lock
END_OF_FILE
if test 1533 -ne `wc -c <'procmail/examples/3procmailrc'`; then
echo shar: \"'procmail/examples/3procmailrc'\" unpacked with wrong size!
fi
# end of 'procmail/examples/3procmailrc'
fi
if test -f 'procmail/examples/3rmail' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/examples/3rmail'\"
else
echo shar: Extracting \"'procmail/examples/3rmail'\" \(757 characters\)
sed "s/^X//" >'procmail/examples/3rmail' <<'END_OF_FILE'
X#!/bin/sh
X#
X# specify the mailbox file you want to read on the command line
X# Use a relative path from your $HOME directory
X#
X# For this kind of chaotic procmailrc there is no uniform neat solution
X# to determine which lockfiles to use. I'll give just one (suboptimal)
X# solution here. Use your imagination to extend it :-).
X#
XMAILDIR=$HOME/Mail
Xcd $HOME # this means all paths are relative to $HOME
XLOCKFILE=$HOME/.lockmail
XLOCKFILE2=$HOME/Mail/whatever
Xif lockfile -! -r1 $LOCKFILE $LOCKFILE2
Xthen
X echo Mail is currently arriving, please wait...
X while
X lockfile -! -4 -r2 $LOCKFILE $LOCKFILE2
X do
X echo Mail is still arriving...
X done
Xfi
Xtrap "rm -f $LOCKFILE $LOCKFILE2;exit 0" 0 1 2 3 15
X#
X# Call you favourite mailer here.
X#
X/usr/ucb/mail -f $*
END_OF_FILE
if test 757 -ne `wc -c <'procmail/examples/3rmail'`; then
echo shar: \"'procmail/examples/3rmail'\" unpacked with wrong size!
fi
# end of 'procmail/examples/3rmail'
fi
if test -f 'procmail/mailinglist/FEATURES' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/mailinglist/FEATURES'\"
else
echo shar: Extracting \"'procmail/mailinglist/FEATURES'\" \(1741 characters\)
sed "s/^X//" >'procmail/mailinglist/FEATURES' <<'END_OF_FILE'
XSummary of what the mailinglist scripts in here provide:
X + The overseeable management of an arbitrary number of mailinglists
X + Convenient and simple creation of new mailinglists
X + Convenient and simple removal of existing mailinglists
X + Fully automated subscription/unsubscription/help-request processing
X (no operator intervention needed)
X + Enough intelligence to overcome the ignorance of some subscribers
X (will direct subscribe and unsubscribe requests away from the
X regular list and automatically onto the -request address)
X + No hardwired format for (un)subscribe requests (i.e. new subscribers
X need not be educated, unsubscribing users do not need to remember
X any particular syntax)
X + *Intelligent* autoremoval of addresses from the list that cause
X too many bounces
X + Submissions can be limited to people on the accept list (which could
X be the current list of subscribers)
X + The fully automated subscription mechanism allows for a reject list
X of unwanted subscribers
X + Auto-digest-generation (configurable per list)
X + Joint management of several mailinglists possible (through hardlinked
X rcfiles)
X + Customisation per mailinglist or mailinglist group possible (simply
X remove or create the desired hardlinks)
X + A listmaintainer can be assigned per list; miscellaneous requests
X that couldn't be handled by the list automatically are then
X forwarded to his mail address (instead of being accumulated in
X a file)
X + Allows for remote maintenance of any mailinglist by a
X listmaintainer
X + Integrated archiving service
X + Integrated diagnostic aid to give hints to the maintainer about
X possible problems
X + You can set up a mailinglist to function as a standalone mail
X archive server
END_OF_FILE
if test 1741 -ne `wc -c <'procmail/mailinglist/FEATURES'`; then
echo shar: \"'procmail/mailinglist/FEATURES'\" unpacked with wrong size!
fi
# end of 'procmail/mailinglist/FEATURES'
fi
if test -f 'procmail/mailinglist/bin/procbounce' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/mailinglist/bin/procbounce'\"
else
echo shar: Extracting \"'procmail/mailinglist/bin/procbounce'\" \(1901 characters\)
sed "s/^X//" >'procmail/mailinglist/bin/procbounce' <<'END_OF_FILE'
X#! /bin/sh
X:
X#$Id: procbounce,v 1.12 1993/06/04 13:49:06 berg Exp $
X
Xtest=test # /bin/test
Xecho=echo # /bin/echo
Xcat=cat # /bin/cat
Xmkdir=mkdir # /bin/mkdir
Xsed=sed # /bin/sed
Xls=ls # /bin/ls
Xrm=rm # /bin/rm
Xexpr=expr # /bin/expr
Xdate=date # /bin/date
Xformail=formail # /usr/local/bin/formail
Xmultigram=multigram # ../SedBinDir/multigram
Xidhash=idhash # ../SedBinDir/idhash
X
X$test -z "$listaddr" &&
X $echo "Don't start this script directly, it is used in rc.request" && exit 64
X
Xtmprequest=tmp.request
Xdist=dist
Xbounces=bounces
X
X$test -d $bounces || $mkdir $bounces
X
Xaddr=`$formail -1 -kde -xSubject: -s \
X $multigram -b1 -l$off_threshold $dist <$tmprequest |
X $sed -e 's/^ *[0-9]* \([^ ]*\).*$/\1/' `
X
Xif test ! -z "$addr"
Xthen
X serial=`$formail +1 -1 -m4 -dexMessage-Id: -s $idhash <$tmprequest`
X test -z "$serial" && serial=`$date +%y-%m-%d`
X $echo "$addr" >>$bounces/$serial
X $rm -f `$ls -t $bounces/* | $sed -e '1,'$maxhist' d' `
X
X bounced=0
X for a in $bounces/*
X do
X $test -f "$a" &&
X $echo "$addr" | $multigram -b1 -l$match_threshold $a >/dev/null &&
X bounced=`$expr $bounced + 1`
X done
X
X addfield="X-Diagnostic: Mail to $addr bounced $bounced times"
X if $expr $bounced \>= $minbounce >/dev/null
X then
X fieldcontent="`
X if echo \"$addr\" | $multigram -b1 -l$auto_off_threshold -d $dist
X then
X :
X else
X $echo 'Not confident enough to autoremove the offending address'
X $echo \"$addr\" | $multigram -b2 -l0 -d$dist
X fi | $sed -e '/^Removed:/ d' \
X -e '1 s/^ *[0-9]* \([^ ]* *[0-9]*\).*$/Removed: \1/' \
X -e '/^ *[0-9]/ /'`"
X $test ! -z "$subscribe_log" &&
X $expr "X$fieldcontent" 'XRemoved:' >/dev/null &&
X $echo "procbounce: $fieldcontent" >>$subscribe_log
X addfield="$addfield
XX-Diagnostic: Bounces exceed threshold of $minbounce
XX-Diagnostic: $fieldcontent"
X fi
X $formail -A "$addfield"
Xelse
X $cat
Xfi
END_OF_FILE
if test 1901 -ne `wc -c <'procmail/mailinglist/bin/procbounce'`; then
echo shar: \"'procmail/mailinglist/bin/procbounce'\" unpacked with wrong size!
fi
chmod +x 'procmail/mailinglist/bin/procbounce'
# end of 'procmail/mailinglist/bin/procbounce'
fi
if test -f 'procmail/mailinglist/bin/removelist' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/mailinglist/bin/removelist'\"
else
echo shar: Extracting \"'procmail/mailinglist/bin/removelist'\" \(1827 characters\)
sed "s/^X//" >'procmail/mailinglist/bin/removelist' <<'END_OF_FILE'
X#!/bin/sh
X: &&O= || exec /bin/sh $0 $argv:q # we're in a csh, feed myself to sh
X#########################################################################
X# removelist To remove mailinglists #
X# #
X# Created by S.R. van den Berg, The Netherlands #
X#########################################################################
X#$Id: removelist,v 1.4 1993/03/02 14:40:46 berg Exp $
X
Xdefaults=.etc
X
Xtest=test # /bin/test
Xrm=rm # /bin/rm
Xls=ls # /bin/ls
Xpwd=pwd # /bin/pwd
Xecho=echo # /bin/echo
Xsleep=sleep # /bin/sleep
X
XEX_USAGE=64
X
Xif $test ! -d $defaults
Xthen
X if $test -d list
X then cd ./list
X else cd ..
X $test -d $defaults || cd ..
X fi
Xfi
Xif $test ! -d $defaults
Xthen
X $echo "removelist: You should be near the main list directory to do this" \
X 1>&2
X exit $EX_USAGE
Xfi
X
Xif $test $# != 1
Xthen $echo "Usage: removelist listname" 1>&2; exit $EX_USAGE
Xfi
X
Xlist="$1"
X
Xcase "$list" in
X ../*|*/..|*/../*|*/*) $echo "removelist: Suspicious listname specified" 1>&2
X exit $EX_USAGE;;
X *[@!]*) $echo "removelist: Specify listname without domain name appended" \
X 1>&2; exit $EX_USAGE;;
Xesac
X
Xif test ! -d "$list"
Xthen $echo "removelist: \"$list\" doesn't exist" 1>&2
X $echo 1>&2
X $echo "Existing mailinglists:" 1>&2
X $echo 1>&2
X $ls 1>&2
X $echo 1>&2
X exit $EX_USAGE
Xfi
X
X$echo "Expunging `$pwd`/$list, countdown initiated:" 1>&2
X$sleep 1
X$echo " 3"
X$sleep 1
X$echo " 2"
X$sleep 1
X$echo " 1"
X$sleep 1
X$echo " zero"
X
X$rm -rf $list
X
X$echo "Don't forget to remove the corresponding entries from" 1>&2
X$echo "the /usr/lib/aliases file:" 1>&2
X$echo \########################################################################
X$echo "$list:"
X$echo "$list-request:"
X$echo "$list-dist:"
X$echo \########################################################################
END_OF_FILE
if test 1827 -ne `wc -c <'procmail/mailinglist/bin/removelist'`; then
echo shar: \"'procmail/mailinglist/bin/removelist'\" unpacked with wrong size!
fi
chmod +x 'procmail/mailinglist/bin/removelist'
# end of 'procmail/mailinglist/bin/removelist'
fi
if test -f 'procmail/mailinglist/bin/sendmails' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/mailinglist/bin/sendmails'\"
else
echo shar: Extracting \"'procmail/mailinglist/bin/sendmails'\" \(1134 characters\)
sed "s/^X//" >'procmail/mailinglist/bin/sendmails' <<'END_OF_FILE'
X#! /bin/sh
X: &&O= || exec /bin/sh $0 $argv:q # we're in a csh, feed myself to sh
X#########################################################################
X# sendmails Poor man's sendmail. #
X# #
X# If you only have /bin/[r]mail and lack a sendmail compatible #
X# mailer (i.e. a mailer that understands the -t option). #
X# #
X# Created by S.R. van den Berg, The Netherlands #
X#########################################################################
X#$Id: sendmails,v 1.2 1993/06/28 16:23:03 berg Exp $
X
Xtest=test # /bin/test
Xecho=echo # /bin/echo
Xsed=sed # /bin/sed
Xrm=rm # /bin/rm
Xformail=formail # /usr/local/bin/formail
X
Xsendmail=SedBinMail # Your substitute sendmail
X
XSMparseheader=no
X
Xwhile $test $# != 0 &&
X case "$1" in
X -t) SMparseheader=yes;; # We only parse the -t option
X -*) ;; # Ignore all other options
X *) $test a = b;; # False!
X esac
Xdo
X shift
Xdone
X
Xif $test $SMparseheader = yes
Xthen
X umask 077
X TMPF=/tmp/sms.$$
X trap "$rm -f $TMPF;exit 1" 1 2 3 15
X $sendmail $* `$sed -n -e "w $TMPF" -e '1,/^$/ p' | $formail -xTo:` <$TMPF
X $rm -f $TMPF
Xelse
X exec $sendmail $*
Xfi
END_OF_FILE
if test 1134 -ne `wc -c <'procmail/mailinglist/bin/sendmails'`; then
echo shar: \"'procmail/mailinglist/bin/sendmails'\" unpacked with wrong size!
fi
chmod +x 'procmail/mailinglist/bin/sendmails'
# end of 'procmail/mailinglist/bin/sendmails'
fi
if test -f 'procmail/mailinglist/bin/showlink' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/mailinglist/bin/showlink'\"
else
echo shar: Extracting \"'procmail/mailinglist/bin/showlink'\" \(2062 characters\)
sed "s/^X//" >'procmail/mailinglist/bin/showlink' <<'END_OF_FILE'
X#! /bin/sh
X: &&O= || exec /bin/sh $0 $argv:q # we're in a csh, feed myself to sh
X#########################################################################
X# showlink Displays all links to a file #
X# #
X# Created by S.R. van den Berg, The Netherlands #
X# #
X# If you can figure out and understand everything in this script, #
X# you can consider yourself an awk guru! #
X#########################################################################
X#$Id: showlink,v 1.4 1993/06/28 16:23:06 berg Exp $
X
Xdefaults=.etc
X
Xecho=echo # /bin/echo
Xtest=test # /bin/test
Xls=ls # /bin/ls
Xawk=awk # /usr/bin/awk
Xdirname=dirname # /bin/dirname
Xbasename=basename # /bin/basename
Xshowlink=showlink # SedHomeDir/.bin/showlink
X
XEX_USAGE=64
X
X$test 0 = $# && $echo "Usage: showlink filename ..." 1>&2 && exit $EX_USAGE
X
Xcase $# in
X 1) if $test -d "$1"
X then
X cd "$1"
X set dummy *
X shift
X $test ! -d $defaults -a -d ../$defaults && cd ..
X for a in "$@"
X do $ls -di $defaults/$a .bin*/$a */$a 2>/dev/null
X done
X else
X file="`$basename \"$1\"`"
X cd="`$dirname \"$1\"`"
X $test ! -d $defaults -a -d ../$defaults && cd ..
X $ls -di $defaults/$file .bin*/$file */$file 2>/dev/null
X fi;;
X *) $ls -di "$@";;
Xesac | $awk '
XBEGIN {
X count[0]=0;
X }
X { for(start=1;substr($0,start++,1)==" ";);
X fname[$1"#"(++count[$1])]=substr($0,length($1)+start);
X }
XEND {
X for(inode in count)
X { if((i=count[inode])>1)
X { bn=fname[inode"#"1];
X for(start=length(bn);start>0&&"/"!=substr(bn,start,1);start--);
X printf("Links to %s:\n",(bn=substr(bn,start+1)));
X lbn=length(bn="/"bn);linel=0;
X for(;i;i--)
X { if((lcn=length(cn=fname[inode"#"i]))>lbn)
X if(substr(cn,lcn+1-lbn,lbn)==bn)
X lcn=length(cn=substr(cn,1,lcn+1-lbn));
X if(!linel)
X printf(" >");
X else if(linel+lcn>=76)
X { printf("\n >");linel=0;
X }
X linel+=19;
X if((lcn-=18)>0)
X { linel+=lcn;linel+=lcn=19-lcn%19;
X }
X else
X lcn=0;
X if(linel>76)
X linel=76;
X printf("%"lcn"s %18s","",cn);
X }
X printf("\n");
X }
X }
X }'
END_OF_FILE
if test 2062 -ne `wc -c <'procmail/mailinglist/bin/showlink'`; then
echo shar: \"'procmail/mailinglist/bin/showlink'\" unpacked with wrong size!
fi
chmod +x 'procmail/mailinglist/bin/showlink'
# end of 'procmail/mailinglist/bin/showlink'
fi
if test -f 'procmail/mailinglist/bin/unsubscribe' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/mailinglist/bin/unsubscribe'\"
else
echo shar: Extracting \"'procmail/mailinglist/bin/unsubscribe'\" \(1799 characters\)
sed "s/^X//" >'procmail/mailinglist/bin/unsubscribe' <<'END_OF_FILE'
X#! /bin/sh
X:
X#$Id: unsubscribe,v 1.16 1993/06/25 11:09:26 berg Exp $
X
Xtest=test # /bin/test
Xecho=echo # /bin/echo
Xcat=cat # /bin/cat
Xsed=sed # /bin/sed
Xexpr=expr # /bin/expr
Xformail=formail # /usr/local/bin/formail
Xmultigram=multigram # ../SedBinDir/multigram
X
X$test -z "$listaddr" &&
X $echo "Don't start this script directly, it is used in rc.request" && exit 64
X
Xtmprequest=tmp.request
Xtmpfrom=tmp.from
Xdist=dist
X
Xcase "$X_ENVELOPE_TO" in
X *$list-request*) wrongaddress="" ;;
X *) wrongaddress="WARNING:
X Please try to use '$listreq'
X the next time when issuing (un)subscribe requests.
X" ;;
Xesac
X
X$formail -i"From: $listreq" -rtA"X-Loop: $listaddr" -I"Precedence: junk" \
X <$tmprequest
X
X$test ! -z "$wrongaddress" && $echo "$wrongaddress" && wrongaddress=""
X
Xfromaddr="`$cat $tmpfrom`"
X
Xremtext=`
X if $multigram -b1 -l$off_threshold -x$listreq -x$listaddr -d $dist 2>/dev/null
X then
X $echo
X $echo "You have been removed from the list."
X else
X $echo "You have not been removed, I couldn't find your name on the list."
X fi`
X
X$echo "$remtext" | $sed -e '1 s/^ *[0-9]* [^ ]* \(.*\)$/\1/' \
X -e '2 s/^Removed: \(.*\)$/\1/w '$tmpfrom
X
Xif $test ! -z "$subscribe_log"
Xthen
X if $expr "X$remtext" : ".*You have been removed" >/dev/null
X then
X $echo "unsubscribe: `$echo \"$remtext\" | $sed -e '2,$d'` by:$fromaddr"
X else
X $echo "unsubscribe: attempt `$multigram -b1 -l0 -x$listreq -x$listaddr \
X $dist <$tmprequest` by:$fromaddr"
X fi >>$subscribe_log
Xfi
X
X$echo "$fromaddr" >>$tmpfrom
X
X$echo
X$echo "If this wasn't your intention, reply to this mail now (quoting it"
X$echo "entirely (for diagnostic purposes), and of course adding any"
X$echo "comments you see fit)."
X$echo
X$echo "Transcript of unsubscription request follows:"
X$echo "-- "
X
X$sed -e 's/^\(.\)/>\1/' $tmprequest
END_OF_FILE
if test 1799 -ne `wc -c <'procmail/mailinglist/bin/unsubscribe'`; then
echo shar: \"'procmail/mailinglist/bin/unsubscribe'\" unpacked with wrong size!
fi
chmod +x 'procmail/mailinglist/bin/unsubscribe'
# end of 'procmail/mailinglist/bin/unsubscribe'
fi
if test -f 'procmail/mailinglist/bin/x_command' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/mailinglist/bin/x_command'\"
else
echo shar: Extracting \"'procmail/mailinglist/bin/x_command'\" \(2157 characters\)
sed "s/^X//" >'procmail/mailinglist/bin/x_command' <<'END_OF_FILE'
X#! /bin/sh
X:
X#$Id: x_command,v 1.8 1993/06/07 12:37:03 berg Exp $
X
Xecho=echo # /bin/echo
Xtest=test # /bin/test
Xcat=cat # /bin/cat
Xformail=formail # /usr/local/bin/formail
Xsubscribe=subscribe # ../SedBinDir/subscribe
Xunsubscribe=unsubscribe # ../SedBinDir/unsubscribe
Xmultigram=multigram # ../SedBinDir/multigram
X
Xtmprequest=tmp.request
Xtmpfrom=tmp.from
Xdist=dist
Xlog=log
X
X$test -z "$listaddr" &&
X $echo "Don't start this script directly, it is used in rc.request" && exit 64
X
XX_ENVELOPE_TO=$list-request # to convince (un)subscribe we used the right
Xexport X_ENVELOPE_TO # address
X
X$formail -R$X_COMMAND: X-Processed:
X
Xwhile $test $# != 0
Xdo
X case "_$1" in
X _subscribe)
X $echo="X-Diagnostic: `$echo $2 | $multigram -b1 -l-32767 dist`"
X $echo "From $2 " >$tmprequest
X $echo "From: $listreq" >>$tmprequest
X $echo "Reply-To: $2" >>$tmprequest
X $echo "To: $listreq" >>$tmprequest
X $echo "Subject: subscribe $2" >>$tmprequest
X $echo "$2" >$tmpfrom
X $test -z "$subscribe_log" ||
X $echo "x_command: subscribe" >>$subscribe_log
X $subscribe <$tmprequest | $SENDMAIL $sendmailOPT -t
X shift ;;
X _unsubscribe)
X $echo="X-Diagnostic: `$echo $2 | $multigram -b1 -l-32767 dist`"
X $echo "From $2 " >$tmprequest
X $echo "From: $listreq" >>$tmprequest
X $echo "Reply-To: $2" >>$tmprequest
X $echo "To: $listreq" >>$tmprequest
X $echo "Subject: unsubscribe $2" >>$tmprequest
X $echo "$maintainer" "$2" >$tmpfrom
X $test -z "$subscribe_log" ||
X $echo "x_command: unsubscribe" >>$subscribe_log
X $unsubscribe <$tmprequest | $SENDMAIL $sendmailOPT `cat $tmpfrom`
X shift ;;
X _showdist)
X $echo "--- Current subscribers:"
X $cat $dist
X $echo "--- End of subscriber list" ;;
X _showlog)
X $echo "--- Current log:"
X $cat $log
X $echo "--- End of log" ;;
X _wipelog)
X $cat /dev/null >$log ;;
X _help|_info)
X $echo "Known $X_COMMAND keywords:"
X $echo " subscribe mailaddress"
X $echo " unsubscribe mailaddress"
X $echo " showdist"
X $echo " showlog"
X $echo " wipelog"
X $echo " help"
X $echo " info" ;;
X _$X_COMMAND_PASSWORD|_$maintainer) ;;
X *) $echo "X-Diagnostic: Unknown command $1" ; set dummy help ;;
X esac
X shift
Xdone
END_OF_FILE
if test 2157 -ne `wc -c <'procmail/mailinglist/bin/x_command'`; then
echo shar: \"'procmail/mailinglist/bin/x_command'\" unpacked with wrong size!
fi
chmod +x 'procmail/mailinglist/bin/x_command'
# end of 'procmail/mailinglist/bin/x_command'
fi
if test -f 'procmail/mailinglist/etc/help.txt' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/mailinglist/etc/help.txt'\"
else
echo shar: Extracting \"'procmail/mailinglist/etc/help.txt'\" \(2023 characters\)
sed "s/^X//" >'procmail/mailinglist/etc/help.txt' <<'END_OF_FILE'
X General info
X ------------
XSubcription/unsubscription/info requests should always be sent to the -request
Xaddress of a mailinglist.
XIf a mailinglist for example is called "thelist@some.domain", then the -request
Xaddress can be inferred from this to be: "thelist-request@some.domain".
X
XTo subscribe to a mailinglist, simply send a message with the word "subscribe"
Xin the Subject: field to the -request address of that list.
X
XTo unsubscribe from a mailinglist, simply send a message with the word (you
Xguessed it :-) "unsubscribe" in the Subject: field to the -request address of
Xthat list.
X
XWith the subscription request you can optionally specify that you do
Xnot want to receive back any copies of your own submissions. You can
Xdo this by adding the following text in your subscription request:
X "no copies please."
XThis feature is not fully supported yet. You will be marked as such, but
Xyou will receive back copies anyway.
X
XIn the event of an address change, it would probably be the wisest to first
Xsend an unsubscribe for the old address (this can be done from the new
Xaddress), and then a new subscribe to the new address (the order is important).
X
XMost (un)subscription requests are processed automatically without human
Xintervention.
X
X The archive server
X ------------------
XEvery submission sent to this list is archived. The size of the archive
Xdepends on the limits set by the list maintainer (it is very well possible
Xthat only, say, the last two mails sent to the list are still archived, the
Xrest might have expired).
X
XYou can look at the header of every mail coming from this list to see
Xunder what name it has been archived. The X-Mailing-List: field contains
Xthe mailaddress of the list and the file in which this submission was
Xarchived.
X
XIf you want to access this archive, you have to send mails to the -request
Xaddress with the word "archive" as the first word of your Subject:.
XTo get you started try sending a mail to the -request address with
Xthe following:
X Subject: archive help
X--
END_OF_FILE
if test 2023 -ne `wc -c <'procmail/mailinglist/etc/help.txt'`; then
echo shar: \"'procmail/mailinglist/etc/help.txt'\" unpacked with wrong size!
fi
# end of 'procmail/mailinglist/etc/help.txt'
fi
if test -f 'procmail/mailinglist/etc/rc.archive' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/mailinglist/etc/rc.archive'\"
else
echo shar: Extracting \"'procmail/mailinglist/etc/rc.archive'\" \(1752 characters\)
sed "s/^X//" >'procmail/mailinglist/etc/rc.archive' <<'END_OF_FILE'
X# BEFORE editing this file, you should make sure that it is not linked to
X# the master version (../.etc/rc.archive) anymore (i.e. "delink rc.request"
X# if you do not want your changes to affect all archive servers).
X#
X# New mails can be temporarily stalled by creating the file rc.lock (either in
X# ../.etc for all lists or in the current directory for this list only).
X
X#$Id: rc.archive,v 1.3 1993/06/21 14:23:47 berg Exp $
X
XINCLUDERC=$RC_INIT
XINCLUDERC=$RC_CUSTOM
X
XLOCKFILE=tmp.lock # for reusing tmp.(request|from)
X # also makes sure that the load doesn't go sky-high
X # when a lot of mail arrives concurrently
X
X#
X# We drop the message in the bitbucket if:
X# It's too big.
X# We sent it ourselves.
X# It was sent by a daemon of some kind.
X#
X
X:0
X* > 32768
X/dev/null
X
X:0
X* ^FROM_DAEMON|X-Loop: $listaddr
X/dev/null
X
X#
X# We now check that it is not a reply or something.
X# If it isn't, we extract the sender address into tmp.from
X#
X
X:0 whc
X* !^Subject:(.*[^a-z])?(Re:|erro|problem|((can)?not|.*n't)([^a-z]|$))
X| formail -rt -xTo: >tmp.from
X
X#
X# Store the whole mail in tmp.request, for later reference.
X#
X
X :0 Ac
X | cat >tmp.request
X
X#
X# Feed it to the archive server.
X#
X
X :0 A
X | arch_retrieve
X
XLOCKFILE # we don't need the lockfile anymore
X
X#
X# Anything not taken care of yet will be served to the maintainer of the list.
X#
X
X:0 fh
X| formail -A"X-Envelope-To: $X_ENVELOPE_TO"
X
X#
X# If this list does not have a maintainer e-mail address, drop things in
X# the file request.
X#
X
X:0:
X* ?test -z "$maintainer"
Xrequest
X
X:0 w
X| formail -R"From X-Envelope-From:" -iReturn-Receipt-To: \
X | $SENDMAIL $sendmailOPT $sendmailOPTp $maintainer
X
X:0 wfh
X| formail -A"X-Diagnostic: Maintainer $maintainer could not be reached"
X
XHOST=continue_with_../.etc/rc.post
END_OF_FILE
if test 1752 -ne `wc -c <'procmail/mailinglist/etc/rc.archive'`; then
echo shar: \"'procmail/mailinglist/etc/rc.archive'\" unpacked with wrong size!
fi
# end of 'procmail/mailinglist/etc/rc.archive'
fi
if test -f 'procmail/mailinglist/etc/rc.custom' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/mailinglist/etc/rc.custom'\"
else
echo shar: Extracting \"'procmail/mailinglist/etc/rc.custom'\" \(1890 characters\)
sed "s/^X//" >'procmail/mailinglist/etc/rc.custom' <<'END_OF_FILE'
X#
X# Assign the fully qualified mail address of the maintainer of this list
X# to "maintainer". If empty, request-mail will not be mailed to any
X# maintainer and will be stored in the "request" file for this list.
X#
X
Xmaintainer =
X
X#LOGABSTRACT=yes # uncomment in case of emergency
X#VERBOSE=yes # uncomment in case of real emergency
X
X#size_limit = 524288 # sanity cutoff value for submissions
X#archive_hist = 2 # number of messages left archived
X#archive_log = $LOGFILE # log file for archive retrievals
X#maxhist = 8 # bounce history limit
X#minbounce = 3 # no. of bounces before removal
X#cutoff_bounce = 256 # lines to keep in bounce processing
X#subscribe_log = $LOGFILE # log file for administrivia
X
X#match_threshold= 30730 # for close matches to the list
X#medium_threshold= 28672 # for not so close matches to the list
X#loose_threshold= 24476 # for loosely finding your name
X
X#auto_off_threshold= $medium_threshold # for auto-unsubscribing bouncers
X#off_threshold = $loose_threshold # for unsubscribing
X#reject_threshold= $match_threshold # for rejecting subscriptions
X#submit_threshold= $medium_threshold # for permitting submissions
X
X#foreign_submit = yes
X##foreign_submit # uncomment this line if you
X # want to restrict submitting to
X # people on the accept list
X#cc_requests
X##cc_requests = c # uncomment if you want subscribe
X # and help requests to be Cc'd to
X # the maintainer
X#digest_flag = <0
X##digest_flag = >0 # uncomment this if you want digests
X#digest_age = 262144 # maximum age of a digest in seconds
X#digest_size = 32768 # maximum size of a digest in bytes
Xundigested_list = $list@$domain # Reply-To: address for digests
X
X#X_COMMAND = X-Command
X#X_COMMAND_PASSWORD = # put the password for
X # X-Command mails here
X
XRC_CUSTOM # clear this one from the environment
X # so that we include this file only
X # once
END_OF_FILE
if test 1890 -ne `wc -c <'procmail/mailinglist/etc/rc.custom'`; then
echo shar: \"'procmail/mailinglist/etc/rc.custom'\" unpacked with wrong size!
fi
# end of 'procmail/mailinglist/etc/rc.custom'
fi
if test -f 'procmail/mailinglist/etc/rc.post' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/mailinglist/etc/rc.post'\"
else
echo shar: Extracting \"'procmail/mailinglist/etc/rc.post'\" \(425 characters\)
sed "s/^X//" >'procmail/mailinglist/etc/rc.post' <<'END_OF_FILE'
X#$Id: rc.post,v 1.4 1993/06/21 14:23:52 berg Exp $
XMAILDIR=../$defaults # back to the defaults directory
XLOGFILE=log # enabled by default, because when processing
X # reaches this point, some unusual circumstance
X # has occurred.
XLOGABSTRACT=yes
X
X:0 :
X* ?test -z "$listmaster"
Xrequest
X
X:0 w
X| formail -R"From X-Envelope-From:" -iReturn-Receipt-To: \
X | $SENDMAIL $sendmailOPT $sendmailOPTp $listmaster
X
X:0:
Xrequest
END_OF_FILE
if test 425 -ne `wc -c <'procmail/mailinglist/etc/rc.post'`; then
echo shar: \"'procmail/mailinglist/etc/rc.post'\" unpacked with wrong size!
fi
# end of 'procmail/mailinglist/etc/rc.post'
fi
if test -f 'procmail/mailinglist/install.sh3' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/mailinglist/install.sh3'\"
else
echo shar: Extracting \"'procmail/mailinglist/install.sh3'\" \(1981 characters\)
sed "s/^X//" >'procmail/mailinglist/install.sh3' <<'END_OF_FILE'
X#! /bin/sh
X: &&O= || exec /bin/sh install.sh3 # we're in a csh, feed myself to sh
X#$Id: install.sh3,v 1.10 1993/06/29 15:36:02 berg Exp $
X
Xtest -z "$bindir" && echo "Call install.sh instead" && exit 64
X
Xtest ! -d "$target" && echo "Please create the target directory first" &&
X echo "Make sure that the target directory has the right owner" && exit 2
X
XFRAGILE="rc.init "
XDIRS="etc"
X
Xecho "Preserving any old files: $FRAGILE"
X
Xfor a in $FRAGILE
Xdo
X test -f "$target/.etc/$a" &&
X mv -f "$target/.etc/$a" "$target/.etc/$a.old"
Xdone
X
Xecho Fixing up incompatibilities with older versions...
X
X( cd "$target"
X for a in *
X do
X ln "$a/dist" "$a/accept" 2>/dev/null
X done
X)
X
Xecho Installing...
X
Xfor a in bin $DIRS
Xdo
X targdir="$target/.$a"
X test $a = bin && targdir="$target/$bindir"
X mkdir "$targdir" 2>/dev/null
X cd $a
X c=`echo *`
X cd ..
X for b in $c
X do
X sed -e "s:SedBinDir:$bindir:g" -e "s:SedHomeDir:$target:g" \
X -e "s:SedBinMail:$binmail:g" <"$a/$b" >"$targdir/$b"
X done
Xdone
X
Xchmod 0640 "$target/.etc/rc.custom" "$target/.etc/rc.init"
X
Xfor a in $FRAGILE
Xdo
X if test -f "$target/.etc/$a.old"
X then
X mv -f "$target/.etc/$a" "$target/.etc/$a.new"
X mv -f "$target/.etc/$a.old" "$target/.etc/$a"
X fi
Xdone
X
Xrm -f "$target/$bindir/multigram"
Xcp ../src/multigram "$target/$bindir"
X
Xsed -e "s:/home/list/.bin:$target/$bindir:g" <Manual >"$target/.etc/Manual"
Xmv -f "$target/$bindir/procmail" "$target/$bindir/.procmail" 2>/dev/null
Xchmod 0755 $target/$bindir/* 2>/dev/null
Xfor a in flist senddigest idhash
Xdo
X rm -f "$target/$bindir/$a"
X ln "$target/$bindir/multigram" "$target/$bindir/$a"
Xdone
Xchmod 04755 "$target/$bindir/flist" 2>/dev/null
Xmv -f "$target/$bindir/.procmail" "$target/$bindir/procmail" 2>/dev/null
X
Xls -ld "$target/$bindir" $target/$bindir/*
X
Xfor a in $DIRS
Xdo
X ls -ld "$target/.$a" $target/.$a/*
Xdone
X
Xecho Creating link from .etc/rc.main to .procmailrc
Xrm -f "$target/.procmailrc"
Xln "$target/.etc/rc.main" "$target/.procmailrc"
END_OF_FILE
if test 1981 -ne `wc -c <'procmail/mailinglist/install.sh3'`; then
echo shar: \"'procmail/mailinglist/install.sh3'\" unpacked with wrong size!
fi
chmod +x 'procmail/mailinglist/install.sh3'
# end of 'procmail/mailinglist/install.sh3'
fi
if test -f 'procmail/man/mansed' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/man/mansed'\"
else
echo shar: Extracting \"'procmail/man/mansed'\" \(1351 characters\)
sed "s/^X//" >'procmail/man/mansed' <<'END_OF_FILE'
X#! /bin/sh
X:
X#$Id: mansed,v 1.10 1993/06/21 14:24:00 berg Exp $
X
Xtest 5 != $# &&
X echo "Don't start this script directly, use \`make'" && exit 1
X
XSHELL=$1
XSRC="$2"
XDEST="$3"
XRM="$4"
XDEVNULL=$5
Xexport SHELL SRC DEST RM DEVNULL
X
Xif test ! -f "$DEST"
Xthen
X trap "$RM \"$DEST\";exit 1" 1 2 3 15
Xfi
X
X(cat <<\HERE
X.de Id
X.ds Rv \\$3
X.ds Dt \\$4
X..
X.de Sh
X.br
X.ne 11
X.SH "\\$1"
X..
X.de Ss
X.br
X.ne 10
X.SS "\\$1"
X..
X.de Tp
X.br
X.ne 9
X.TP \\$1
X..
X.de Rs
X.na
X.nf
X.RS
X..
X.de Re
X.RE
X.fi
X.ad
X..
X.de Sx
X.PP
X.ne \\$1
X.Rs
X..
X.de Ex
X.Re
X.PP
X..
XHERE
Xcat "$SRC"
Xexpr "X$DEST" : '.*[18]$' >$DEVNULL && cat <<HERE
X.Sh SOURCE
XThis program is part of the
X.I procmail mail-processing-package
X(@PM_VERSION@) available at your nearest USENET comp.sources.misc archive, or
Xat ftp.informatik.rwth-aachen.de (137.226.112.172) as
X.BR pub/unix/procmail.tar.Z .
X.Sh MAILINGLIST
XThere exists a mailinglist for questions relating to any program in the
Xprocmail package:
X.RS
X@PM_MAILINGLIST@
X.RS
Xfor submitting questions/answers.
X.RE
X@PM_MAILINGLISTR@
X.RS
Xfor subscription requests.
X.RE
X.RE
XHERE
Xcat <<HERE
X.Sh AUTHOR
XStephen R. van den Berg at RWTH-Aachen, Germany
X.Rs
X@MY_MAIL_ADDR@
X@MY_ALT_MAIL_ADDR@
X.Re
XHERE
X )| sed -f man.sed |
X if test -f man.sed.1
X then
X sed -f man.sed.0 | sed -f man.sed.1
X else
X sed -f man.sed.0
X fi >"$DEST"
X
Xif test -f "$DEST"
Xthen
X exit 0
Xelse
X exit 1
Xfi
END_OF_FILE
if test 1351 -ne `wc -c <'procmail/man/mansed'`; then
echo shar: \"'procmail/man/mansed'\" unpacked with wrong size!
fi
chmod +x 'procmail/man/mansed'
# end of 'procmail/man/mansed'
fi
if test -f 'procmail/src/exopen.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/src/exopen.c'\"
else
echo shar: Extracting \"'procmail/src/exopen.c'\" \(2016 characters\)
sed "s/^X//" >'procmail/src/exopen.c' <<'END_OF_FILE'
X/************************************************************************
X * Collection of NFS resistant exclusive creat routines *
X * *
X * Copyright (c) 1990-1992, S.R. van den Berg, The Netherlands *
X * #include "README" *
X ************************************************************************/
X#ifdef RCS
Xstatic /*const*/char rcsid[]=
X "$Id: exopen.c,v 1.10 1993/05/05 13:06:10 berg Exp $";
X#endif
X#include "procmail.h"
X#include "robust.h"
X#include "misc.h"
X#include "exopen.h"
X
Xconst char*hostname P((void))
X{ static char name[HOSTNAMElen+1];
X#ifdef NOuname
X gethostname(name,HOSTNAMElen+1);
X#else
X struct utsname names;
X Uname(&names);strncpy(name,names.nodename,HOSTNAMElen);
X#endif
X name[HOSTNAMElen]='\0';return name;
X}
X
Xvoid ultoan(val,dest)unsigned long val;char*dest; /* convert to a number */
X{ register i; /* within the set [0-9A-Za-z-_] */
X do
X { i=val&0x3f; /* collating sequence dependency! */
X *dest++=i+(i<10?'0':i<10+26?'A'-10:i<10+26+26?'a'-10-26:
X i==10+26+26?'-'-10-26-26:'_'-10-26-27);
X }
X while(val>>=6);
X *dest='\0';
X}
X
Xunique(full,p,mode,verbos)const char*const full;char*const p;
X const mode_t mode;const int verbos;
X{ unsigned long retry=mrotbSERIAL;int i; /* create unique file name */
X do
X { ultoan(maskSERIAL&(retry-=irotbSERIAL)+(long)thepid,p+1);*p=UNIQ_PREFIX;
X strcat(p,hostname());
X }
X#ifndef O_CREAT
X#define ropen(path,type,mode) creat(path,mode)
X#endif
X while(0>(i=ropen(full,O_WRONLY|O_CREAT|O_EXCL,mode))&&errno==EEXIST&&
X retry); /* casually check if it already exists (highly unlikely) */
X if(i<0)
X { if(verbos) /* this error message can be confusing */
X writeerr(full); /* for casual users */
X return 0;
X }
X rclose(i);return 1;
X}
X /* rename MUST fail if already existent */
Xmyrename(old,newn)const char*const old,*const newn;
X{ int i,serrno;struct stat stbuf;
X link(old,newn);serrno=errno;i=stat(old,&stbuf);unlink(old);errno=serrno;
X return stbuf.st_nlink==2?i:-1;
X}
END_OF_FILE
if test 2016 -ne `wc -c <'procmail/src/exopen.c'`; then
echo shar: \"'procmail/src/exopen.c'\" unpacked with wrong size!
fi
# end of 'procmail/src/exopen.c'
fi
if test -f 'procmail/src/exopen.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/src/exopen.h'\"
else
echo shar: Extracting \"'procmail/src/exopen.h'\" \(557 characters\)
sed "s/^X//" >'procmail/src/exopen.h' <<'END_OF_FILE'
X/*$Id: exopen.h,v 1.5 1993/05/05 13:06:12 berg Exp $*/
X
Xconst char*
X hostname P((void));
Xvoid
X ultoan P((unsigned long val,char*dest));
Xint
X unique Q((const char*const full,char*const p,const mode_t mode,const verbos)),
X myrename P((const char*const old,const char*const newn));
X
X#define charsSERIAL 4
X#define UNIQnamelen (1+charsSERIAL+HOSTNAMElen+1)
X#define bitsSERIAL (6*charsSERIAL)
X#define maskSERIAL ((1L<<bitsSERIAL)-1)
X#define rotbSERIAL 2
X#define irotbSERIAL (1L<<bitsSERIAL-rotbSERIAL)
X#define mrotbSERIAL ((maskSERIAL&irotbSERIAL-1)+irotbSERIAL)
END_OF_FILE
if test 557 -ne `wc -c <'procmail/src/exopen.h'`; then
echo shar: \"'procmail/src/exopen.h'\" unpacked with wrong size!
fi
# end of 'procmail/src/exopen.h'
fi
if test -f 'procmail/src/formisc.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/src/formisc.h'\"
else
echo shar: Extracting \"'procmail/src/formisc.h'\" \(564 characters\)
sed "s/^X//" >'procmail/src/formisc.h' <<'END_OF_FILE'
X/*$Id: formisc.h,v 1.7 1993/01/22 13:42:32 berg Exp $*/
X
Xvoid
X loadsaved P((const struct saved*const sp)),
X loadbuf Q((const char*const text,const size_t len)),
X loadchar P((const c)),
X elog P((const char*const a)),
X tputssn Q((const char*a,size_t l)),
X ltputssn Q((const char*a,size_t l)),
X lputcs P((const i)),
X startprog P((const char*Const*const argv)),
X nofild P((void)),
X waitforit P((void)),
X nlog P((const char*const a)),
X logqnl P((const char*const a)),
X closemine P((void)),
X opensink P((void));
Xchar*
X skipwords P((char*start));
Xint
X getline P((void));
END_OF_FILE
if test 564 -ne `wc -c <'procmail/src/formisc.h'`; then
echo shar: \"'procmail/src/formisc.h'\" unpacked with wrong size!
fi
# end of 'procmail/src/formisc.h'
fi
if test -f 'procmail/src/misc.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/src/misc.h'\"
else
echo shar: Extracting \"'procmail/src/misc.h'\" \(1511 characters\)
sed "s/^X//" >'procmail/src/misc.h' <<'END_OF_FILE'
X/*$Id: misc.h,v 1.14 1993/06/21 14:24:44 berg Exp $*/
X
Xvoid
X elog P((const char*const newt)),
X ignoreterm P((void)),
X setids Q((const uid_t uid,const gid_t gid)),
X writeerr P((const char*const line)),
X progerr P((const char*const line)),
X chderr P((const char*const dir)),
X readerr P((const char*const file)),
X yell P((const char*const a,const char*const b)),
X nlog P((const char*const a)),
X logqnl P((const char*const a)),
X skipped P((const char*const x)),
X sterminate P((void)),
X terminate P((void)),
X suspend P((void)),
X app_val P((struct dyna_long*const sp,const off_t val)),
X firstchd P((void)),
X srequeue P((void)),
X slose P((void)),
X sbounce P((void)),
X catlim P((const char*src)),
X setdef P((const char*const name,const char*const contents)),
X metaparse P((const char*p)),
X setlastfolder P((const char*const folder)),
X asenv P((const char*const chp)),
X concatenate P((char*p));
Xint
X forkerr Q((const pid_t pid,const char*const a)),
X nextrcfile P((void)),
X asenvcpy P((char*src)),
X alphanum P((const unsigned c));
Xchar
X *lastdirsep P((const char*filename)),
X *cat P((const char*const a,const char*const b)),
X *tstrdup P((const char*const a)),
X *cstr P((char*const a,const char*const b)),
X *skpspace P((const char*chp)),
X *gobenv P((char*chp)),
X *egrepin P((char*expr,const char*source,const long len,int casesens));
Xconst char
X *tgetenv P((const char*const a));
Xlong
X renvint P((const long i,const char*const env));
X
Xextern const char lastfolder[];
Xextern didchd;
X
X#define MAXvarvals maxindex(strenvvar)
END_OF_FILE
if test 1511 -ne `wc -c <'procmail/src/misc.h'`; then
echo shar: \"'procmail/src/misc.h'\" unpacked with wrong size!
fi
# end of 'procmail/src/misc.h'
fi
if test -f 'procmail/src/pipes.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/src/pipes.h'\"
else
echo shar: Extracting \"'procmail/src/pipes.h'\" \(571 characters\)
sed "s/^X//" >'procmail/src/pipes.h' <<'END_OF_FILE'
X/*$Id: pipes.h,v 1.4 1992/11/11 14:00:33 berg Exp $*/
X
Xvoid
X inittmout P((const char*const progname)),
X ftimeout P((void)),
X exectrap P((const char*const tp));
Xint
X pipthrough P((char*line,char*source,const long len));
Xlong
X pipin P((char*const line,char*source,long len));
Xchar*
X readdyn P((char*bf,long*const filled)),
X *fromprog Q((char*name,char*const dest,size_t max));
X
X#define PRDO poutfd[0]
X#define PWRO poutfd[1]
X#define PRDI pinfd[0]
X#define PWRI pinfd[1]
X#define PRDB pbackfd[0]
X#define PWRB pbackfd[1]
X
Xextern pid_t pidchild;
Xextern volatile time_t alrmtime;
END_OF_FILE
if test 571 -ne `wc -c <'procmail/src/pipes.h'`; then
echo shar: \"'procmail/src/pipes.h'\" unpacked with wrong size!
fi
# end of 'procmail/src/pipes.h'
fi
if test -f 'procmail/src/procmail.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/src/procmail.h'\"
else
echo shar: Extracting \"'procmail/src/procmail.h'\" \(2150 characters\)
sed "s/^X//" >'procmail/src/procmail.h' <<'END_OF_FILE'
X/*$Id: procmail.h,v 1.14 1993/06/21 14:24:52 berg Exp $*/
X
X#include "includes.h"
X
Xtypedef unsigned char uschar; /* sometimes uchar is already typedef'd */
X#ifdef uchar
X#undef uchar
X#endif
X#define uchar uschar
X
X#ifdef console
X#define DEFverbose 1
X#else
X#define DEFverbose 0
X#endif
X
X#ifndef DEFsendmail
X#define DEFsendmail SENDMAIL
X#endif
X
X#ifndef SYSTEM_MBOX
X#define SYSTEM_MBOX SYSTEM_MAILBOX
X#endif
X
X#define XTRAlinebuf 2 /* surplus of LINEBUF (see readparse()) */
X
X#define rc_NOFILE (-1)
X#define rc_NOSGID (-2) /* you can forget any sgidness */
X#define rc_INIT (-3)
X
X#define MCDIRSEP (dirsep+STRLEN(dirsep)-1) /* most common DIRSEP */
X#define MCDIRSEP_ (dirsep+STRLEN(DIRSEP)-1)
X
X#define lck_LOCKFILE 1 /* crosscheck the order of this with msg[] */
X#define lck_ALLOCLIB 2 /* in sterminate() in retint.c */
X#define lck_MEMORY 4
X#define lck_FORK 8
X#define lck_FILDES 16
X#define lck_KERNEL 32
X
Xextern struct varval{const char*const name;long val;}strenvvar[];
X#define locksleep (strenvvar[0].val)
X#define locktimeout (strenvvar[1].val)
X#define suspendv (strenvvar[2].val)
X#define noresretry (strenvvar[3].val)
X#define timeoutv (strenvvar[4].val)
X#define verbose (strenvvar[5].val)
X#define lgabstract (strenvvar[6].val)
X
Xstruct dyna_long{size_t filled,tspace;off_t*offs;};
X
Xint
X eqFrom_ P((const char*const a));
X
Xextern char*buf,*buf2,*globlock,*loclock,*tolock,*Stdout,*themail,*thebody;
Xextern const char shellflags[],shell[],lockfile[],lockext[],newline[],binsh[],
X unexpeof[],shellmetas[],*const*gargv,*const*restargv,*sgetcp,*rcfile,
X dirsep[],msgprefix[],devnull[],lgname[],executing[],oquote[],cquote[],
X whilstwfor[],procmailn[],Mail[],home[],maildir[],*defdeflock,*argv0;
Xextern long filled;
Xextern sh,pwait,retval,retvl2,lcking,rc,ignwerr,lexitcode,asgnlastf,
X accspooldir,crestarg;
Xextern size_t linebuf;
Xextern volatile nextexit;
Xextern pid_t thepid;
Xextern uid_t uid;
Xextern gid_t gid,sgid;
X
X/*
X * External variables that are checked/changed by the signal handlers:
X * volatile time_t alrmtime;
X * pid_t pidfilt,pidchild;
X * volatile nextexit;
X * int lcking;
X * static volatile mailread; in mailfold.c
X */
END_OF_FILE
if test 2150 -ne `wc -c <'procmail/src/procmail.h'`; then
echo shar: \"'procmail/src/procmail.h'\" unpacked with wrong size!
fi
# end of 'procmail/src/procmail.h'
fi
if test -f 'procmail/src/recommend.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procmail/src/recommend.c'\"
else
echo shar: Extracting \"'procmail/src/recommend.c'\" \(1932 characters\)
sed "s/^X//" >'procmail/src/recommend.c' <<'END_OF_FILE'
X/************************************************************************
X * recommend Analyses the installation, and makes *
X * recommendations about suid/sgid modes *
X ************************************************************************/
X/*$Id: recommend.c,v 1.5 1993/03/12 16:54:43 berg Exp $*/
X#include "includes.h" /* also for fprintf() */
X
X#ifndef SYSTEM_MBOX
X#define SYSTEM_MBOX SYSTEM_MAILBOX
X#endif
X
X#define PERMIS (S_IRWXU|S_IRWXG&~S_IWGRP|S_IRWXO&~S_IWOTH)
X
Xchar systm_mbox[]=SYSTEM_MBOX;
Xconst char dirsep[]=DIRSEP,
X *const checkf[]={"/bin/mail","/bin/lmail","/usr/lib/sendmail",
X "/usr/lib/smail",0};
X /* following routine lifted from misc.c */
Xchar*lastdirsep(filename)const char*filename; /* finds the next character */
X{ const char*p; /* following the last DIRSEP */
X while(p=strpbrk(filename,dirsep))
X filename=p+1;
X return(char*)filename;
X}
X
Xmain(argc,argv)const int argc;const char*const argv[];
X{ struct group*grp;struct stat stbuf;gid_t gid=NOBODY_gid;
X const char*const*p;mode_t sgid=0;int chmdir=0;
X if(argc!=3)
X { fprintf(stderr,"Please run this program via 'make recommend'\n");
X return EX_USAGE;
X }
X *lastdirsep(systm_mbox)='\0';
X for(p=checkf;*p;p++)
X if(!stat(*p,&stbuf)&&stbuf.st_mode&S_ISGID)
X { if(stbuf.st_mode&S_ISGID)
X sgid=S_ISGID,gid=stbuf.st_gid;
X break;
X }
X if(!stat(systm_mbox,&stbuf)&&!(stbuf.st_mode&S_IWOTH))
X { sgid=S_ISGID;gid=stbuf.st_gid;
X if(!(stbuf.st_mode&S_IWGRP))
X chmdir=1;
X }
X if(gid!=stbuf.st_gid)
X sgid=0;
X printf("chown root %s\n",argv[1]);
X if(sgid)
X if(grp=getgrgid(gid))
X printf("chgrp %s %s %s\n",grp->gr_name,argv[1],argv[2]);
X else
X printf("chgrp %u %s %s\n",(int)gid,argv[1],argv[2]);
X printf("chmod %o %s\n",sgid|S_ISUID|PERMIS,argv[1]);
X if(sgid)
X { printf("chmod %o %s\n",sgid|PERMIS,argv[2]);
X if(chmdir)
X printf("chmod g+w %s.\n",systm_mbox);
X }
X return EX_OK;
X}
END_OF_FILE
if test 1932 -ne `wc -c <'procmail/src/recommend.c'`; then
echo shar: \"'procmail/src/recommend.c'\" unpacked with wrong size!
fi
# end of 'procmail/src/recommend.c'
fi
echo shar: End of archive 2 \(of 11\).
cp /dev/null ark2isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 11 archives.
rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0
--
Sincerely, berg@pool.informatik.rwth-aachen.de
Stephen R. van den Berg (AKA BuGless). berg@physik.tu-muenchen.de
"Always look on the bright side of life!"
exit 0 # Just in case...