home *** CD-ROM | disk | FTP | other *** search
- From: berg@pool.informatik.rwth-aachen.de (Stephen R. van den Berg)
- Newsgroups: comp.sources.misc
- Subject: v43i064: procmail - mail processing package v3.03, Part09/10
- Date: 5 Jul 1994 20:50:27 -0500
- Organization: Sterling Software
- Sender: kent@sparky.sterling.com
- Approved: kent@sparky.sterling.com
- Message-ID: <2vd2l3$iek@sparky.sterling.com>
- X-Md4-Signature: c7505ffa2c5a98fad39d9027a7859107
-
- Submitted-by: berg@pool.informatik.rwth-aachen.de (Stephen R. van den Berg)
- Posting-number: Volume 43, Issue 64
- Archive-name: procmail/part09
- Environment: sendmail, ZMailer, smail, MMDF, mailsurr, UNIX, POSIX
- Supersedes: procmail: Volume 38, Issue 19-31
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: procmail-3.03/FEATURES procmail-3.03/Makefile
- # procmail-3.03/Makefile.1 procmail-3.03/Manifest
- # procmail-3.03/SmartList/README procmail-3.03/examples/2procmailrc
- # procmail-3.03/src/common.c procmail-3.03/src/cstdio.c
- # procmail-3.03/src/ecommon.c procmail-3.03/src/exopen.c
- # procmail-3.03/src/fields.c procmail-3.03/src/misc.h
- # procmail-3.03/src/procmail.h procmail-3.03/src/recommend.c
- # procmail-3.03/src/sublib.c
- # Wrapped by kent@sparky on Tue Jul 5 20:42:15 1994
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 9 (of 10)."'
- if test -f 'procmail-3.03/FEATURES' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail-3.03/FEATURES'\"
- else
- echo shar: Extracting \"'procmail-3.03/FEATURES'\" \(3953 characters\)
- sed "s/^X//" >'procmail-3.03/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 (it's 1.4 times faster than the average /bin/mail in user-cpu
- X time)
- 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 + Also allows for neural-net-type weighted scoring of mails
- 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, what it was about, where it went (what
- X 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 lengths, 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 + Secure system mailbox handling (contrary to several well known
- X /bin/mail implementations)
- X + Provides for a controlled execution of programs and scripts from
- X the aliases file (i.e. under defined user ids)
- 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 + Can be used as a general mailfilter for whole groups of messages
- X (e.g. when called from within sendmail.cf rules).
- 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 + Can extract messages from mailboxes
- X + Can recognise duplicate messages
- 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 3953 -ne `wc -c <'procmail-3.03/FEATURES'`; then
- echo shar: \"'procmail-3.03/FEATURES'\" unpacked with wrong size!
- fi
- # end of 'procmail-3.03/FEATURES'
- fi
- if test -f 'procmail-3.03/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail-3.03/Makefile'\"
- else
- echo shar: Extracting \"'procmail-3.03/Makefile'\" \(4043 characters\)
- sed "s/^X//" >'procmail-3.03/Makefile' <<'END_OF_FILE'
- X#$Id: Makefile,v 1.56 1994/06/01 18:52:01 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
- XARCHITECTURE=
- 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##############################
- 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# install-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# setid Creates the setid binary needed by the SmartList
- X# installation
- X########################
- X
- X# Makefile.0 - mark, don't (re)move this, a sed script needs it
- X
- XLOCKINGTEST=__defaults__
- X
- X#LOCKINGTEST=/tmp . # Uncomment and add any directories you see fit.
- X# If LOCKINGTEST is defined, autoconf will NOT
- X# prompt you to enter additional directories.
- X# See INSTALL for more information about the
- X# significance of the locking tests.
- X
- X########################################################################
- X# Only edit below this line if you *think* you know what you are doing #
- X########################################################################
- X
- X#LOCKINGTEST=100 # Uncomment (and change) if you think you know
- X# it better than the autoconf lockingtests.
- X# This will cause the lockingtests to be hotwired.
- X# 100 to enable fcntl()
- X# 010 to enable lockf()
- X# 001 to enable flock()
- X# Or them together to get the desired combination.
- X
- X# Optional system libraries we search for
- XSEARCHLIBS = -lm -ldir -lx -lsocket -lnet -linet -lnsl_s -lnsl_i -lnsl -lsun \
- X -lgen -lsockdns
- X# -lresolv # not really needed, is it?
- X
- X# Informal list of directories where we look for the libraries in SEARCHLIBS
- XLIBPATHS=/lib /usr/lib /usr/local/lib
- X
- XGCC_WARNINGS = -O2 -pedantic -Wimplicit -Wreturn-type -Wunused -Wformat \
- X -Wtraditional -Wshadow -Wid-clash-6 -Wpointer-arith -Wconversion \
- X -Waggregate-return #-Wuninitialized
- X
- X# The place to put your favourite extra cc flag
- XCFLAGS0 = -O #$(GCC_WARNINGS)
- 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
- XBSHELL = /bin/sh
- XINSTALL = cp
- XDEVNULL = /dev/null
- X
- XSUBDIRS = src man
- XBINSS = procmail lockfile formail mailstat
- XMANS1S = procmail formail lockfile
- XMANS5S = procmailrc procmailsc 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
- X.PRECIOUS: Makefile
- X
- Xinit:
- X $(BSHELL) ./initmake $(BSHELL) "$(SHELL)" "$(RM)" "$(MV)" "$(LN)" \
- X "$(SEARCHLIBS)" \
- X "$(LIBPATHS)" \
- X $(DEVNULL) "$(HIDEMAKE)" $(O) \
- X "$(CC)" "$(CFLAGS1)" "$(LDFLAGS1)" "$(BINSS)" \
- X "$(MANS1S)" "$(MANS5S)" "$(SUBDIRS)" \
- X "$(BINDIR)"
- X
- Xmakefiles makefile Makefiles Makefile: init
- X @$(BSHELL) -c "exit 0"
- X
- Xbins mans install.bin install.man install recommend install-suid clean setid \
- Xrealclean veryclean clobber deinstall autoconf.h $(BINSS) multigram: init
- X $(HIDEMAKE) make $@
- END_OF_FILE
- if test 4043 -ne `wc -c <'procmail-3.03/Makefile'`; then
- echo shar: \"'procmail-3.03/Makefile'\" unpacked with wrong size!
- fi
- # end of 'procmail-3.03/Makefile'
- fi
- if test -f 'procmail-3.03/Makefile.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail-3.03/Makefile.1'\"
- else
- echo shar: Extracting \"'procmail-3.03/Makefile.1'\" \(4618 characters\)
- sed "s/^X//" >'procmail-3.03/Makefile.1' <<'END_OF_FILE'
- X#$Id: Makefile.1,v 1.36 1994/06/06 17:33:15 berg Exp $
- X
- XHIDEMAKE=$(MAKE)
- X
- Xall: bins mans recommend
- X
- Xmake:
- X @$(SHELL) -c "exit 0"
- X
- X.PRECIOUS: Makefile
- X
- Xbins: config.check src/Makefile
- X cd src; $(MAKE) $(NBINS)
- X
- Xmans: config.check man/Makefile
- X cd man; $(MAKE) $(NMANS)
- X
- Xautoconf.h: src/Makefile src/autoconf
- X cd src; $(MAKE) ../$@
- X
- Xprocmail: config.check src/Makefile man/Makefile
- X cd src; $(MAKE) ../new/$@ ../new/mailstat
- X cd man; $(MAKE) ../new/$@.1 ../new/$@rc.5 ../new/$@ex.5 ../new/$@sc.5
- X
- Xmailstat: procmail
- X
- Xformail lockfile: config.check src/Makefile man/Makefile
- X cd src; $(MAKE) ../new/$@
- X cd man; $(MAKE) ../new/$@.1
- X
- Xsetid multigram: config.check src/Makefile man/Makefile
- X cd src; $(MAKE) $@
- X
- Xconfig.check: config.h
- X echo Housekeeping file >$@
- X @-mkdir new 2>$(DEVNULL); exit 0
- X @-if $(FGREP) -n -e '`' config.h $(DEVNULL) | $(FGREP) -v EOFName ; \
- X then \
- X echo;echo ' ^^^^^^^^^^^^^^^^^^^^ WARNING ^^^^^^^^^^^^^^^^^^^^^';\
- X echo ' * Having backquotes in there could be unhealthy! *';\
- X echo;fi;exit 0
- X
- Xrecommend: src/Makefile
- X @cd src; $(MAKE) $@ >$(DEVNULL)
- X @echo ================================================================\
- X===============
- X @if $(FGREP) CF_no_procmail_yet autoconf.h >$(DEVNULL); \
- X then echo If you are a system administrator you should consider \
- Xintegrating procmail; echo into the mail-delivery system -- for advanced \
- Xfunctionality, speed AND; echo SECURITY "--. For" more information about \
- Xthis topic you should look in the; echo examples/advanced file.; elif \
- X cat /usr/lib/sendmail.cf /etc/sendmail.cf 2>$(DEVNULL) | \
- X grep 'Mlocal.*procmail.*F=[a-zA-Z]*u' >$(DEVNULL) ; then \
- X echo The recommendation for the sendmail.cf entry of procmail has \
- Xchanged.; echo I suggest you remove the '`u'"'"-flag 'like in:'; echo ; \
- X sed -n 's/.*\(Mlocal.*procmail.*F=[a-zA-Z]*\)u/\1/p' `if test -f \
- X /etc/sendmail.cf; then echo /etc/sendmail.cf; else \
- X echo /usr/lib/sendmail.cf; fi`; fi
- X @echo
- X @echo \
- X "Also, HIGHLY RECOMMENDED (type 'make install-suid' to execute it):"
- X @echo
- X @src/$@ $(BINDIR)/procmail $(BINDIR)/lockfile >suid.sh
- X @src/$@ $(BINDIR)/procmail $(BINDIR)/lockfile
- X @echo ================================================================\
- X===============
- X
- Xsuid.sh: recommend
- X
- Xinstall-suid: suid.sh install.bin
- X @cat suid.sh
- X @$(SHELL) ./suid.sh
- X @cd $(BINDIR); echo Installed in $(BINDIR); ls -l $(BINSS)
- X
- X$(MANS): mans
- X
- X$(BINS): bins
- X
- X$(BASENAME):
- X mkdir $(BASENAME)
- X
- Xinstall.man: $(MANS) $(BASENAME)
- X @-mkdir $(MANDIR) 2>$(DEVNULL); exit 0
- X @-mkdir $(MAN1DIR) 2>$(DEVNULL); exit 0
- X @-mkdir $(MAN5DIR) 2>$(DEVNULL); exit 0
- X @chmod 0644 $(MANS)
- X @for a in $(MANS1S); \
- X do $(INSTALL) new/$$a.1 $(MAN1DIR)/$$a.$(MAN1SUFFIX); done
- X @for a in $(MANS5S); \
- X do $(INSTALL) new/$$a.5 $(MAN5DIR)/$$a.$(MAN5SUFFIX); done
- X echo Housekeeping file >install.man
- X
- Xinstall.bin: $(BINS) $(BASENAME)
- X @-mkdir $(BINDIR) 2>$(DEVNULL); exit 0
- X @chmod 0755 $(BINS)
- X $(INSTALL) $(BINS) $(BINDIR)
- X @-dirname / >$(DEVNULL) || $(INSTALL) examples/dirname $(BINDIR)
- X echo Housekeeping file >install.bin
- X
- Xinstall:
- X @$(MAKE) install.man install.bin
- X @echo
- X @cd $(BINDIR); echo Installed in $(BINDIR); ls -l $(BINSS)
- X @cd $(MAN1DIR); echo Installed in $(MAN1DIR); ls -l $(MANS1)
- X @cd $(MAN5DIR); echo Installed in $(MAN5DIR); ls -l $(MANS5)
- X @$(MAKE) recommend
- X
- Xdeinstall:
- X @echo ============================= Deinstalling the procmail package.
- X @$(RM) install.man install.bin
- X @echo ============================= Checking if everything was removed:
- X @-cd $(BINDIR); $(RM) $(BINSS); ls -l $(BINSS); exit 0
- X @-cd $(MAN1DIR); $(RM) $(MANS1); ls -l $(MANS1); exit 0
- X @-cd $(MAN5DIR); $(RM) $(MANS5); ls -l $(MANS5); exit 0
- X @echo ============================= Ready.
- X
- Xclean: config.check
- X -for a in $(SUBDIRS); do cd $$a; $(MAKE) $@; cd ..; done; exit 0
- X cd SmartList; $(RM) targetdir.h targetdir.tmp install.list
- X $(RM) $(MANS) $(BINS) install.man install.bin suid.sh _Makefile \
- X *core* autoconf.h.tmp
- X
- Xrealclean: clean _init
- X $(RM) config.check
- X -rmdir new; exit 0
- X -for a in $(SUBDIRS); do $(MV) $$a/Makefile.init $$a/Makefile; done; \
- X exit 0
- X
- Xveryclean clobber: realclean
- X
- X_init:
- X sed -e '/^# Makefile.1 - mark/,$$ d' <Makefile >_Makefile
- X cat Makefile.0 >>_Makefile
- X $(MV) _Makefile Makefile
- X $(RM) Makefile.0
- X
- Xman/Makefile: man/Makefile.0 Makefile
- X
- Xsrc/Makefile: src/Makefile.0 Makefile
- X
- Xman/Makefile src/Makefile Makefile: Makefile.1 initmake
- X sed -e '/^# Makefile.1 - mark/,$$ d' <Makefile >_Makefile
- X cat Makefile.0 >>_Makefile
- X $(MV) _Makefile Makefile
- X $(RM) Makefile.0
- X $(HIDEMAKE) init
- X
- Xinit makefiles Makefiles makefile: man/Makefile src/Makefile
- END_OF_FILE
- if test 4618 -ne `wc -c <'procmail-3.03/Makefile.1'`; then
- echo shar: \"'procmail-3.03/Makefile.1'\" unpacked with wrong size!
- fi
- # end of 'procmail-3.03/Makefile.1'
- fi
- if test -f 'procmail-3.03/Manifest' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail-3.03/Manifest'\"
- else
- echo shar: Extracting \"'procmail-3.03/Manifest'\" \(2072 characters\)
- sed "s/^X//" >'procmail-3.03/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.
- XSmartList/* All you need to start up lots of mailinglists.
- XSmartList/FEATURES
- X A summary of all the SmartList package will take care of.
- XSmartList/INTRO
- X Comprehensive introduction on maintaining a mailinglist.
- END_OF_FILE
- if test 2072 -ne `wc -c <'procmail-3.03/Manifest'`; then
- echo shar: \"'procmail-3.03/Manifest'\" unpacked with wrong size!
- fi
- # end of 'procmail-3.03/Manifest'
- fi
- if test -f 'procmail-3.03/SmartList/README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail-3.03/SmartList/README'\"
- else
- echo shar: Extracting \"'procmail-3.03/SmartList/README'\" \(2108 characters\)
- sed "s/^X//" >'procmail-3.03/SmartList/README' <<'END_OF_FILE'
- XThe SmartList mailinglist package has been built on top of the procmail
- Xmail processing package. In order to install it you'll need the source
- Xof the procmail package as well.
- X
- XIf you now have just the procmail sources, get the SmartList sources and
- Xunpack them on top of the procmail source tree.
- XIf you now have just the SmartList sources, get the procmail sources and
- Xunpack them on top of the SmartList source tree.
- XSee below on where to get the missing part.
- X
- XThe two source packages should blend together with only this README file
- Xand the FEATURES file being duplicated.
- X----------------------
- XFor installation instructions see the INSTALL file.
- X----------------------
- XSmartList mailinglist management package.
- XCopyright (c) 1993-1994, S.R. van den Berg, The Netherlands.
- X
- XSome legal stuff:
- X
- XUse this software package at your own risk. The programmer cannot
- Xbe held liable for any incurred damages, directly or indirectly due to
- Xthe use or inability to use this software.
- X
- XYou are encouraged to distribute this package freely. This package is
- Xhowever not to be sold (minor transfer costs excepted) or included in
- Xany commercially sold software package (if you want to do this anyway,
- Xcontact me (address below), and we'll work something out).
- X
- XIf you distribute it, please leave the package intact. You are allowed to
- Xtake parts from this distribution and distribute these separately as long
- Xas you retain the copyright messages. If you redistribute any part of this
- Xpackage in a modified form, be sure to mark the parts you changed.
- XIf you have some important changes that might be useful to the rest of the
- Xworld, contact me instead.
- X----------------------
- XA recent version of both packages can be picked up at various
- Xcomp.sources.misc archives.
- XThe latest versions can be obtained directly from the ftp-archive at:
- X
- X ftp.informatik.rwth-aachen.de
- X
- Xas (g)zipped tar files: /pub/packages/procmail/procmail.tar.gz
- X /pub/packages/procmail/SmartList.tar.gz
- Xas compressed tar files: /pub/packages/procmail/procmail.tar.Z
- X /pub/packages/procmail/SmartList.tar.Z
- X----------------------
- END_OF_FILE
- if test 2108 -ne `wc -c <'procmail-3.03/SmartList/README'`; then
- echo shar: \"'procmail-3.03/SmartList/README'\" unpacked with wrong size!
- fi
- # end of 'procmail-3.03/SmartList/README'
- fi
- if test -f 'procmail-3.03/examples/2procmailrc' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail-3.03/examples/2procmailrc'\"
- else
- echo shar: Extracting \"'procmail-3.03/examples/2procmailrc'\" \(1989 characters\)
- sed "s/^X//" >'procmail-3.03/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-3.03/examples/2procmailrc'`; then
- echo shar: \"'procmail-3.03/examples/2procmailrc'\" unpacked with wrong size!
- fi
- # end of 'procmail-3.03/examples/2procmailrc'
- fi
- if test -f 'procmail-3.03/src/common.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail-3.03/src/common.c'\"
- else
- echo shar: Extracting \"'procmail-3.03/src/common.c'\" \(2572 characters\)
- sed "s/^X//" >'procmail-3.03/src/common.c' <<'END_OF_FILE'
- X/************************************************************************
- X * Some routines common to procmail and formail *
- X * *
- X * Copyright (c) 1990-1994, S.R. van den Berg, The Netherlands *
- X * #include "../README" *
- X ************************************************************************/
- X#ifdef RCS
- Xstatic /*const*/char rcsid[]=
- X "$Id: common.c,v 1.19 1994/06/28 16:56:01 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*skpspace(chp)const char*chp;
- X{ for(;;chp++)
- X switch(*chp)
- X { case ' ':case '\t':
- X continue;
- X default:
- X return (char*)chp;
- X }
- X}
- X
- X#ifdef NOstrcspn
- Xint strcspn(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
- Xint waitfor(pid)const pid_t pid; /* wait for a specific process */
- X{ int i;pid_t j;
- X while(pid!=(j=wait(&i))||WIFSTOPPED(i))
- X if(-1==j)
- X return NO_PROCESS;
- X else if(!pid)
- X break;
- X return lexitcode=WIFEXITED(i)?WEXITSTATUS(i):-WTERMSIG(i);
- X}
- X
- Xint strnIcmp(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 2572 -ne `wc -c <'procmail-3.03/src/common.c'`; then
- echo shar: \"'procmail-3.03/src/common.c'\" unpacked with wrong size!
- fi
- # end of 'procmail-3.03/src/common.c'
- fi
- if test -f 'procmail-3.03/src/cstdio.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail-3.03/src/cstdio.c'\"
- else
- echo shar: Extracting \"'procmail-3.03/src/cstdio.c'\" \(4014 characters\)
- sed "s/^X//" >'procmail-3.03/src/cstdio.c' <<'END_OF_FILE'
- X/************************************************************************
- X * Custom standard-io library *
- X * *
- X * Copyright (c) 1990-1994, S.R. van den Berg, The Netherlands *
- X * #include "../README" *
- X ************************************************************************/
- X#ifdef RCS
- Xstatic /*const*/char rcsid[]=
- X "$Id: cstdio.c,v 1.26 1994/06/28 16:56:03 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; /* buffer for custom stdio */
- Xstatic off_t blasttell;
- Xstatic struct dyna_long inced; /* includerc stack */
- Xstruct dynstring*incnamed;
- 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?(off_t)(rcbufp-rcbuf):(off_t)0); /* save old */
- X app_val(&inced,blasttell);app_val(&inced,(off_t)rc); /* position & 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
- Xvoid duprcs P((void))
- X{ size_t i;struct dynstring*dp;
- X dp=incnamed;rclose(rc);
- X if(0>(rc=ropen(dp->ename,O_RDONLY,0)))
- X goto dupfailed;
- X lseek(rc,blasttell+STDBUF,SEEK_SET);
- X for(i=inced.filled;dp=dp->enext,i;i-=2)
- X { int fd;
- X rclose(inced.offs[--i]);
- X if(0>(fd=ropen(dp->ename,O_RDONLY,0)))
- Xdupfailed:
- X nlog("Lost"),logqnl(dp->ename),exit(EX_NOINPUT);
- X inced.offs[i]=fd;
- X }
- X}
- X
- Xstatic void closeonerc P((void))
- X{ struct dynstring*last;
- X if(rc>=0)
- X rclose(rc),rc= -1,last=incnamed,incnamed=last->enext,free(last);
- X}
- X
- Xint poprc P((void))
- X{ closeonerc(); /* close it in any case */
- X if(skiprc)
- X skiprc=0,nlog("Missing closing brace\n");
- 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];
- X return 1;
- X}
- X
- Xvoid closerc P((void)) /* {while(poprc());} */
- X{ while(closeonerc(),inced.filled)
- X rc=inced.offs[inced.filled-1],inced.filled-=3;
- X}
- X /* destroys buf2 */
- Xint bopen(name)const char*const name; /* my fopen */
- X{ rcbufp=rcbufend=0;rc=ropen(name,O_RDONLY,0);
- X if(rc>=0)
- X { char*md; /* if it's a relative name and an absolute $MAILDIR */
- X if(!strchr(dirsep,*name)&&strchr(dirsep,*(md=(char*)tgetenv(maildir))))
- X { strcpy(buf2,md);*(md=strchr(buf2,'\0'))= *dirsep;strcpy(++md,name);
- X md=buf2; /* then prepend $MAILDIR */
- X }
- X else
- X md=(char*)name; /* pick the original otherwise */
- X newdynstring(&incnamed,md);
- X }
- X return rc;
- X}
- X
- Xint getbl(p)char*p; /* my gets */
- X{ int i;char*q;
- X for(q=p;;)
- X { switch(i=getb())
- X { case '\n':case EOF:*q='\0';
- X return p!=q; /* did we read anything at all? */
- X }
- X *q++=i;
- X }
- X}
- X
- Xint getb P((void)) /* my fgetc */
- X{ if(rcbufp==rcbufend) /* refill */
- X { blasttell=tell(rc);rcbufend=rcbuf+rread(rc,rcbufp=rcbuf,STDBUF);
- X if(rcbufp==rcbufend)
- X rcbufp++;
- X }
- X return rcbufp<rcbufend?(int)*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
- Xint testb(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);
- X return 0;
- X}
- X
- Xint sgetc P((void)) /* a fake fgetc for a string */
- X{ return *sgetcp?(int)*(uchar*)sgetcp++:EOF;
- X}
- X
- Xint skipspace 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 4014 -ne `wc -c <'procmail-3.03/src/cstdio.c'`; then
- echo shar: \"'procmail-3.03/src/cstdio.c'\" unpacked with wrong size!
- fi
- # end of 'procmail-3.03/src/cstdio.c'
- fi
- if test -f 'procmail-3.03/src/ecommon.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail-3.03/src/ecommon.c'\"
- else
- echo shar: Extracting \"'procmail-3.03/src/ecommon.c'\" \(867 characters\)
- sed "s/^X//" >'procmail-3.03/src/ecommon.c' <<'END_OF_FILE'
- X/************************************************************************
- X * Some common routines to all programs but procmail *
- X * *
- X * Copyright (c) 1993-1994, S.R. van den Berg, The Netherlands *
- X * #include "../README" *
- X ************************************************************************/
- X#ifdef RCS
- Xstatic /*const*/char rcsid[]=
- X "$Id: ecommon.c,v 1.6 1994/05/26 14:12:32 berg Exp $";
- X#endif
- X#include "includes.h"
- X#include "ecommon.h"
- X#include "common.h"
- X
- Xvoid
- X nlog P((const char*const a));
- X
- Xstatic const char outofmem[]="Out of memory\n";
- X
- Xvoid*tmalloc(len)const size_t len;
- X{ void*p;
- X if(p=malloc(len))
- X return p;
- X nlog(outofmem);exit(EX_OSERR);
- X}
- X
- Xvoid*trealloc(old,len)void*old;const size_t len;
- X{ if(old=realloc(old,len))
- X return old;
- X nlog(outofmem);exit(EX_OSERR);
- X}
- X
- Xvoid tfree(a)void*a;
- X{ free(a);
- X}
- X
- X#include "shell.h"
- END_OF_FILE
- if test 867 -ne `wc -c <'procmail-3.03/src/ecommon.c'`; then
- echo shar: \"'procmail-3.03/src/ecommon.c'\" unpacked with wrong size!
- fi
- # end of 'procmail-3.03/src/ecommon.c'
- fi
- if test -f 'procmail-3.03/src/exopen.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail-3.03/src/exopen.c'\"
- else
- echo shar: Extracting \"'procmail-3.03/src/exopen.c'\" \(3061 characters\)
- sed "s/^X//" >'procmail-3.03/src/exopen.c' <<'END_OF_FILE'
- X/************************************************************************
- X * Collection of NFS resistant exclusive creat routines *
- X * *
- X * Copyright (c) 1990-1994, S.R. van den Berg, The Netherlands *
- X * #include "../README" *
- X ************************************************************************/
- X#ifdef RCS
- Xstatic /*const*/char rcsid[]=
- X "$Id: exopen.c,v 1.23 1994/06/28 16:56:05 berg Exp $";
- X#endif
- X#include "procmail.h"
- X#include "acommon.h"
- X#include "robust.h"
- X#include "misc.h"
- X#include "common.h"
- X#include "exopen.h"
- X
- Xint unique(full,p,mode,verbos,chownit)const char*const full;char*p;
- X const mode_t mode;const int verbos,chownit;
- X{ unsigned long retry=mrotbSERIAL;int i;struct stat filebuf;
- X int nicediff,didnice=0;
- X if(chownit&doCHOWN) /* semi-critical, try raising the priority */
- X { nicediff=nice(0);SETerrno(0);nicediff-=nice(-NICE_RANGE);
- X if(!errno)
- X didnice=1;
- X }
- X do /* create unique file name */
- X { *p=UNIQ_PREFIX;p=ultoan(maskSERIAL&(retry-=irotbSERIAL)+(long)thepid,p+1);
- X strncpy(p,hostname(),HOSTNAMElen);p[HOSTNAMElen]='\0';
- X }
- X#ifndef O_CREAT
- X#define ropen(path,type,mode) creat(path,mode)
- X#endif
- X while(!lstat(full,&filebuf)||
- X (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(didnice)
- X nice(nicediff); /* put back the priority to the old level */
- X if(i<0)
- X { if(verbos) /* this error message can be confusing */
- X writeerr(full); /* for casual users */
- X goto ret0;
- X }
- X#ifdef NOfstat
- X if(chownit&doCHOWN)
- X { if(
- X#else
- X if(chownit&doCHECK)
- X { struct stat fdbuf;
- X fstat(i,&fdbuf); /* match between the file descriptor */
- X#define NEQ(what) (fdbuf.what!=filebuf.what) /* and the file? */
- X if(lstat(full,&filebuf)||filebuf.st_nlink!=1||filebuf.st_size||
- X NEQ(st_dev)||NEQ(st_ino)||NEQ(st_uid)||NEQ(st_gid)||
- X chownit&doCHOWN&&
- X#endif
- X chown(full,uid,sgid))
- X { rclose(i);unlink(full); /* forget it, no permission */
- Xret0: return 0;
- X }
- X }
- X if(chownit&doLOCK)
- X rwrite(i,"0",1); /* pid 0, `works' across networks */
- X rclose(i);
- X return 1;
- X}
- X /* rename MUST fail if already existent */
- Xint myrename(old,newn)const char*const old,*const newn;
- X{ int i,serrno;
- X i=hlink(old,newn);serrno=errno;unlink(old);SETerrno(serrno);
- X return i;
- X}
- X /* hardlink with fallback for systems that don't support it */
- Xint hlink(old,newn)const char*const old,*const newn;
- X{ if(link(old,newn)) /* try a real hardlink */
- X { int i,serrno;struct stat stbuf;
- X serrno=errno;i=lstat(old,&stbuf);SETerrno(serrno);
- X if(i&&S_ISLNK(stbuf.st_mode)) /* no stat or symbolic link? */
- X goto retfail; /* yuk, don't accept it */
- X if(stbuf.st_nlink!=2)
- X { if(serrno!=EXDEV) /* failure due to filesystem? */
- X goto retfail; /* try it by conventional means */
- X#ifdef O_CREAT
- X if(0>(i=ropen(newn,O_WRONLY|O_CREAT|O_EXCL,stbuf.st_mode)))
- X#endif
- Xretfail: return -1;
- X rclose(i);
- X }
- X }
- X return 0;
- X}
- END_OF_FILE
- if test 3061 -ne `wc -c <'procmail-3.03/src/exopen.c'`; then
- echo shar: \"'procmail-3.03/src/exopen.c'\" unpacked with wrong size!
- fi
- # end of 'procmail-3.03/src/exopen.c'
- fi
- if test -f 'procmail-3.03/src/fields.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail-3.03/src/fields.c'\"
- else
- echo shar: Extracting \"'procmail-3.03/src/fields.c'\" \(4177 characters\)
- sed "s/^X//" >'procmail-3.03/src/fields.c' <<'END_OF_FILE'
- X/************************************************************************
- X * Routines to deal with the header-field objects in formail *
- X * *
- X * Copyright (c) 1990-1994, S.R. van den Berg, The Netherlands *
- X * #include "../README" *
- X ************************************************************************/
- X#ifdef RCS
- Xstatic /*const*/char rcsid[]=
- X "$Id: fields.c,v 1.17 1994/06/28 16:56:07 berg Exp $";
- X#endif
- X#include "includes.h"
- X#include "formail.h"
- X#include "sublib.h"
- X#include "shell.h"
- X#include "common.h"
- X#include "fields.h"
- X#include "ecommon.h"
- X#include "formisc.h"
- X /* find a field in the linked list of fields */
- Xstruct field*findf(p,ah)const struct field*const p;register struct field**ah;
- X{ size_t i;int uhead;char*chp;register struct field*h;
- X uhead=ah==&uheader||ah==&Uheader;
- X for(i=p->id_len,chp=(char*)p->fld_text,h= *ah;h;h= *(ah= &h->fld_next))
- X if(i>=h->id_len&&!strnIcmp(chp,h->fld_text,h->id_len))
- X { if(i>h->id_len&&uhead) /* finalise the header? */
- X *ah=0,(*(ah=addfield(ah,chp,i)))->fld_next=h,(h= *ah)->fld_ref=0;
- X return h;
- X }
- X return (struct field*)0;
- X}
- X
- Xvoid clear_uhead(hdr)register struct field*hdr;
- X{ for(;hdr;hdr=hdr->fld_next)
- X hdr->fld_ref=0;
- X}
- X
- Xstruct field**addfield(pointer,text,totlen)struct field**pointer;
- X const char*const text;const size_t totlen; /* add field to a linked list */
- X{ register struct field*p,**pp;int idlen;
- X for(pp=pointer;*pp;pp= &(*pp)->fld_next); /* skip to the end of the list */
- X (*pp=p=malloc(FLD_HEADSIZ+totlen))->fld_next=0;idlen=breakfield(text,totlen);
- X p->id_len=idlen>0?idlen:pp==&rdheader?0:-idlen; /* copy contents */
- X tmemmove(p->fld_text,text,p->tot_len=totlen);
- X return pp;
- X}
- X
- Xstruct field*delfield(pointer)struct field**pointer;
- X{ struct field*fldp;
- X *pointer=(fldp= *pointer)->fld_next;free(fldp);
- X return *pointer;
- X}
- X
- Xvoid concatenate(fldp)struct field*const fldp;
- X{ register char*p;register size_t l; /* concatenate a continued field */
- X l=fldp->tot_len;
- X if(!eqFrom_(p=fldp->fld_text)) /* don't concatenate From_ lines */
- X while(l--)
- X if(*p++=='\n'&&l) /* by substituting all newlines except the last */
- X p[-1]=' ';
- X}
- X
- Xvoid renfield(pointer,oldl,newname,newl)struct field**const pointer;
- X const size_t oldl,newl;const char*const newname; /* rename fields */
- X{ struct field*p;size_t i;char*chp;
- X i=(p= *pointer)->tot_len-oldl; /* length of what we will keep */
- X *pointer=p=realloc(p,FLD_HEADSIZ+(p->tot_len=i+newl));chp=p->fld_text;
- X tmemmove(chp+newl,chp+oldl,i);tmemmove(chp,newname,newl); /* shove, copy */
- X}
- X
- Xstatic void extractfield(p)register struct field*p;
- X{ if(xheader||Xheader) /* extracting only? */
- X { if(findf(p,&xheader)) /* extract field contents */
- X { putssn((char*)p->fld_text+p->id_len,p->tot_len-p->id_len);
- X return;
- X }
- X if(!findf(p,&Xheader)) /* extract fields */
- X return;
- X }
- X lputssn(p->fld_text,p->tot_len); /* display it entirely */
- X}
- X
- Xvoid flushfield(pointer)register struct field**pointer; /* delete and print */
- X{ register struct field*p,*q; /* them as you go */
- X for(p= *pointer,*pointer=0;p;p=q)
- X q=p->fld_next,extractfield(p),free(p);
- X}
- X
- Xvoid dispfield(p)register const struct field*p;
- X{ for(;p;p=p->fld_next) /* print list non-destructively */
- X if(p->id_len+1<p->tot_len) /* any contents to display? */
- X extractfield(p);
- X}
- X /* try and append one valid field to rdheader from stdin */
- Xint readhead P((void))
- X{ getline();
- X if(eqFrom_(buf)) /* it's a From_ line */
- X { if(rdheader)
- X return 0; /* the From_ line was a fake! */
- X for(;buflast=='>';getline()); /* gather continued >From_ lines */
- X }
- X else
- X { if(breakfield(buf,buffilled)<=0) /* not the start of a valid field */
- X return 0;
- X for(;;getline()) /* get the rest of the continued field */
- X { switch(buflast) /* will this line be continued? */
- X { case ' ':case '\t': /* yep, it sure is */
- X continue;
- X }
- X break;
- X }
- X }
- X addbuf(); /* phew, got the field, add it to rdheader */
- X return 1;
- X}
- X
- Xvoid addbuf P((void))
- X{ addfield(&rdheader,buf,buffilled);buffilled=0;
- X}
- END_OF_FILE
- if test 4177 -ne `wc -c <'procmail-3.03/src/fields.c'`; then
- echo shar: \"'procmail-3.03/src/fields.c'\" unpacked with wrong size!
- fi
- # end of 'procmail-3.03/src/fields.c'
- fi
- if test -f 'procmail-3.03/src/misc.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail-3.03/src/misc.h'\"
- else
- echo shar: Extracting \"'procmail-3.03/src/misc.h'\" \(2030 characters\)
- sed "s/^X//" >'procmail-3.03/src/misc.h' <<'END_OF_FILE'
- X/*$Id: misc.h,v 1.28 1994/05/26 14:13:12 berg Exp $*/
- X
- Xstruct dyna_long{size_t filled,tspace;off_t*offs;};
- Xstruct dynstring{struct dynstring*enext;char ename[255];};
- X
- Xvoid
- X elog P((const char*const newt)),
- X ignoreterm P((void)),
- X shutdesc P((void)),
- X setids P((void)),
- X writeerr P((const char*const line)),
- X progerr P((const char*const line,int xitcode)),
- X chderr P((const char*const dir)),
- X readerr P((const char*const file)),
- X verboff P((void)),
- X verbon P((void)),
- X newid P((void)),
- X zombiecollect P((void)),
- 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 onguard P((void)),
- X offguard P((void)),
- 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)),
- X squeeze P((char*target)),
- X initdefenv P((void));
- 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)),
- X enoughprivs Q((const struct passwd*const passinvk,const uid_t euid,
- X const gid_t egid,const uid_t uid,const gid_t gid));
- 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 *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)),
- X *newdynstring P((struct dynstring**const adrp,const char*const chp));
- Xlong
- X renvint P((const long i,const char*const env));
- Xconst struct passwd
- X *savepass Q((struct passwd*const spass,const uid_t uid));
- X
- Xextern const char lastfolder[];
- Xextern int didchd;
- Xextern char*globlock;
- END_OF_FILE
- if test 2030 -ne `wc -c <'procmail-3.03/src/misc.h'`; then
- echo shar: \"'procmail-3.03/src/misc.h'\" unpacked with wrong size!
- fi
- # end of 'procmail-3.03/src/misc.h'
- fi
- if test -f 'procmail-3.03/src/procmail.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail-3.03/src/procmail.h'\"
- else
- echo shar: Extracting \"'procmail-3.03/src/procmail.h'\" \(2581 characters\)
- sed "s/^X//" >'procmail-3.03/src/procmail.h' <<'END_OF_FILE'
- X/*$Id: procmail.h,v 1.26 1994/06/24 10:45:08 berg Exp $*/
- X
- X#include "includes.h"
- 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#ifndef ETCRC
- X#define ETCRC 0
- X#endif
- X
- X#define MAX32 ((long)(~(unsigned long)0>>1))
- X#define MIN32 (-(long)MAX32)
- X
- X#define XTRAlinebuf 2 /* surplus of LINEBUF (see readparse()) */
- X#ifdef MAXPATHLEN
- X#if MAXPATHLEN>DEFlinebuf /* to protect people from themselves */
- X#undef DEFlinebuf
- X#define DEFlinebuf MAXPATHLEN
- X#endif
- X#endif
- X
- X#define rc_NOSGID 1 /* you can forget any sgidness */
- X#define rc_NORMAL 2
- 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 (*(volatile long*)&strenvvar[5].val)
- X#define lgabstract (strenvvar[6].val)
- X
- Xextern struct varstr{const char*const sname,*sval;}strenstr[];
- X#define shellmetas (strenstr[0].sval)
- X#define lockext (strenstr[1].sval)
- X#define msgprefix (strenstr[2].sval)
- X#define scomsat (strenstr[3].sval)
- X#define traps (strenstr[4].sval)
- X#define shellflags (strenstr[5].sval)
- X#define fdefault (strenstr[6].sval)
- X#define sendmail (strenstr[7].sval)
- X
- Xint
- X eqFrom_ P((const char*const a));
- X
- Xextern char*buf,*buf2,*loclock,*tolock,*Stdout,*themail,*thebody;
- Xextern const char shell[],lockfile[],newline[],binsh[],unexpeof[],*const*gargv,
- X *const*restargv,*sgetcp,*rcfile,dirsep[],devnull[],lgname[],executing[],
- X oquote[],cquote[],whilstwfor[],procmailn[],Mail[],home[],maildir[],host[],
- X *defdeflock,*argv0,errwwriting[],slogstr[];
- Xextern long filled,lastscore;
- Xextern int sh,pwait,retval,retvl2,lcking,rcstate,rc,ignwerr,lexitcode,
- X asgnlastf,accspooldir,crestarg,skiprc,savstdout;
- 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 2581 -ne `wc -c <'procmail-3.03/src/procmail.h'`; then
- echo shar: \"'procmail-3.03/src/procmail.h'\" unpacked with wrong size!
- fi
- # end of 'procmail-3.03/src/procmail.h'
- fi
- if test -f 'procmail-3.03/src/recommend.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail-3.03/src/recommend.c'\"
- else
- echo shar: Extracting \"'procmail-3.03/src/recommend.c'\" \(1897 characters\)
- sed "s/^X//" >'procmail-3.03/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.9 1994/06/01 17:22:30 berg Exp $*/
- X#include "includes.h"
- 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=(gid_t)-1;
- 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 1897 -ne `wc -c <'procmail-3.03/src/recommend.c'`; then
- echo shar: \"'procmail-3.03/src/recommend.c'\" unpacked with wrong size!
- fi
- # end of 'procmail-3.03/src/recommend.c'
- fi
- if test -f 'procmail-3.03/src/sublib.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'procmail-3.03/src/sublib.c'\"
- else
- echo shar: Extracting \"'procmail-3.03/src/sublib.c'\" \(4614 characters\)
- sed "s/^X//" >'procmail-3.03/src/sublib.c' <<'END_OF_FILE'
- X/************************************************************************
- X * Collection of standard library substitute routines *
- X * *
- X * Copyright (c) 1990-1994, S.R. van den Berg, The Netherlands *
- X * #include "../README" *
- X ************************************************************************/
- X#ifdef RCS
- Xstatic /*const*/char rcsid[]=
- X "$Id: sublib.c,v 1.13 1994/06/28 16:56:49 berg Exp $";
- X#endif
- 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;
- X 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);
- X 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 BENCHSIZE /* for autoconf */
- X#ifndef SLOWstrstr
- X#define SLOWstrstr
- X#else
- X#undef BENCHSIZE
- X#endif
- X#endif
- X#ifdef SLOWstrstr
- X/*
- X * My personal strstr() implementation that beats most other algorithms.
- X * Until someone tells me otherwise, I assume that this is the
- X * fastest implementation of strstr() in C.
- X * I deliberately chose not to comment it. You should have at least
- X * as much fun trying to understand it, as I had to write it :-).
- X */
- Xtypedef unsigned chartype;
- X
- Xchar*sstrstr(phaystack,pneedle)const char*const phaystack;
- X const char*const pneedle;
- X{ register const uchar*haystack,*needle;register chartype b,c;
- X haystack=(const uchar*)phaystack;
- X if(b= *(needle=(const uchar*)pneedle))
- X { haystack--; /* possible ANSI violation */
- X do
- X if(!(c= *++haystack))
- X goto ret0;
- X while(c!=b);
- X if(!(c= *++needle))
- X goto foundneedle;
- X ++needle;
- X goto jin;
- X for(;;)
- X { ;{ register chartype a;
- X do
- X { if(!(a= *++haystack))
- X goto ret0;
- X if(a==b)
- X break;
- X if(!(a= *++haystack))
- X goto ret0;
- Xshloop:; }
- X while(a!=b);
- Xjin: if(!(a= *++haystack))
- X goto ret0;
- X if(a!=c)
- X goto shloop;
- X }
- X ;{ register chartype a;
- X ;{ register const uchar*rhaystack,*rneedle;
- X if(*(rhaystack=haystack--+1)==(a= *(rneedle=needle)))
- X do
- X { if(!a)
- X goto foundneedle;
- X if(*++rhaystack!=(a= *++needle))
- X break;
- X if(!a)
- X goto foundneedle;
- X }
- X while(*++rhaystack==(a= *++needle));
- X needle=rneedle; /* took the register-poor aproach */
- X }
- X if(!a)
- X break;
- X }
- X }
- X }
- Xfoundneedle:
- X return (char*)haystack;
- Xret0:
- X return (char*)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 ' ':
- X 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=(unsigned)*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 SLOWstrstr
- 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 4614 -ne `wc -c <'procmail-3.03/src/sublib.c'`; then
- echo shar: \"'procmail-3.03/src/sublib.c'\" unpacked with wrong size!
- fi
- # end of 'procmail-3.03/src/sublib.c'
- fi
- echo shar: End of archive 9 \(of 10\).
- cp /dev/null ark9isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 10 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-