home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-02-04 | 46.1 KB | 1,361 lines |
- Newsgroups: comp.sources.misc
- From: berg@pool.informatik.rwth-aachen.de (Stephen R. van den Berg)
- Subject: v35i023: procmail - mail processing package v2.80, Part02/11
- Message-ID: <1993Feb5.015746.15848@sparky.imd.sterling.com>
- X-Md4-Signature: e6fab919eb9554550f4835ab82023e8e
- Date: Fri, 5 Feb 1993 01:57:46 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: berg@pool.informatik.rwth-aachen.de (Stephen R. van den Berg)
- Posting-number: Volume 35, Issue 23
- Archive-name: procmail/part02
- Environment: sendmail, smail, MMDF, mailsurr, UNIX, POSIX
- Supersedes: procmail: Volume 31, Issue 40-44
-
- #! /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: procmail280/FEATURES procmail280/Makefile
- # procmail280/Manifest procmail280/examples/2procmailrc
- # procmail280/mailinglist/INSTALL
- # procmail280/mailinglist/bin/arch_retrieve
- # procmail280/mailinglist/bin/subscribe
- # procmail280/mailinglist/etc/help.txt
- # procmail280/mailinglist/etc/rc.submit
- # procmail280/mailinglist/install.sh procmail280/src/common.c
- # procmail280/src/cstdio.c procmail280/src/exopen.c
- # procmail280/src/procmail.h procmail280/src/sublib.c
- # Wrapped by berg@hathi on Thu Feb 4 15:27:57 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'procmail280/FEATURES' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail280/FEATURES'\"
- else
- echo shar: Extracting \"'procmail280/FEATURES'\" \(3412 characters\)
- sed "s/^X//" >'procmail280/FEATURES' <<'END_OF_FILE'
- XFeature summary for procmail:
- X + It's less filling (i.e. small)
- X + Very easy to install (rated PG6 :-)
- X + Simple to maintain and configure because
- X all you need is actually only ONE executable (procmail)
- X and ONE configuration file (.procmailrc)
- X + Is event driven (i.e. gets invoked automagically when mail arrives)
- X + Does not use *any* temporary files
- X + Uses standard egrep regular expressions
- X + It poses a very low impact on your system's resources
- X + Allows for very-easy-to-use yes-no decisions on where the mail
- X should go (can take the size of the mail into consideration)
- X + Filters, delivers and forwards mail *reliably*
- X + Provides a reliable hook (you might even say anchor :-) for any
- X programs or shell scripts you may wish to start upon mail arrival
- X + Performs heroically under even the worst conditions
- X (file system full, out of swap space, process table full,
- X file table full, missing support files, unavailable executables,
- X denied permissions) and tries to deliver the mail somehow anyway
- X + Absolutely undeliverable mail (after trying every trick in the book)
- X will bounce back to the sender (or not, your choice)
- X + Is one of the few mailers to perform reliable mailbox locking across
- X NFS as well (DON'T use NFS mounted mailboxes WITHOUT installing
- X procmail; you may lose valuable mail one day)
- X + Supports four mailfolder standards: single file folders (standard
- X and nonstandard VNIX format), directory folders that contain one file
- X per message, or the similar MH directory folders (numbered files)
- X + Variable assignment and substitution is an extremely complete subset
- X of the standard /bin/sh syntax
- X + Provides a mail log file, which logs all mail arrival, shows
- X in summary whence it came from, what it was about, where it went
- X (what folder) and how long (in bytes) it was
- X + Uses this log file to display a wide range of diagnostic and error
- X messages (if something went wrong)
- X + Does not impose *any* limits on line lenghts, mail length (as long
- X as memory permits), or the use of any character (any 8-bit character,
- X including '\0' is allowed) in the mail
- X + It has man pages (boy, does *it* have man pages)
- X + Procmail can be used as a local delivery agent with comsat/biff
- X support (*fully* downwards compatible with /bin/mail); in which case
- X it can heal your system mailbox, if something messes up the
- X permissions
- X + Allows you to painlessly shift the system mailboxes into the
- X user's home directories
- X + It runs on virtually all (old and future) operating systems which
- X names start with a 'U' or end in an 'X' :-) (i.e. extremely portable
- X code; POSIX, ANSI C and K&R conforming)
- X + Is clock skew immune (e.g. in the case of NFS mounted mailboxes)
- X + Works with (among others?) sendmail, smail, MMDF and mailsurr
- X
- XFeature summary for formail:
- X + Can generate auto-reply headers
- X + Can convert mail into standard mailbox format (so that you can
- X process it with standard mail programs)
- X + Can split up mailboxes into the individual messages
- X + Can split up digests into the individual messages
- X + Can split up saved articles into the individual articles
- X + Can do simple header munging/extraction
- X
- XFeature summary for lockfile:
- X + Provides NFS-secure lockfiles to shell script programmers
- X + Gives normal users the ability to lock their system mailbox,
- X regardless of the permissions on the mail-spool directory
- END_OF_FILE
- if test 3412 -ne `wc -c <'procmail280/FEATURES'`; then
- echo shar: \"'procmail280/FEATURES'\" unpacked with wrong size!
- fi
- # end of 'procmail280/FEATURES'
- fi
- if test -f 'procmail280/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail280/Makefile'\"
- else
- echo shar: Extracting \"'procmail280/Makefile'\" \(2842 characters\)
- sed "s/^X//" >'procmail280/Makefile' <<'END_OF_FILE'
- X#$Id: Makefile,v 1.17 1993/01/28 14:21:47 berg Exp $
- X
- X# change BASENAME to your home directory if need be
- XBASENAME = /usr/local
- X
- X# You can predefine ARCHITECTURE to a bin directory suffix
- X#ARCHITECTURE=.sun4
- X
- XBINDIR = $(BASENAME)/bin$(ARCHITECTURE)
- XMANDIR = $(BASENAME)/man
- X# MAN1SUFFIX for regular utility manuals
- XMAN1SUFFIX= 1
- X# MAN5SUFFIX for file-format descriptions
- XMAN5SUFFIX= 5
- XMAN1DIR = $(MANDIR)/man$(MAN1SUFFIX)
- XMAN5DIR = $(MANDIR)/man$(MAN5SUFFIX)
- X
- X# Things that can be made are:
- X
- X# init (or makefiles) Performs some preliminary sanity checks on your system
- X# and generates Makefiles accordingly
- X# bins Preinstalls only the binaries to ./new
- X# mans Preinstalls only the man pages to ./new
- X# all Does both
- X# install.bin Installs the binaries from ./new to $(BINDIR)
- X# install.man Installs the man pages from ./new to $(MAN[15]DIR)
- X# install Does both
- X# recommend Show some recommended suid/sgid modes
- X# suid Impose the modes shown by 'make recommend'
- X# clean Attempts to restore the package to pre-make state
- X# realclean Attempts to restore the package to pre-make-init state
- X# deinstall Removes any previously installed binaries and man
- X# pages from your system by careful surgery
- X# autoconf.h Will list your system's anomalies
- X# procmail Preinstalls just all procmail related stuff to ./new
- X# formail Preinstalls just all formail related stuff to ./new
- X# lockfile Preinstalls just all lockfile related stuff to ./new
- X
- X########################################################################
- X# Only edit below this line if you *think* you know what you are doing #
- X########################################################################
- X
- X# Makefile.0 - mark, don't (re)move this, a sed script needs it
- X
- X# Directory for the system include files
- XUSRINCLUDE = /usr/include
- X# Paths for system libraries
- XLIBPATHS = /lib /usr/lib /usr/local/lib /lib/386
- X
- XCFLAGS0 = -O #-ansi -pedantic #-Wid-clash-6
- XLDFLAGS0= -s
- X
- XCFLAGS1 = $(CFLAGS0) #-posix -Xp
- XLDFLAGS1= $(LDFLAGS0) #-lcposix
- X
- X####CC = cc # gcc
- X# object file extension
- XO = o
- XRM = /bin/rm -f
- XMV = mv -f
- XLN = ln -f
- XBSHELL = /bin/sh
- XINSTALL = cp
- XDEVNULL = /dev/null
- X
- XSUBDIRS = src man
- XBINSS = procmail lockfile formail mailstat
- XMANS1S = procmail formail lockfile
- XMANS5S = procmailrc procmailex
- X
- X# Makefile - mark, don't (re)move this, a sed script needs it
- X
- XHIDEMAKE=$(MAKE)
- X
- Xall: init
- X $(HIDEMAKE) make $@
- X
- Xmake:
- X @$(BSHELL) -c "exit 0"
- X
- Xinit:
- X $(BSHELL) ./initmake $(BSHELL) "$(SHELL)" "$(RM)" "$(MV)" "$(LN)" \
- X $(USRINCLUDE) "$(LIBPATHS)" $(DEVNULL) "$(HIDEMAKE)" $(O) \
- X "$(CC)" "$(CFLAGS1)" "$(LDFLAGS1)" "$(BINSS)" \
- X "$(MANS1S)" "$(MANS5S)" "$(SUBDIRS)"
- X
- Xmakefiles makefile Makefiles Makefile: init
- X
- Xbins mans install.bin install.man install recommend suid clean realclean \
- Xdeinstall autoconf.h $(BINSS) multigram: init
- X $(HIDEMAKE) make $@
- END_OF_FILE
- if test 2842 -ne `wc -c <'procmail280/Makefile'`; then
- echo shar: \"'procmail280/Makefile'\" unpacked with wrong size!
- fi
- # end of 'procmail280/Makefile'
- fi
- if test -f 'procmail280/Manifest' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail280/Manifest'\"
- else
- echo shar: Extracting \"'procmail280/Manifest'\" \(2022 characters\)
- sed "s/^X//" >'procmail280/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/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 2022 -ne `wc -c <'procmail280/Manifest'`; then
- echo shar: \"'procmail280/Manifest'\" unpacked with wrong size!
- fi
- # end of 'procmail280/Manifest'
- fi
- if test -f 'procmail280/examples/2procmailrc' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail280/examples/2procmailrc'\"
- else
- echo shar: Extracting \"'procmail280/examples/2procmailrc'\" \(1971 characters\)
- sed "s/^X//" >'procmail280/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:
- 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::
- 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:: # 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:: # 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:: # 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::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 1971 -ne `wc -c <'procmail280/examples/2procmailrc'`; then
- echo shar: \"'procmail280/examples/2procmailrc'\" unpacked with wrong size!
- fi
- # end of 'procmail280/examples/2procmailrc'
- fi
- if test -f 'procmail280/mailinglist/INSTALL' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail280/mailinglist/INSTALL'\"
- else
- echo shar: Extracting \"'procmail280/mailinglist/INSTALL'\" \(2630 characters\)
- sed "s/^X//" >'procmail280/mailinglist/INSTALL' <<'END_OF_FILE'
- XBefore you start installing mailinglists there are some things you should
- Xconsider:
- X
- X- In order to make sure that the mailinglist scripts work reliably for both
- Xremote and local mail, they have to be run under someone's account.
- XThe recommended procedure would be to create a new account and group named
- X"list" that is only going to be used to manage the mailinglist stuff.
- X
- X- If you are unable/unwilling to create a new user just for the mailinglist
- Xstuff, then the mailinglist scripts should be installed in a separate
- Xsubdirectory. This user will still be able to receive regular mail.
- X
- X- In the mailinglist scripts I made use of the -f option of sendmail. This
- Xoption makes sure that the sender address on the envelope (the From_ line)
- Xcontains the proper list address. In order for this option to work, the
- Xuser using it (either "list" or the regular user the lists run under) must
- Xbe on the trusted-user-list of sendmail. To enter the user "list" on the
- Xtrusted-user-list simply edit the sendmail.cf file and add a line reading:
- X
- XTlist
- X
- XRestarting sendmail is not necessary.
- X
- X
- XNow, back to installing the mailinglist scripts:
- X
- XSuppose you have created this pseudo user "list" and its home directory would
- Xbe /home/list
- XSimply execute the "install.sh" script (preferably as user "list") present in
- Xthis directory by typing something like:
- X
- X sh install.sh /home/list
- X
- XThis script will then create two subdirectories (.bin and .etc) in
- X/home/list. These directories will be filled with the files contained
- Xin the bin and etc subdirectories here. It will also make sure that
- Xthe "multigram" program is compiled from the procmail*/src directory and
- Xcopied into /home/list/.bin. Furthermore it will link
- X/home/list/.etc/rc.main to /home/list/.procmailrc. The latter is of
- Xcourse superfluous if you are still using this account to receive
- Xregular mail.
- X
- XDepending on your mail configuration, if procmail has not been integrated
- Xin the maildelivery system (see procmail*/examples/advanced for more
- Xinformation on that topic) you also have to create a .forward file with an
- Xappropriate content (see "man procmail", the NOTES section at the end). This,
- Xhowever, is only necessary if you created a seperate "list" account.
- X
- X Next, edit the /home/list/.etc/rc.init file. Make sure that
- X "domain" is set to the right value, and you can optionally specify a
- X "listmaster"; also check if the PATH is correct and make sure
- X that the procmail and formail are in the path.
- X
- XFor further instructions, you should read the "Manual" file, it has
- Xbeen copied to the /home/list/.etc directory as well, and can serve as a
- Xquick reference.
- END_OF_FILE
- if test 2630 -ne `wc -c <'procmail280/mailinglist/INSTALL'`; then
- echo shar: \"'procmail280/mailinglist/INSTALL'\" unpacked with wrong size!
- fi
- # end of 'procmail280/mailinglist/INSTALL'
- fi
- if test -f 'procmail280/mailinglist/bin/arch_retrieve' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail280/mailinglist/bin/arch_retrieve'\"
- else
- echo shar: Extracting \"'procmail280/mailinglist/bin/arch_retrieve'\" \(2855 characters\)
- sed "s/^X//" >'procmail280/mailinglist/bin/arch_retrieve' <<'END_OF_FILE'
- X#! /bin/sh
- X: &&O= || exec /bin/sh $0 $argv:q # we're in a csh, feed myself to sh
- X#$Id: arch_retrieve,v 1.6 1993/02/02 15:26:48 berg Exp $
- X
- Xtest=test # /bin/test
- Xecho=echo # /bin/echo
- Xls=ls # /bin/ls
- Xsed=sed # /bin/sed
- Xcat=cat # /bin/cat
- Xformail=formail # /usr/local/bin/formail
- 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
- X
- Xcd archive
- X
- Xfrom=`$echo "arch_retrieve:" \`$cat $tmpfrom\` requested`
- X$cat /dev/null >$tmpfrom
- X
- X$formail -k -xSubject: |
- X $sed -e '/^--/,$ d' -e 's/^[ ]*archive[ ]//' \
- X -e 's/[ ]archive\/*/ /g' |
- X ( sendhelp=no
- X while read line
- X do
- X set dummy $line
- X shift
- X case "$1" in
- X send|sendme|get|getme|gimme|retrieve|mail|\
- X SEND|SENDME|GET|GETME|GIMME|RETRIEVE|MAIL)
- X while shift; $test $# != 0
- X do
- X $echo $from "$1" >>$tmpfrom
- X case "$1" in
- X */../*|../*|*/..|..|[-/]*) ;;
- X *)
- X ( $formail -rt -I"Subject: archive retrieval: $1" \
- X -i"From: $listreq" -A"X-Loop: $listaddr" \
- X -I"Precedence: bulk" <$tmprequest
- X if $test -f "./$1"
- X then
- X $echo "File: $1"
- X $echo "BEGIN---------------cut here------------------"
- X $cat "./$1"
- X $echo "END-----------------cut here------------------"
- X else
- X $echo "File $1 is not available."
- X fi
- X ) | $SENDMAIL $sendmailOPT -t ;;
- X esac
- X done ;;
- X ls|dir|directory|list|show|\
- X LS|DIR|DIRECTORY|LIST|SHOW)
- X $test $# = 1 && set dummy .
- X while shift; $test $# != 0
- X do
- X $echo $from "$1" ls >>$tmpfrom
- X case "$1" in
- X */../*|../*|*/..|..|[-/]*) ;;
- X *)
- X ( $formail -rt -I"Subject: archive retrieval: ls $1" \
- X -i"From: $listreq" -A"X-Loop: $listaddr" \
- X -I"Precedence: bulk" <$tmprequest
- X if $test -r "./$1"
- X then
- X $echo "ls -l $1"
- X $echo "BEGIN---------------cut here------------------"
- X $ls -lL "./$1" 2>/dev/null || $ls -l "./$1"
- X $echo "END-----------------cut here------------------"
- X else
- X $echo "File or directory $1 is not available."
- X fi
- X ) | $SENDMAIL $sendmailOPT -t ;;
- X esac
- X done ;;
- X "") ;;
- X *) sendhelp=yes ;;
- X esac
- X done
- X if $test yes = $sendhelp
- X then
- X ( $formail -rt -I"Subject: archive retrieval: ls $1" \
- X -i"From: $listreq" -A"X-Loop: $listaddr" -I"Precedence: bulk" \
- X <$tmprequest
- X $echo "This archive server knows the following commands:"
- X $echo ""
- X $echo "get filename ..."
- X $echo "ls directory ..."
- X $echo ""
- X $echo "Aliases for 'get': send, sendme, getme, gimme, retrieve, mail"
- X $echo "Aliases for 'ls': dir, directory, list, show"
- X $echo ""
- X $echo "Examples:"
- X $echo "ls latest"
- X $echo "get latest/12"
- X ) | $SENDMAIL $sendmailOPT -t
- X fi
- X )
- X
- Xif $test ! -z "$archive_log"
- Xthen
- X $cat $tmpfrom >>../$archive_log
- Xfi
- END_OF_FILE
- if test 2855 -ne `wc -c <'procmail280/mailinglist/bin/arch_retrieve'`; then
- echo shar: \"'procmail280/mailinglist/bin/arch_retrieve'\" unpacked with wrong size!
- fi
- chmod +x 'procmail280/mailinglist/bin/arch_retrieve'
- # end of 'procmail280/mailinglist/bin/arch_retrieve'
- fi
- if test -f 'procmail280/mailinglist/bin/subscribe' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail280/mailinglist/bin/subscribe'\"
- else
- echo shar: Extracting \"'procmail280/mailinglist/bin/subscribe'\" \(2000 characters\)
- sed "s/^X//" >'procmail280/mailinglist/bin/subscribe' <<'END_OF_FILE'
- X#! /bin/sh
- X: &&O= || exec /bin/sh $0 $argv:q # we're in a csh, feed myself to sh
- X#$Id: subscribe,v 1.7 1993/02/02 16:54:12 berg Exp $
- X
- Xtest=test # /bin/test
- Xecho=echo # /bin/echo
- Xcat=cat # /bin/cat
- Xsed=sed # /bin/sed
- Xgrep=grep # /bin/grep
- Xformail=formail # /usr/local/bin/formail
- Xmultigram=multigram # ../.bin/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
- Xsubscribetxt=subscribe.txt
- X
- Xsubscraddr=""
- X
- Xaddress=`$formail -k -xSubject: |
- X $sed -n \
- X -e 's/^[ ]*[aA][dD][dD][ ]*'\
- X'[^ ]*[ ]\([^ ][^ ]*[@!][^ ][^ ]*\)/\1/p' \
- X -e 's/^[ ]*[aA][dD][dD][rR][eE][sS][sS][ ]*'\
- X'[^ ]*[ ]\([^ ][^ ]*[@!][^ ][^ ]*\)/\1/p' \
- X -e 's/^[ ]*[sS][uU][bB][ ]*'\
- X'[^ ]*[ ]\([^ ][^ ]*[@!][^ ][^ ]*\)/\1/p' \
- X -e 's/^[ ]*[sS][uU][bB][sS][cC][rR][iI][bB][eE][ ]*'\
- X'[^ ]*[ ]\([^ ][^ ]*[@!][^ ][^ ]*\)/\1/p' `
- X
- Xfor a in $address ""
- Xdo
- X $test -z "$subscraddr" && subscraddr=$a
- Xdone
- X
- Xif $test -z "$subscraddr"
- Xthen
- X address=`$formail -k -xSubject: <$tmprequest |
- X $multigram -b1 -l$off_threshold $tmpfrom |
- X $sed -e 's/^ *[^ ]* *[^ ]* *[^ ]* *\([^ ]*\)/\1/' `
- X
- X for a in $address ""
- X do
- X $test -z "$subscraddr" && subscraddr=$a
- X done
- X
- X $test -z "$subscraddr" && subscraddr=`$cat $tmpfrom`
- Xfi
- X
- XNOT_METOO=""
- X
- X$formail -k -xSubject: <$tmprequest |
- X $grep 'no.*[^a-z]cop.*[^a-z]please' >/dev/null && NOT_METOO=" (-n)"
- X
- X$multigram -a "$subscraddr$NOT_METOO" dist >/dev/null
- X
- X$formail -i"From: $listreq" -rtA"X-Loop: $listaddr" -I"Precedence: bulk" \
- X <$tmprequest
- X
- X$echo "You have added to the subscriber list of:"
- X$echo
- X$echo " $listaddr"
- X$echo
- X$echo "the following mail address:"
- X$echo
- X$echo " $subscraddr"
- X$echo
- Xif $test -z "$NOT_METOO"
- Xthen
- X $echo "By default, copies of your own submissions will be returned."
- Xelse
- X $echo "As requested, copies of your own submissions will not be returned."
- Xfi
- X$echo
- X
- X$cat $subscribetxt
- X
- X$sed -e 's/^\(.\)/>\1/' $tmprequest
- END_OF_FILE
- if test 2000 -ne `wc -c <'procmail280/mailinglist/bin/subscribe'`; then
- echo shar: \"'procmail280/mailinglist/bin/subscribe'\" unpacked with wrong size!
- fi
- chmod +x 'procmail280/mailinglist/bin/subscribe'
- # end of 'procmail280/mailinglist/bin/subscribe'
- fi
- if test -f 'procmail280/mailinglist/etc/help.txt' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail280/mailinglist/etc/help.txt'\"
- else
- echo shar: Extracting \"'procmail280/mailinglist/etc/help.txt'\" \(1970 characters\)
- sed "s/^X//" >'procmail280/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 "archive help" as a Subject:.
- X--
- END_OF_FILE
- if test 1970 -ne `wc -c <'procmail280/mailinglist/etc/help.txt'`; then
- echo shar: \"'procmail280/mailinglist/etc/help.txt'\" unpacked with wrong size!
- fi
- # end of 'procmail280/mailinglist/etc/help.txt'
- fi
- if test -f 'procmail280/mailinglist/etc/rc.submit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail280/mailinglist/etc/rc.submit'\"
- else
- echo shar: Extracting \"'procmail280/mailinglist/etc/rc.submit'\" \(2772 characters\)
- sed "s/^X//" >'procmail280/mailinglist/etc/rc.submit' <<'END_OF_FILE'
- X# BEFORE editing this file, you should make sure that it is not linked to
- X# the master version (../.listadmin/listrc.sub) anymore (i.e. make a copy).
- X# If the mailinglist is not in active use yet, or if you want to take the
- X# chance, you can write out this file without locking. To do it properly
- X# you should create the ../.listadmin/the_lists.lock file with lockfile(1)
- X# shortly before writing out the new version of this file (remove the lockfile
- X# afterwards of course)
- X
- X#$Id: rc.submit,v 1.10 1993/02/02 15:26:59 berg Exp $
- X
- XINCLUDERC=$RC_INIT
- XINCLUDERC=$RC_CUSTOM
- X
- X#
- X# The following recipe makes sure that:
- X# The mail was not sent to the request address.
- X# It does not look like an administrative request.
- X# It wasn't sent by this list itself.
- X# It wasn't sent by a daemon (misdirected bounce message perhaps).
- X# Then check to see if sender is a subscriber of this mailinglist, and while
- X# doing so, also check if this subscriber wants to receive copies.
- X#
- X
- X:6Wh
- X < $size_limit
- X $!^$X_COMMAND:
- X !^TO.*-request
- X !^Subject:( *(help|info) *$|.*( \
- X (add .* to|remove .* from|take .* off|put .* on) .* list|subscri(be|ption))
- X $!^X-Loop: $listaddr
- X $!$FROM_MAILER_DAEMON
- XMETOO= | formail -X"From " -xFrom: -xReply-To: -xSender: -xResent-From: \
- X -xResent-Reply-To: -xResent-Sender: -xResent-From: | \
- X multigram -b1 -m -l$submit_threshold dist
- X
- X#
- X# Check if we are the first mailinglist to distribute this message, if so
- X# archive the message.
- X#
- X
- X :1A c
- X !^X-Mailing-List:
- X archive/latest/.
- X
- X#
- X# Truncate the archive to the correct number of files (and possibly other
- X# housekeeping chores to keep the archive current).
- X#
- X
- X :1A c
- X !^X-Mailing-List:
- X ARCHIVE=| arch_trunc "$-"
- X
- X#
- X# Main header munger for submissions passing through this list.
- X#
- X
- X : A wfh
- X | formail -b -IReceived: -IReturn-Receipt-To: -IErrors-To: \
- X -iReturn-Path: -iX-Envelope-To: -iX-Envelope-From: \
- X -I"Precedence: list" -I"Resent-Sender: $listreq" \
- X -a"Resent-From: $listaddr" -A"X-Loop: $listaddr" \
- X -a"Subject: Unidentified subject!" \
- X -a"X-Mailing-List: <$listaddr> $ARCHIVE"
- X
- X#
- X# The following recipe will distribute the message to the subscribers.
- X# Note that there are several possibilities, the first one listed here is
- X# the cleanest one, but it has the disadvantage that the $listdist alias
- X# is accessible to the outside world (can be queried and mailed to directly).
- X#
- X
- X :1A w: dist.lock
- X !? test -z "$foreign_submit$METOO"
- X ! $sendmailOPT $METOO $listdist
- X #! $sendmailOPT $METOO `cat dist` ;
- X # alternate sendmail call
- X
- Xresult=$?
- X
- X :1Awfh
- X ? test 0 != $result
- X | formail -A "X-Diagnostic: $SENDMAIL $listdist failed"
- X
- X :1Awfh
- X ? test -z "$foreign_submit$METOO"
- X | formail -A "X-Diagnostic: Not on the subscriber list"
- X
- XHOST=continue_with_rc.request
- END_OF_FILE
- if test 2772 -ne `wc -c <'procmail280/mailinglist/etc/rc.submit'`; then
- echo shar: \"'procmail280/mailinglist/etc/rc.submit'\" unpacked with wrong size!
- fi
- # end of 'procmail280/mailinglist/etc/rc.submit'
- fi
- if test -f 'procmail280/mailinglist/install.sh' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail280/mailinglist/install.sh'\"
- else
- echo shar: Extracting \"'procmail280/mailinglist/install.sh'\" \(1852 characters\)
- sed "s/^X//" >'procmail280/mailinglist/install.sh' <<'END_OF_FILE'
- X#! /bin/sh
- X: &&O= || exec /bin/sh $0 $argv:q # we're in a csh, feed myself to sh
- X#$Id: install.sh,v 1.10 1993/01/28 14:21:59 berg Exp $
- X
- Xtest $# != 1 && echo "Usage: install.sh target-directory" && exit 1
- X
- Xtarget="$1"
- X
- Xtest ! -d "$target" && echo "Please create the target directory first" &&
- X exit 2
- X
- XFRAGILE="rc.init "
- XDIRS="bin 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 Installing...
- X
- Xfor a in $DIRS
- Xdo
- X mkdir "$target/.$a" 2>/dev/null
- X cp $a/* "$target/.$a"
- 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
- Xcp Manual "$target/.etc"
- Xmv -f "$target/.bin/procmail" "$target/.bin/.procmail" 2>/dev/null
- Xchmod 0755 $target/.bin/*
- Xmv -f "$target/.bin/.procmail" "$target/.bin/procmail" 2>/dev/null
- X
- Xfor a in $DIRS
- Xdo
- X ls -ld "$target/.$a" $target/.$a/*
- Xdone
- X
- Xcd ../src
- Xtest -f multigram || make multigram
- Xcp multigram "$target/.bin"
- Xcd ../mailinglist
- X
- Xln -f "$target/.bin/multigram" "$target/.bin/idhash" 2>/dev/null
- Xln -f "$target/.bin/multigram" "$target/.bin/flist" 2>/dev/null
- Xchmod 04755 "$target/.bin/flist"
- Xls -l "$target/.bin/multigram" "$target/.bin/idhash" "$target/.bin/flist"
- X
- Xecho Creating link from .etc/rc.main to .procmailrc
- Xrm -f "$target/.procmailrc"
- Xln "$target/.etc/rc.main" "$target/.procmailrc"
- X
- Xecho '**********************************************************************'
- Xecho "Finished installing, now you should"
- Xecho "edit $target/.etc/rc.init to make sure"
- Xecho "that \`PATH', \`domain' and \`listmaster' reflect your installation."
- Xecho '**********************************************************************'
- END_OF_FILE
- if test 1852 -ne `wc -c <'procmail280/mailinglist/install.sh'`; then
- echo shar: \"'procmail280/mailinglist/install.sh'\" unpacked with wrong size!
- fi
- chmod +x 'procmail280/mailinglist/install.sh'
- # end of 'procmail280/mailinglist/install.sh'
- fi
- if test -f 'procmail280/src/common.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail280/src/common.c'\"
- else
- echo shar: Extracting \"'procmail280/src/common.c'\" \(2278 characters\)
- sed "s/^X//" >'procmail280/src/common.c' <<'END_OF_FILE'
- X/************************************************************************
- X * Some common routines for procmail and formail *
- 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: common.c,v 1.11 1992/11/13 12:57:58 berg Exp $";
- X#endif
- X#include "procmail.h"
- X#include "sublib.h"
- X#include "robust.h"
- X#include "shell.h"
- X#include "misc.h"
- X#include "common.h"
- X
- Xvoid shexec(argv)const char*const*argv;
- X{ int i;char**newargv;const char**p;
- X#ifdef SIGXCPU
- X signal(SIGXCPU,SIG_DFL);signal(SIGXFSZ,SIG_DFL);
- X#endif
- X#ifdef SIGLOST
- X signal(SIGLOST,SIG_DFL);
- X#endif /* or is it a shell script ? */
- X signal(SIGPIPE,SIG_DFL);execvp(*argv,(char*const*)argv);
- X for(p=(const char**)argv,i=1;i++,*p++;); /* count the arguments */
- X newargv=malloc(i*sizeof*p);
- X for(*(p=(const char**)newargv)=binsh;*++p= *argv++;);
- X execve(*newargv,newargv,environ); /* no shell script? -> trouble */
- X nlog("Failed to execute");logqnl(*argv);exit(EX_UNAVAILABLE);
- X}
- X
- Xvoid detab(p)char*p;
- X{ while(p=strpbrk(p,"\t\n\v\f\r"))
- X *p=' '; /* take out all tabs and other specials */
- X}
- X
- Xchar*pstrspn(whole,sub)const char*whole,*const sub;
- X{ while(*whole&&strchr(sub,*whole))
- X whole++;
- X return(char*)whole;
- X}
- X
- X#ifdef NOstrcspn
- Xstrcspn(whole,sub)const char*const whole,*const sub;
- X{ const register char*p;
- X p=whole;
- X while(*p&&!strchr(sub,*p))
- X p++;
- X return p-whole;
- X}
- X#endif
- X
- Xvoid ultstr(minwidth,val,dest)unsigned long val;char*dest;
- X{ int i;unsigned long j;
- X j=val;i=0; /* a beauty, isn't it :-) */
- X do i++; /* determine needed width */
- X while(j/=10);
- X while(--minwidth>=i) /* fill up any excess width */
- X *dest++=' ';
- X *(dest+=i)='\0';
- X do *--dest='0'+val%10; /* display value backwards */
- X while(val/=10);
- X}
- X
- XstrnIcmp(a,b,l)register const char*a,*b;register size_t l;
- X{ unsigned i,j;
- X if(l) /* case insensitive strncmp */
- X do
- X { while(*a&&*a==*b&&--l)
- X a++,b++;
- X if(!l)
- X break;
- X if((i= *a++)-'A'<='Z'-'A')
- X i+='a'-'A';
- X if((j= *b++)-'A'<='Z'-'A')
- X j+='a'-'A';
- X if(j!=i)
- X return i>j?1:-1;
- X }
- X while(i&&j&&--l);
- X return 0;
- X}
- END_OF_FILE
- if test 2278 -ne `wc -c <'procmail280/src/common.c'`; then
- echo shar: \"'procmail280/src/common.c'\" unpacked with wrong size!
- fi
- # end of 'procmail280/src/common.c'
- fi
- if test -f 'procmail280/src/cstdio.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail280/src/cstdio.c'\"
- else
- echo shar: Extracting \"'procmail280/src/cstdio.c'\" \(2847 characters\)
- sed "s/^X//" >'procmail280/src/cstdio.c' <<'END_OF_FILE'
- X/************************************************************************
- X * Custom standard-io library *
- 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: cstdio.c,v 1.12 1993/01/13 15:20:46 berg Exp $";
- X#endif
- X#include "procmail.h"
- X#include "robust.h"
- X#include "cstdio.h"
- X#include "misc.h"
- X
- Xstatic uchar rcbuf[STDBUF],*rcbufp,*rcbufend; /* buffers for custom stdio */
- Xstatic long blasttell;
- Xstatic struct dyna_long inced; /* includerc stack */
- X
- Xvoid pushrc(name)const char*const name; /* open include rcfile */
- X{ struct stat stbuf; /* only if size>0 */
- X if(*name&&(stat(name,&stbuf)||!S_ISREG(stbuf.st_mode)||stbuf.st_size))
- X { app_val(&inced,rcbufp?(long)(rcbufp-rcbuf):0L);app_val(&inced,blasttell);
- X app_val(&inced,(long)rc); /* save old position and fd */
- X if(bopen(name)<0) /* and try to open the new one */
- X readerr(name),poprc(); /* we couldn't, so restore rc */
- X }
- X}
- X
- Xpoprc P((void))
- X{ rclose(rc); /* close it in any case */
- X if(!inced.filled) /* include stack is empty? */
- X return 0; /* restore rc, seekpos, prime rcbuf and restore rcbufp */
- X rc=inced.offs[--inced.filled];lseek(rc,inced.offs[--inced.filled],SEEK_SET);
- X rcbufp=rcbufend;getb();rcbufp=rcbuf+inced.offs[--inced.filled];return 1;
- X}
- X
- Xvoid closerc P((void)) /* {while(poprc());} */
- X{ while(rclose(rc),inced.filled)
- X rc=inced.offs[inced.filled-1],inced.filled-=3;
- X}
- X
- Xbopen(name)const char*const name; /* my fopen */
- X{ rcbufp=rcbufend=0;return rc=ropen(name,O_RDONLY,0);
- X}
- X
- Xgetbl(p)char*p; /* my gets */
- X{ int i;char*q;
- X for(q=p;;)
- X { switch(i=getb())
- X { case '\n':case EOF:
- X *q='\0';return p!=q; /* did we read anything at all? */
- X }
- X *q++=i;
- X }
- X}
- X
- Xgetb P((void)) /* my fgetc */
- X{ if(rcbufp==rcbufend) /* refill */
- X blasttell=tell(rc),rcbufend=rcbuf+rread(rc,rcbufp=rcbuf,STDBUF);
- X return rcbufp<rcbufend?*rcbufp++:EOF;
- X}
- X
- Xvoid ungetb(x)const int x; /* only for pushing back original characters */
- X{ if(x!=EOF)
- X rcbufp--; /* backup */
- X}
- X
- Xtestb(x)const int x; /* fgetc that only succeeds if it matches */
- X{ int i;
- X if((i=getb())==x)
- X return 1;
- X ungetb(i);return 0;
- X}
- X
- Xsgetc P((void)) /* a fake fgetc for a string */
- X{ return *sgetcp?*(uchar*)sgetcp++:EOF;
- X}
- X
- Xskipspace P((void))
- X{ int any=0;
- X while(testb(' ')||testb('\t'))
- X any=1;
- X return any;
- X}
- X
- Xvoid getlline(target)char*target;
- X{ char*chp2;
- X for(;getbl(chp2=target)&&*(target=strchr(target,'\0')-1)=='\\';
- X *target++='\n') /* read line-wise */
- X if(chp2!=target) /* non-empty line? */
- X target++; /* then preserve the backslash */
- X}
- END_OF_FILE
- if test 2847 -ne `wc -c <'procmail280/src/cstdio.c'`; then
- echo shar: \"'procmail280/src/cstdio.c'\" unpacked with wrong size!
- fi
- # end of 'procmail280/src/cstdio.c'
- fi
- if test -f 'procmail280/src/exopen.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail280/src/exopen.c'\"
- else
- echo shar: Extracting \"'procmail280/src/exopen.c'\" \(2044 characters\)
- sed "s/^X//" >'procmail280/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.9 1992/11/13 11:19:52 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<<bitsSERIAL-mrotbSERIAL)+
- X (unsigned long)thepid,p+1);
- X *p=UNIQ_PREFIX;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 2044 -ne `wc -c <'procmail280/src/exopen.c'`; then
- echo shar: \"'procmail280/src/exopen.c'\" unpacked with wrong size!
- fi
- # end of 'procmail280/src/exopen.c'
- fi
- if test -f 'procmail280/src/procmail.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail280/src/procmail.h'\"
- else
- echo shar: Extracting \"'procmail280/src/procmail.h'\" \(2066 characters\)
- sed "s/^X//" >'procmail280/src/procmail.h' <<'END_OF_FILE'
- X/*$Id: procmail.h,v 1.8 1993/01/13 16:17:29 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
- Xstruct dyna_long{size_t filled,tspace;long*offs;};
- X
- Xint
- X eqFrom_ P((const char*const a));
- X
- Xextern char*buf,*buf2,*globlock,*loclock,*tolock,*lastfolder,*Stdout,*themail,
- X *thebody;
- Xextern const char shellflags[],shell[],lockfile[],lockext[],newline[],binsh[],
- X unexpeof[],shellmetas[],*const*gargv,*sgetcp,*rcfile,dirsep[],msgprefix[],
- X devnull[],lgname[],executing[],oquote[],cquote[],whilstwfor[],procmailn[],
- X Mail[],home[],maildir[];
- Xextern long filled;
- Xextern sh,pwait,retval,retvl2,lcking,rc,ignwerr,lexitcode,asgnlastf;
- 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 2066 -ne `wc -c <'procmail280/src/procmail.h'`; then
- echo shar: \"'procmail280/src/procmail.h'\" unpacked with wrong size!
- fi
- # end of 'procmail280/src/procmail.h'
- fi
- if test -f 'procmail280/src/sublib.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail280/src/sublib.c'\"
- else
- echo shar: Extracting \"'procmail280/src/sublib.c'\" \(2762 characters\)
- sed "s/^X//" >'procmail280/src/sublib.c' <<'END_OF_FILE'
- X/*$Id: sublib.c,v 1.8 1993/01/26 12:30:51 berg Exp $*/
- X#include "includes.h"
- X#include "sublib.h"
- X
- X#ifdef NOmemmove
- Xvoid*smemmove(To,From,count)void*To;const void*From;register size_t count;
- X#ifdef NObcopy /* silly compromise, throw */
- X{ register char*to=To;register const char*from=From;/*void*old;*/
- X /*old=to;*/count++;to--;from--; /* away space to be syntactically correct */
- X if(to<=from)
- X { goto jiasc;
- X do
- X { *++to= *++from; /* copy from above */
- Xjiasc:;
- X }
- X while(--count);
- X }
- X else
- X { to+=count;from+=count;goto jidesc;
- X do
- X { *--to= *--from; /* copy from below */
- Xjidesc:;
- X }
- X while(--count);
- X }
- X return To/*old*/;
- X#else
- X{ bcopy(From,To,count);return To;
- X#endif /* NObcopy */
- X}
- X#endif /* NOmemmove */
- X
- X#include "shell.h"
- X
- X#ifdef NOstrpbrk
- Xchar*strpbrk(st,del)const char*const st,*del;
- X{ const char*f=0,*t;
- X for(f=0;*del;)
- X if((t=strchr(st,*del++))&&(!f||t<f))
- X f=t;
- X return(char*)f;
- X}
- X#endif
- X
- X#ifdef NOstrstr
- Xchar*strstr(whole,part)const char*whole,*const part;
- X{ size_t i;const char*end;
- X for(end=strchr(whole,'\0')-(i=strlen(part))+1;--end>=whole;)
- X if(!strncmp(end,part,i))
- X return(char*)end;
- X return 0;
- X}
- X#endif
- X /* strtol replacement which lacks range checking */
- X#ifdef NOstrtol
- Xlong strtol(start,ptr,base)const char*start,**const ptr;
- X{ long result;const char*str=start;unsigned i;int sign,found;
- X if(base>=36||base<(sign=found=result=0))
- X goto fault;
- X for(;;str++) /* skip leading whitespace */
- X { switch(*str)
- X { case '\t':case '\n':case '\v':case '\f':case '\r':case ' ':continue;
- X }
- X break;
- X }
- X switch(*str) /* any signs? */
- X { case '-':sign=1;
- X case '+':str++;
- X }
- X if(*str=='0') /* leading zero(s)? */
- X { start++;
- X if((i= *++str)=='x'||i=='X') /* leading 0x or 0X? */
- X if(!base||base==16)
- X base=16,str++; /* hexadecimal all right */
- X else
- X goto fault;
- X else if(!base)
- X base=8; /* then it is octal */
- X }
- X else if(!base)
- X base=10; /* or else decimal */
- X goto jumpin;
- X do
- X { found=1;result=result*base+i;str++; /* start converting */
- Xjumpin:
- X if((i= *str-'0')<10);
- X else if(i-'A'+'0'<='Z'-'A')
- X i-='A'-10-'0'; /* collating sequence dependency! */
- X else if(i-'a'+'0'<'z'-'a')
- X i-='a'-10-'0'; /* collating sequence dependency! */
- X else
- X break; /* not of this world */
- X }
- X while(i<base); /* still of this world */
- Xfault:
- X if(ptr)
- X *ptr=found?str:start; /* how far did we get */
- X return sign?-result:result;
- X}
- X#else /* NOstrtol */
- X#ifndef NOstrstr
- X#ifndef NOstrpbrk
- X#ifndef NOmemmove
- Xint sublib_dummy_var; /* to prevent insanity in some linkers */
- X#endif
- X#endif
- X#endif
- X#endif /* NOstrtol */
- END_OF_FILE
- if test 2762 -ne `wc -c <'procmail280/src/sublib.c'`; then
- echo shar: \"'procmail280/src/sublib.c'\" unpacked with wrong size!
- fi
- # end of 'procmail280/src/sublib.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
-
- "Be spontaneous!"
-
- exit 0 # Just in case...
-