home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-03 | 54.3 KB | 1,650 lines |
- Newsgroups: comp.sources.misc
- From: Raphael Manfredi <ram@acri.fr>
- Subject: v41i024: mailagent - Flexible mail filtering and processing package, v3.0, Part24/26
- Message-ID: <1993Dec3.213637.23311@sparky.sterling.com>
- X-Md4-Signature: 3bc2ea2f901a048742c6601dfc7294fd
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: Advanced Computer Research Institute, Lyon, France.
- Date: Fri, 3 Dec 1993 21:36:37 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: Raphael Manfredi <ram@acri.fr>
- Posting-number: Volume 41, Issue 24
- Archive-name: mailagent/part24
- Environment: UNIX, Perl
- Supersedes: mailagent: Volume 33, Issue 93-109
-
- #! /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".
- # The tool that generated this appeared in the comp.sources.unix newsgroup;
- # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
- # Contents: agent/examples/mchk agent/files/help/Jmakefile
- # agent/filter/Jmakefile agent/filter/io.h agent/filter/lock.h
- # agent/man/maildist.SH agent/man/maillist.SH agent/man/mailpatch.SH
- # agent/pl/hostname.pl agent/pl/jobnum.pl agent/pl/makedir.pl
- # agent/pl/plural.pl agent/test/cmd/annotate.t
- # agent/test/cmd/assign.t agent/test/cmd/back.t
- # agent/test/cmd/begin.t agent/test/cmd/give.t agent/test/cmd/pass.t
- # agent/test/cmd/pipe.t agent/test/cmd/purify.t
- # agent/test/cmd/reject.t agent/test/cmd/require.t
- # agent/test/cmd/restart.t agent/test/cmd/select.t
- # agent/test/cmd/unknown.t agent/test/filter/case.t
- # agent/test/filter/group.t agent/test/filter/loop.t
- # agent/test/filter/mode.t agent/test/filter/pattern.t
- # agent/test/filter/status.t agent/test/option/c.t
- # agent/test/option/i.t agent/test/pl/cmd.pl agent/test/pl/filter.pl
- # Wrapped by ram@soft208 on Mon Nov 29 16:49:58 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 24 (of 26)."'
- if test -f 'agent/examples/mchk' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/examples/mchk'\"
- else
- echo shar: Extracting \"'agent/examples/mchk'\" \(987 characters\)
- sed "s/^X//" >'agent/examples/mchk' <<'END_OF_FILE'
- X#! /bin/sh
- X# @(#) Scans all the mailboxes to spot any new mail
- X
- X# Compute location of the spool mailbox
- Xspool=/usr/spool/mail
- Xif test -d /usr/mail; then
- X spool=/usr/mail;
- Xfi
- Xspool=$spool/`(logname || whoami) 2>/dev/null`
- X
- X# First look for a ~/.mailfolders file, otherwise parse $MAILPATH, and
- X# finally use the spool mailbox if none of those worked.
- Xif test -f $HOME/.mailfolders; then
- X set X $spool \
- X `sed -e "/^[ ]*#/d" -e "s|^~|$HOME|" <$HOME/.mailfolders`
- Xelif test "$MAILPATH"; then
- X set X `echo $MAILPATH | tr ':' '\012'`
- Xelse
- X set X $spool
- Xfi
- Xshift
- X
- X# Loop over the computed locations and print the name of the mailboxes
- X# which are not empty. If a location is a directory, scan all the files
- X# found in that directory.
- Xfor location in $*
- Xdo
- X if test -d "$location"; then
- X for file in $location/*
- X do
- X if test -s "$file"; then
- X echo "$file"
- X fi
- X done
- X elif test -s "$location"; then
- X echo "$location"
- X elif test -s "$location.Z"; then
- X echo "$location.Z"
- X fi
- Xdone
- X
- END_OF_FILE
- if test 987 -ne `wc -c <'agent/examples/mchk'`; then
- echo shar: \"'agent/examples/mchk'\" unpacked with wrong size!
- fi
- chmod +x 'agent/examples/mchk'
- # end of 'agent/examples/mchk'
- fi
- if test -f 'agent/files/help/Jmakefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/files/help/Jmakefile'\"
- else
- echo shar: Extracting \"'agent/files/help/Jmakefile'\" \(952 characters\)
- sed "s/^X//" >'agent/files/help/Jmakefile' <<'END_OF_FILE'
- X/*
- X * Jmakefile for server help files.
- X */
- X
- X;# $Id: Jmakefile,v 3.0 1993/11/29 13:47:52 ram Exp ram $
- X;#
- X;# Copyright (c) 1990-1993, Raphael Manfredi
- X;#
- X;# You may redistribute only under the terms of the Artistic License,
- X;# as specified in the README file that comes with the distribution.
- X;# You may reuse parts of this distribution only within the terms of
- X;# that same Artistic License; a copy of which may be found at the root
- X;# of the source tree for mailagent 3.0.
- X;#
- X;# $Log: Jmakefile,v $
- X;# Revision 3.0 1993/11/29 13:47:52 ram
- X;# Baseline for mailagent 3.0 netwide release.
- X;#
- X
- XFILES = addauth approve delpower end getauth help newpower \
- X passwd password power release remauth set setauth user
- X
- X>PRIVLIB /* Force metaconfig to ask for privlib location */
- X
- Xall::
- X
- XNoManPages()
- XSimpleShellScriptTarget($(FILES))
- XMakeInstallDirectories($(PRIVLIB) $(PRIVLIB)/help)
- XInstallMultipleDestFlags(install,$(FILES),$(PRIVLIB)/help,-m 444)
- END_OF_FILE
- if test 952 -ne `wc -c <'agent/files/help/Jmakefile'`; then
- echo shar: \"'agent/files/help/Jmakefile'\" unpacked with wrong size!
- fi
- # end of 'agent/files/help/Jmakefile'
- fi
- if test -f 'agent/filter/Jmakefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/filter/Jmakefile'\"
- else
- echo shar: Extracting \"'agent/filter/Jmakefile'\" \(1032 characters\)
- sed "s/^X//" >'agent/filter/Jmakefile' <<'END_OF_FILE'
- X/*
- X * Jmakefile for filter
- X */
- X
- X;# $Id: Jmakefile,v 3.0 1993/11/29 13:48:04 ram Exp ram $
- X;#
- X;# Copyright (c) 1990-1993, Raphael Manfredi
- X;#
- X;# You may redistribute only under the terms of the Artistic License,
- X;# as specified in the README file that comes with the distribution.
- X;# You may reuse parts of this distribution only within the terms of
- X;# that same Artistic License; a copy of which may be found at the root
- X;# of the source tree for mailagent 3.0.
- X;#
- X;# $Log: Jmakefile,v $
- X;# Revision 3.0 1993/11/29 13:48:04 ram
- X;# Baseline for mailagent 3.0 netwide release.
- X;#
- X
- X;# Files used to build the application
- XSRC = environ.c hash.c io.c lock.c logfile.c main.c misc.c msg.c parser.c \
- X user.c
- X
- X;# Derived object file names
- XOBJ = \
- X|expand f!$(SRC)!
- X !f:\.c=.o \
- X-expand \\
- X
- X;# File config.h is in the top-level directory
- XCFLAGS = -I$(TOP)
- XDPFLAGS = -I$(TOP)
- X
- X>PRIVLIB /* Force metaconfig to ask for privlib location */
- X
- XDependTarget()
- XNormalProgramTarget(filter,$(SRC),$(OBJ))
- XInstallProgram(filter, $(PRIVLIB))
- END_OF_FILE
- if test 1032 -ne `wc -c <'agent/filter/Jmakefile'`; then
- echo shar: \"'agent/filter/Jmakefile'\" unpacked with wrong size!
- fi
- # end of 'agent/filter/Jmakefile'
- fi
- if test -f 'agent/filter/io.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/filter/io.h'\"
- else
- echo shar: Extracting \"'agent/filter/io.h'\" \(1000 characters\)
- sed "s/^X//" >'agent/filter/io.h' <<'END_OF_FILE'
- X/*
- X
- X # #### # #
- X # # # # #
- X # # # ######
- X # # # ### # #
- X # # # ### # #
- X # #### ### # #
- X
- X Declarations of I/O routines.
- X*/
- X
- X/*
- X * $Id: io.h,v 3.0 1993/11/29 13:48:11 ram Exp ram $
- X *
- X * Copyright (c) 1990-1993, Raphael Manfredi
- X *
- X * You may redistribute only under the terms of the Artistic License,
- X * as specified in the README file that comes with the distribution.
- X * You may reuse parts of this distribution only within the terms of
- X * that same Artistic License; a copy of which may be found at the root
- X * of the source tree for mailagent 3.0.
- X *
- X * $Log: io.h,v $
- X * Revision 3.0 1993/11/29 13:48:11 ram
- X * Baseline for mailagent 3.0 netwide release.
- X *
- X */
- X
- X#ifndef _io_h_
- X#define _io_h_
- X
- Xextern void process(); /* Process mail */
- Xextern int emergency_save(); /* Save mail in emeregency file */
- Xextern int was_queued(); /* Was mail safely queued or not? */
- X
- X#endif
- END_OF_FILE
- if test 1000 -ne `wc -c <'agent/filter/io.h'`; then
- echo shar: \"'agent/filter/io.h'\" unpacked with wrong size!
- fi
- # end of 'agent/filter/io.h'
- fi
- if test -f 'agent/filter/lock.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/filter/lock.h'\"
- else
- echo shar: Extracting \"'agent/filter/lock.h'\" \(1097 characters\)
- sed "s/^X//" >'agent/filter/lock.h' <<'END_OF_FILE'
- X/*
- X
- X # #### #### # # # #
- X # # # # # # # # #
- X # # # # #### ######
- X # # # # # # ### # #
- X # # # # # # # ### # #
- X ###### #### #### # # ### # #
- X
- X Declarations for locking routines.
- X*/
- X
- X/*
- X * $Id: lock.h,v 3.0 1993/11/29 13:48:12 ram Exp ram $
- X *
- X * Copyright (c) 1990-1993, Raphael Manfredi
- X *
- X * You may redistribute only under the terms of the Artistic License,
- X * as specified in the README file that comes with the distribution.
- X * You may reuse parts of this distribution only within the terms of
- X * that same Artistic License; a copy of which may be found at the root
- X * of the source tree for mailagent 3.0.
- X *
- X * $Log: lock.h,v $
- X * Revision 3.0 1993/11/29 13:48:12 ram
- X * Baseline for mailagent 3.0 netwide release.
- X *
- X */
- X
- X#ifndef _lock_h_
- X#define _lock_h_
- X
- Xextern int filter_lock(); /* Lock filter */
- Xextern void release_lock(); /* Release lock if necessary */
- Xextern int is_locked(); /* Do we have a lock file? */
- X
- X#endif
- END_OF_FILE
- if test 1097 -ne `wc -c <'agent/filter/lock.h'`; then
- echo shar: \"'agent/filter/lock.h'\" unpacked with wrong size!
- fi
- # end of 'agent/filter/lock.h'
- fi
- if test -f 'agent/man/maildist.SH' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/man/maildist.SH'\"
- else
- echo shar: Extracting \"'agent/man/maildist.SH'\" \(1163 characters\)
- sed "s/^X//" >'agent/man/maildist.SH' <<'END_OF_FILE'
- Xcase $CONFIG in
- X'')
- X if test -f config.sh; then TOP=.;
- X elif test -f ../config.sh; then TOP=..;
- X elif test -f ../../config.sh; then TOP=../..;
- X elif test -f ../../../config.sh; then TOP=../../..;
- X elif test -f ../../../../config.sh; then TOP=../../../..;
- X else
- X echo "Can't find config.sh."; exit 1
- X fi
- X . $TOP/config.sh
- X ;;
- Xesac
- Xcase "$0" in
- X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
- Xesac
- Xecho "Extracting agent/man/maildist.$manext (with variable substitutions)"
- X$rm -f maildist.$manext
- X$spitshell >maildist.$manext <<!GROK!THIS!
- X.so $mansrc/mailhelp.$manext
- X''' $Id: maildist.SH,v 3.0 1993/11/29 13:48:28 ram Exp ram $
- X'''
- X''' Copyright (c) 1990-1993, Raphael Manfredi
- X'''
- X''' You may redistribute only under the terms of the Artistic License,
- X''' as specified in the README file that comes with the distribution.
- X''' You may reuse parts of this distribution only within the terms of
- X''' that same Artistic License; a copy of which may be found at the root
- X''' of the source tree for mailagent 3.0.
- X'''
- X''' $Log: maildist.SH,v $
- X# Revision 3.0 1993/11/29 13:48:28 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X!GROK!THIS!
- Xchmod 444 maildist.$manext
- END_OF_FILE
- if test 1163 -ne `wc -c <'agent/man/maildist.SH'`; then
- echo shar: \"'agent/man/maildist.SH'\" unpacked with wrong size!
- fi
- chmod +x 'agent/man/maildist.SH'
- # end of 'agent/man/maildist.SH'
- fi
- if test -f 'agent/man/maillist.SH' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/man/maillist.SH'\"
- else
- echo shar: Extracting \"'agent/man/maillist.SH'\" \(1163 characters\)
- sed "s/^X//" >'agent/man/maillist.SH' <<'END_OF_FILE'
- Xcase $CONFIG in
- X'')
- X if test -f config.sh; then TOP=.;
- X elif test -f ../config.sh; then TOP=..;
- X elif test -f ../../config.sh; then TOP=../..;
- X elif test -f ../../../config.sh; then TOP=../../..;
- X elif test -f ../../../../config.sh; then TOP=../../../..;
- X else
- X echo "Can't find config.sh."; exit 1
- X fi
- X . $TOP/config.sh
- X ;;
- Xesac
- Xcase "$0" in
- X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
- Xesac
- Xecho "Extracting agent/man/maillist.$manext (with variable substitutions)"
- X$rm -f maillist.$manext
- X$spitshell >maillist.$manext <<!GROK!THIS!
- X.so $mansrc/mailhelp.$manext
- X''' $Id: maillist.SH,v 3.0 1993/11/29 13:48:30 ram Exp ram $
- X'''
- X''' Copyright (c) 1990-1993, Raphael Manfredi
- X'''
- X''' You may redistribute only under the terms of the Artistic License,
- X''' as specified in the README file that comes with the distribution.
- X''' You may reuse parts of this distribution only within the terms of
- X''' that same Artistic License; a copy of which may be found at the root
- X''' of the source tree for mailagent 3.0.
- X'''
- X''' $Log: maillist.SH,v $
- X# Revision 3.0 1993/11/29 13:48:30 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X!GROK!THIS!
- Xchmod 444 maillist.$manext
- END_OF_FILE
- if test 1163 -ne `wc -c <'agent/man/maillist.SH'`; then
- echo shar: \"'agent/man/maillist.SH'\" unpacked with wrong size!
- fi
- chmod +x 'agent/man/maillist.SH'
- # end of 'agent/man/maillist.SH'
- fi
- if test -f 'agent/man/mailpatch.SH' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/man/mailpatch.SH'\"
- else
- echo shar: Extracting \"'agent/man/mailpatch.SH'\" \(1166 characters\)
- sed "s/^X//" >'agent/man/mailpatch.SH' <<'END_OF_FILE'
- Xcase $CONFIG in
- X'')
- X if test -f config.sh; then TOP=.;
- X elif test -f ../config.sh; then TOP=..;
- X elif test -f ../../config.sh; then TOP=../..;
- X elif test -f ../../../config.sh; then TOP=../../..;
- X elif test -f ../../../../config.sh; then TOP=../../../..;
- X else
- X echo "Can't find config.sh."; exit 1
- X fi
- X . $TOP/config.sh
- X ;;
- Xesac
- Xcase "$0" in
- X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
- Xesac
- Xecho "Extracting agent/man/mailpatch.$manext (with variable substitutions)"
- X$rm -f mailpatch.$manext
- X$spitshell >mailpatch.$manext <<!GROK!THIS!
- X.so $mansrc/mailhelp.$manext
- X'''
- X''' $Id: mailpatch.SH,v 3.0 1993/11/29 13:48:30 ram Exp ram $
- X'''
- X''' Copyright (c) 1990-1993, Raphael Manfredi
- X'''
- X''' You may redistribute only under the terms of the Artistic License,
- X''' as specified in the README file that comes with the distribution.
- X''' You may reuse parts of this distribution only within the terms of
- X''' that same Artistic License; a copy of which may be found at the root
- X''' of the source tree for mailagent 3.0.
- X'''
- X''' $Log: mailpatch.SH,v $
- X# Revision 3.0 1993/11/29 13:48:30 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X!GROK!THIS!
- Xchmod 444 mailpatch.$manext
- END_OF_FILE
- if test 1166 -ne `wc -c <'agent/man/mailpatch.SH'`; then
- echo shar: \"'agent/man/mailpatch.SH'\" unpacked with wrong size!
- fi
- chmod +x 'agent/man/mailpatch.SH'
- # end of 'agent/man/mailpatch.SH'
- fi
- if test -f 'agent/pl/hostname.pl' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/pl/hostname.pl'\"
- else
- echo shar: Extracting \"'agent/pl/hostname.pl'\" \(996 characters\)
- sed "s/^X//" >'agent/pl/hostname.pl' <<'END_OF_FILE'
- X;# $Id: hostname.pl,v 3.0 1993/11/29 13:48:52 ram Exp ram $
- X;#
- X;# Copyright (c) 1990-1993, Raphael Manfredi
- X;#
- X;# You may redistribute only under the terms of the Artistic License,
- X;# as specified in the README file that comes with the distribution.
- X;# You may reuse parts of this distribution only within the terms of
- X;# that same Artistic License; a copy of which may be found at the root
- X;# of the source tree for mailagent 3.0.
- X;#
- X;# $Log: hostname.pl,v $
- X;# Revision 3.0 1993/11/29 13:48:52 ram
- X;# Baseline for mailagent 3.0 netwide release.
- X;#
- X;#
- X# Return only the hostname portion of the host name (no domain name)
- Xsub myhostname {
- X local($_) = &hostname;
- X s/^([^.]*)\..*/$1/; # Trim down domain name
- X $_;
- X}
- X
- X# Compute hostname once and for all and cache its value (since we have to fork
- X# to get it).
- Xsub hostname {
- X unless ($cache'hostname) {
- X chop($cache'hostname = `$phostname`);
- X $cache'hostname =~ tr/A-Z/a-z/; # Cannonicalize to lower case
- X }
- X $cache'hostname;
- X}
- X
- END_OF_FILE
- if test 996 -ne `wc -c <'agent/pl/hostname.pl'`; then
- echo shar: \"'agent/pl/hostname.pl'\" unpacked with wrong size!
- fi
- # end of 'agent/pl/hostname.pl'
- fi
- if test -f 'agent/pl/jobnum.pl' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/pl/jobnum.pl'\"
- else
- echo shar: Extracting \"'agent/pl/jobnum.pl'\" \(1153 characters\)
- sed "s/^X//" >'agent/pl/jobnum.pl' <<'END_OF_FILE'
- X;# $Id: jobnum.pl,v 3.0 1993/11/29 13:48:54 ram Exp ram $
- X;#
- X;# Copyright (c) 1990-1993, Raphael Manfredi
- X;#
- X;# You may redistribute only under the terms of the Artistic License,
- X;# as specified in the README file that comes with the distribution.
- X;# You may reuse parts of this distribution only within the terms of
- X;# that same Artistic License; a copy of which may be found at the root
- X;# of the source tree for mailagent 3.0.
- X;#
- X;# $Log: jobnum.pl,v $
- X;# Revision 3.0 1993/11/29 13:48:54 ram
- X;# Baseline for mailagent 3.0 netwide release.
- X;#
- X;#
- X;# Depends on the following external routines:
- X;# checklock() to check for locks older than one hour (via acs_rqst)
- X;# acs_rqst() to get a lock on file
- X;# free_file() to release lock on file
- X;#
- X# Computes a new job number
- Xsub jobnum {
- X local($job); # Computed job number
- X if (0 != &acs_rqst($cf'seqfile)) {
- X $job = "?";
- X } else {
- X local($njob);
- X open(FILE, "$cf'seqfile");
- X $njob = int(<FILE>);
- X close FILE;
- X $njob++;
- X open(FILE, ">$cf'seqfile");
- X print FILE "$njob\n";
- X close FILE;
- X $job = "$njob";
- X &free_file("$cf'seqfile");
- X }
- X $job; # Return job number to be used
- X}
- X
- END_OF_FILE
- if test 1153 -ne `wc -c <'agent/pl/jobnum.pl'`; then
- echo shar: \"'agent/pl/jobnum.pl'\" unpacked with wrong size!
- fi
- # end of 'agent/pl/jobnum.pl'
- fi
- if test -f 'agent/pl/makedir.pl' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/pl/makedir.pl'\"
- else
- echo shar: Extracting \"'agent/pl/makedir.pl'\" \(1158 characters\)
- sed "s/^X//" >'agent/pl/makedir.pl' <<'END_OF_FILE'
- X;# $Id: makedir.pl,v 3.0 1993/11/29 13:48:59 ram Exp ram $
- X;#
- X;# Copyright (c) 1990-1993, Raphael Manfredi
- X;#
- X;# You may redistribute only under the terms of the Artistic License,
- X;# as specified in the README file that comes with the distribution.
- X;# You may reuse parts of this distribution only within the terms of
- X;# that same Artistic License; a copy of which may be found at the root
- X;# of the source tree for mailagent 3.0.
- X;#
- X;# $Log: makedir.pl,v $
- X;# Revision 3.0 1993/11/29 13:48:59 ram
- X;# Baseline for mailagent 3.0 netwide release.
- X;#
- X;#
- X# Make directories for files
- X# E.g, for /usr/lib/perl/foo, it will check for all the
- X# directories /usr, /usr/lib, /usr/lib/perl and make
- X# them if they do not exist.
- Xsub makedir {
- X local($dir, $mode) = @_; # directory name, mode (optional)
- X local($parent);
- X $mode = 0700 unless defined $mode;
- X if (!-d $dir && $dir ne '') {
- X # Make parent dir first
- X &makedir($parent, $mode) if ($parent = $dir) =~ s|(.*)/.*|\1|;
- X if (mkdir($dir, $mode)) {
- X &add_log("creating directory $dir") if $loglvl > 19;
- X } else {
- X &add_log("ERROR cannot create directory $dir: $!")
- X if $loglvl > 1;
- X }
- X }
- X}
- X
- END_OF_FILE
- if test 1158 -ne `wc -c <'agent/pl/makedir.pl'`; then
- echo shar: \"'agent/pl/makedir.pl'\" unpacked with wrong size!
- fi
- # end of 'agent/pl/makedir.pl'
- fi
- if test -f 'agent/pl/plural.pl' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/pl/plural.pl'\"
- else
- echo shar: Extracting \"'agent/pl/plural.pl'\" \(1042 characters\)
- sed "s/^X//" >'agent/pl/plural.pl' <<'END_OF_FILE'
- X;# $Id: plural.pl,v 3.0 1993/11/29 13:49:07 ram Exp ram $
- X;#
- X;# Copyright (c) 1990-1993, Raphael Manfredi
- X;#
- X;# You may redistribute only under the terms of the Artistic License,
- X;# as specified in the README file that comes with the distribution.
- X;# You may reuse parts of this distribution only within the terms of
- X;# that same Artistic License; a copy of which may be found at the root
- X;# of the source tree for mailagent 3.0.
- X;#
- X;# $Log: plural.pl,v $
- X;# Revision 3.0 1993/11/29 13:49:07 ram
- X;# Baseline for mailagent 3.0 netwide release.
- X;#
- X;#
- X# Pluralize names -- Adapted from a routine posted by Tom Christiansen in
- X# comp.lang.perl on June 20th, 1992.
- Xsub plural {
- X local($_, $n) = @_; # Word and amount (plural if not specified)
- X $n = 2 if $n eq ''; # Pluralize word by default
- X if ($n != 1) { # 0 something is plural
- X if ($_ eq 'was') {
- X $_ = 'were';
- X } else {
- X s/y$/ies/ || s/s$/ses/ || s/([cs]h)$/$1es/ ||
- X s/sis$/ses/ || s/ium$/ia/ || s/$/s/;
- X }
- X }
- X "$_"; # How to write $n times the original $_
- X}
- X
- END_OF_FILE
- if test 1042 -ne `wc -c <'agent/pl/plural.pl'`; then
- echo shar: \"'agent/pl/plural.pl'\" unpacked with wrong size!
- fi
- # end of 'agent/pl/plural.pl'
- fi
- if test -f 'agent/test/cmd/annotate.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/cmd/annotate.t'\"
- else
- echo shar: Extracting \"'agent/test/cmd/annotate.t'\" \(991 characters\)
- sed "s/^X//" >'agent/test/cmd/annotate.t' <<'END_OF_FILE'
- X# Test ANNOTATE command
- X
- X# $Id: annotate.t,v 3.0 1993/11/29 13:49:26 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: annotate.t,v $
- X# Revision 3.0 1993/11/29 13:49:26 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/cmd.pl';
- X
- X&add_header('X-Tag: annotate');
- X`$cmd`;
- X$? == 0 || print "1\n";
- X-f "$user" || print "2\n"; # No match -> leave
- X&get_log(3, $user);
- X&check_log('^X-Anno-1:', 4) == 2 || print "5\n";
- X&check_log('^X-Anno-2:', 6) == 2 || print "7\n";
- X&check_log('^X-Anno-3:', 8) == 1 || print "9\n";
- X&check_log('^X-Anno-4:', 10) == 1 || print "11\n";
- X¬_log('^X-Anno-Error:', 12);
- X
- Xunlink "$user", 'mail';
- Xprint "0\n";
- END_OF_FILE
- if test 991 -ne `wc -c <'agent/test/cmd/annotate.t'`; then
- echo shar: \"'agent/test/cmd/annotate.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/cmd/annotate.t'
- fi
- if test -f 'agent/test/cmd/assign.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/cmd/assign.t'\"
- else
- echo shar: Extracting \"'agent/test/cmd/assign.t'\" \(1087 characters\)
- sed "s/^X//" >'agent/test/cmd/assign.t' <<'END_OF_FILE'
- X# Test ASSIGN command
- X
- X# $Id: assign.t,v 3.0 1993/11/29 13:49:27 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: assign.t,v $
- X# Revision 3.0 1993/11/29 13:49:27 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/cmd.pl';
- Xunlink 'output';
- X
- X&add_header('X-Tag: assign #1');
- X`$cmd`;
- X$? == 0 || print "1\n";
- X-f 'output' || print "2\n"; # Result of various assign commands
- Xchop($output = `cat output 2>/dev/null`);
- X$output eq 'ram,try,try.2' || print "3\n";
- Xunlink 'output';
- X
- X&replace_header('X-Tag: assign #2');
- X`$cmd`;
- X$? == 0 || print "4\n";
- X-f 'output' || print "5\n"; # Result of various assign commands
- Xchop($output = `cat output 2>/dev/null`);
- X$output eq '7,1+2,7' || print "6\n";
- X
- Xunlink 'output', 'mail';
- Xprint "0\n";
- END_OF_FILE
- if test 1087 -ne `wc -c <'agent/test/cmd/assign.t'`; then
- echo shar: \"'agent/test/cmd/assign.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/cmd/assign.t'
- fi
- if test -f 'agent/test/cmd/back.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/cmd/back.t'\"
- else
- echo shar: Extracting \"'agent/test/cmd/back.t'\" \(1097 characters\)
- sed "s/^X//" >'agent/test/cmd/back.t' <<'END_OF_FILE'
- X# Test BACK command
- X
- X# $Id: back.t,v 3.0 1993/11/29 13:49:28 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: back.t,v $
- X# Revision 3.0 1993/11/29 13:49:28 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/cmd.pl';
- Xunlink 'output';
- X
- Xopen(PGM, ">pgm") || print "1\n";
- Xprint PGM '/bin/echo "RUN /bin/echo it works! > output; SAVE other"', "\n";
- Xclose PGM;
- Xchmod 0755, 'pgm';
- X
- X&add_header('X-Tag: back');
- X`$cmd`;
- X$? == 0 || print "2\n";
- X-f 'output' || print "3\n"; # Where output is created
- Xchop($output = `cat output 2>/dev/null`);
- X$output eq 'it works!' || print "4\n";
- X-f 'other' || print "5\n"; # Mail also saved
- X-f "$user" && print "6\n"; # So default action does not apply
- X
- Xunlink 'pgm', 'output', 'mail', 'other';
- Xprint "0\n";
- END_OF_FILE
- if test 1097 -ne `wc -c <'agent/test/cmd/back.t'`; then
- echo shar: \"'agent/test/cmd/back.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/cmd/back.t'
- fi
- if test -f 'agent/test/cmd/begin.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/cmd/begin.t'\"
- else
- echo shar: Extracting \"'agent/test/cmd/begin.t'\" \(946 characters\)
- sed "s/^X//" >'agent/test/cmd/begin.t' <<'END_OF_FILE'
- X# Test BEGIN command
- X
- X# $Id: begin.t,v 3.0 1993/11/29 13:49:28 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: begin.t,v $
- X# Revision 3.0 1993/11/29 13:49:28 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/cmd.pl';
- Xunlink 'one', 'two', 'three';
- X
- X&add_header('X-Tag: begin');
- X`$cmd`;
- X$? == 0 || print "1\n";
- X-f 'one' && print "2\n"; # Cannot happen in TWO mode
- X-f 'two' || print "3\n"; # Must be saved here
- X-f 'three' || print "4\n"; # And also here by THREE mode
- X-f "$user" && print "5\n"; # So default action did not apply
- X
- Xunlink 'one', 'two', 'three', 'mail';
- Xprint "0\n";
- END_OF_FILE
- if test 946 -ne `wc -c <'agent/test/cmd/begin.t'`; then
- echo shar: \"'agent/test/cmd/begin.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/cmd/begin.t'
- fi
- if test -f 'agent/test/cmd/give.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/cmd/give.t'\"
- else
- echo shar: Extracting \"'agent/test/cmd/give.t'\" \(1033 characters\)
- sed "s/^X//" >'agent/test/cmd/give.t' <<'END_OF_FILE'
- X# Test GIVE command
- X
- X# $Id: give.t,v 3.0 1993/11/29 13:49:32 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: give.t,v $
- X# Revision 3.0 1993/11/29 13:49:32 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/cmd.pl';
- Xunlink 'output';
- X
- X&add_header('X-Tag: give');
- X`$cmd`;
- X$? == 0 || print "1\n";
- X-f 'output' || print "2\n"; # Where output is created
- Xchop($output = `cat output 2>/dev/null`);
- X@output = split(' ', $output);
- X@valid = (17, 132, 804); # Output of wc on body
- X$ok = 1;
- Xfor ($i = 0; $i < 3; $i++) {
- X $ok = 0 if $valid[$i] != $output[$i];
- X}
- X$ok || print "3\n";
- X-f "$user" || print "4\n"; # Default action applies
- X
- Xunlink 'output', 'mail', "$user";
- Xprint "0\n";
- END_OF_FILE
- if test 1033 -ne `wc -c <'agent/test/cmd/give.t'`; then
- echo shar: \"'agent/test/cmd/give.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/cmd/give.t'
- fi
- if test -f 'agent/test/cmd/pass.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/cmd/pass.t'\"
- else
- echo shar: Extracting \"'agent/test/cmd/pass.t'\" \(998 characters\)
- sed "s/^X//" >'agent/test/cmd/pass.t' <<'END_OF_FILE'
- X# The PASS command
- X
- X# $Id: pass.t,v 3.0 1993/11/29 13:49:37 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: pass.t,v $
- X# Revision 3.0 1993/11/29 13:49:37 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/cmd.pl';
- Xunlink 'output';
- X
- X&add_header('X-Tag: pass');
- X`$cmd`;
- X$? == 0 || print "1\n";
- X-f 'output' || print "2\n"; # Where mail is saved
- X`grep -v X-Filter: output > comp`;
- X$? == 0 || print "3\n";
- X`grep -v and mail > ok`;
- X((-s 'comp') - 1) == -s 'ok' || print "4\n"; # SAVE adds extra final new-line
- X-s 'comp' != -s 'output' || print "5\n"; # Casually check X-Filter was there
- X
- Xunlink 'output', 'mail', 'ok', 'comp';
- Xprint "0\n";
- END_OF_FILE
- if test 998 -ne `wc -c <'agent/test/cmd/pass.t'`; then
- echo shar: \"'agent/test/cmd/pass.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/cmd/pass.t'
- fi
- if test -f 'agent/test/cmd/pipe.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/cmd/pipe.t'\"
- else
- echo shar: Extracting \"'agent/test/cmd/pipe.t'\" \(1056 characters\)
- sed "s/^X//" >'agent/test/cmd/pipe.t' <<'END_OF_FILE'
- X# The PIPE command
- X
- X# $Id: pipe.t,v 3.0 1993/11/29 13:49:39 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: pipe.t,v $
- X# Revision 3.0 1993/11/29 13:49:39 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/cmd.pl';
- Xunlink 'output';
- X
- X&add_header('X-Tag: pipe');
- X`$cmd`;
- X$? == 0 || print "1\n";
- X-f 'output' || print "2\n"; # Where output is created
- Xchop($output = `cat output 2>/dev/null`);
- X@output = split(' ', $output);
- X@valid = (35, 229, 1632); # Output of wc on whole mail with X-Tag field
- X$ok = 1;
- Xfor ($i = 0; $i < 3; $i++) {
- X $ok = 0 if $valid[$i] != $output[$i];
- X}
- X$ok || print "3\n";
- X-f "$user" || print "4\n"; # Default action applies
- X
- Xunlink 'output', 'mail', "$user";
- Xprint "0\n";
- END_OF_FILE
- if test 1056 -ne `wc -c <'agent/test/cmd/pipe.t'`; then
- echo shar: \"'agent/test/cmd/pipe.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/cmd/pipe.t'
- fi
- if test -f 'agent/test/cmd/purify.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/cmd/purify.t'\"
- else
- echo shar: Extracting \"'agent/test/cmd/purify.t'\" \(1011 characters\)
- sed "s/^X//" >'agent/test/cmd/purify.t' <<'END_OF_FILE'
- X# The PURIFY command
- X
- X# $Id: purify.t,v 3.0 1993/11/29 13:49:41 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: purify.t,v $
- X# Revision 3.0 1993/11/29 13:49:41 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/cmd.pl';
- Xunlink 'output';
- X
- X&add_header('X-Tag: purify');
- X`$cmd`;
- X$? == 0 || print "1\n";
- X-f 'output' || print "2\n"; # Where mail is saved
- X`grep -v X-Filter: output > comp`;
- X$? == 0 || print "3\n";
- X`grep -v Subject: mail > ok`;
- X((-s 'comp') - 1) == -s 'ok' || print "4\n"; # SAVE adds extra final new-line
- X-s 'comp' != -s 'output' || print "5\n"; # Casually check X-Filter was there
- X
- Xunlink 'output', 'mail', 'ok', 'comp';
- Xprint "0\n";
- END_OF_FILE
- if test 1011 -ne `wc -c <'agent/test/cmd/purify.t'`; then
- echo shar: \"'agent/test/cmd/purify.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/cmd/purify.t'
- fi
- if test -f 'agent/test/cmd/reject.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/cmd/reject.t'\"
- else
- echo shar: Extracting \"'agent/test/cmd/reject.t'\" \(980 characters\)
- sed "s/^X//" >'agent/test/cmd/reject.t' <<'END_OF_FILE'
- X# The REJECT command
- X
- X# $Id: reject.t,v 3.0 1993/11/29 13:49:44 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: reject.t,v $
- X# Revision 3.0 1993/11/29 13:49:44 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/cmd.pl';
- Xunlink "$user.1", 'always', 'never';
- X
- X# Make sure everything after a REJECT is not executed
- X&add_header('X-Tag: reject');
- X`$cmd`;
- X$? == 0 || print "1\n";
- X-f "$user" || print "2\n"; # REJECT -> no match -> leave
- X-f "$user.1" && print "3\n"; # This SAVE was after the REJECT
- X-f 'always' || print "4\n";
- X-f 'never' && print "5\n";
- X
- Xunlink "$user.1", "$user", 'always', 'never', 'mail';
- Xprint "0\n";
- END_OF_FILE
- if test 980 -ne `wc -c <'agent/test/cmd/reject.t'`; then
- echo shar: \"'agent/test/cmd/reject.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/cmd/reject.t'
- fi
- if test -f 'agent/test/cmd/require.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/cmd/require.t'\"
- else
- echo shar: Extracting \"'agent/test/cmd/require.t'\" \(1112 characters\)
- sed "s/^X//" >'agent/test/cmd/require.t' <<'END_OF_FILE'
- X# Test REQUIRE command
- X
- X# $Id: require.t,v 3.0 1993/11/29 13:49:45 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: require.t,v $
- X# Revision 3.0 1993/11/29 13:49:45 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/cmd.pl';
- Xunlink 'perl.1', 'perl.2', 'never', 'ok';
- X
- Xopen(PERL, ">perl.1") || print "1\n";
- Xprint PERL <<'EOP';
- Xsub perl_1 {
- X local($name) = @_;
- X $name;
- X}
- XEOP
- Xclose PERL;
- X
- Xopen(PERL, ">perl.2") || print "2\n";
- Xprint PERL <<'EOP';
- X$var = "perl_2";
- X
- Xsub perl_2 {
- X $var;
- X}
- XEOP
- Xclose PERL;
- X
- X&add_header('X-Tag: require');
- X`$cmd`;
- X$? == 0 || print "3\n";
- X-f "$user" && print "4\n";
- X-f 'never' && print "5\n";
- X&get_log(6, 'ok');
- X&check_log('^We got perl_1 and perl_2 here', 7);
- X
- Xunlink 'mail', 'perl.1', 'perl.2', 'never', 'ok';
- Xprint "0\n";
- END_OF_FILE
- if test 1112 -ne `wc -c <'agent/test/cmd/require.t'`; then
- echo shar: \"'agent/test/cmd/require.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/cmd/require.t'
- fi
- if test -f 'agent/test/cmd/restart.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/cmd/restart.t'\"
- else
- echo shar: Extracting \"'agent/test/cmd/restart.t'\" \(947 characters\)
- sed "s/^X//" >'agent/test/cmd/restart.t' <<'END_OF_FILE'
- X# The RESTART command
- X
- X# $Id: restart.t,v 3.0 1993/11/29 13:49:46 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: restart.t,v $
- X# Revision 3.0 1993/11/29 13:49:46 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/cmd.pl';
- Xunlink "$user.1", 'never';
- X
- X# Make sure everything after a RESTART is not executed
- X&add_header('X-Tag: restart');
- X`$cmd`;
- X$? == 0 || print "1\n";
- X-f "$user" || print "2\n"; # RESTART -> no match -> leave
- X-f "$user.1" && print "3\n"; # This SAVE was after the RESTART
- X-f 'never' && print "4\n"; # Idem
- X
- Xunlink "$user.1", "$user", 'never', 'mail';
- Xprint "0\n";
- END_OF_FILE
- if test 947 -ne `wc -c <'agent/test/cmd/restart.t'`; then
- echo shar: \"'agent/test/cmd/restart.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/cmd/restart.t'
- fi
- if test -f 'agent/test/cmd/select.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/cmd/select.t'\"
- else
- echo shar: Extracting \"'agent/test/cmd/select.t'\" \(934 characters\)
- sed "s/^X//" >'agent/test/cmd/select.t' <<'END_OF_FILE'
- X# The SELECT command
- X
- X# $Id: select.t,v 3.0 1993/11/29 13:49:48 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: select.t,v $
- X# Revision 3.0 1993/11/29 13:49:48 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/cmd.pl';
- Xunlink 'one', 'two', 'three', 'four', 'five', "$user";
- X
- X&add_header('X-Tag: select');
- X`$cmd`;
- X$? == 0 || print "1\n";
- X-f "$user" && print "2\n";
- X-f 'one' || print "3\n";
- X-f 'two' && print "4\n";
- X-f 'three' || print "5\n";
- X-f 'four' || print "6\n";
- X-f 'five' && print "7\n";
- X
- Xunlink 'one', 'two', 'three', 'four', 'five', "$user", 'mail';
- Xprint "0\n";
- END_OF_FILE
- if test 934 -ne `wc -c <'agent/test/cmd/select.t'`; then
- echo shar: \"'agent/test/cmd/select.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/cmd/select.t'
- fi
- if test -f 'agent/test/cmd/unknown.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/cmd/unknown.t'\"
- else
- echo shar: Extracting \"'agent/test/cmd/unknown.t'\" \(956 characters\)
- sed "s/^X//" >'agent/test/cmd/unknown.t' <<'END_OF_FILE'
- X# Ensure unknown command defaults to LEAVE only when no saving was done
- X
- X# $Id: unknown.t,v 3.0 1993/11/29 13:49:54 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: unknown.t,v $
- X# Revision 3.0 1993/11/29 13:49:54 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/cmd.pl';
- Xunlink "$user";
- X
- X&add_header('X-Tag: unknown #1');
- X`$cmd`;
- X$? == 0 || print "1\n";
- X-f "$user" || print "2\n"; # Unknown was first
- Xunlink "$user";
- X
- X&replace_header('X-Tag: unknown #2');
- X`$cmd`;
- X$? == 0 || print "3\n";
- X-f "$user" && print "4\n"; # Unknown after saving status known
- X
- Xunlink "$user", 'mail';
- Xprint "0\n";
- END_OF_FILE
- if test 956 -ne `wc -c <'agent/test/cmd/unknown.t'`; then
- echo shar: \"'agent/test/cmd/unknown.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/cmd/unknown.t'
- fi
- if test -f 'agent/test/filter/case.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/filter/case.t'\"
- else
- echo shar: Extracting \"'agent/test/filter/case.t'\" \(945 characters\)
- sed "s/^X//" >'agent/test/filter/case.t' <<'END_OF_FILE'
- X# Check header field case insensitiveness
- X
- X# $Id: case.t,v 3.0 1993/11/29 13:49:57 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: case.t,v $
- X# Revision 3.0 1993/11/29 13:49:57 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/filter.pl';
- Xdo '../pl/logfile.pl';
- Xunlink 'always';
- X
- X&add_header('x-tag: case');
- X&add_header('CC: root');
- X`$cmd`;
- X$? == 0 || print "1\n";
- X-f "$user" && print "2\n"; # No default action
- X-f 'always' || print "3\n"; # Recognized both X-Tag and CC
- X
- X&get_log(4, 'always');
- X¬_log('CC:', 5); # CC was STRIPed out
- X
- Xunlink 'always', "$user";
- Xprint "0\n";
- END_OF_FILE
- if test 945 -ne `wc -c <'agent/test/filter/case.t'`; then
- echo shar: \"'agent/test/filter/case.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/filter/case.t'
- fi
- if test -f 'agent/test/filter/group.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/filter/group.t'\"
- else
- echo shar: Extracting \"'agent/test/filter/group.t'\" \(1021 characters\)
- sed "s/^X//" >'agent/test/filter/group.t' <<'END_OF_FILE'
- X# Test grouping of selectors (mixing normal and inverted selections)
- X
- X# $Id: group.t,v 3.0 1993/11/29 13:49:59 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: group.t,v $
- X# Revision 3.0 1993/11/29 13:49:59 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/filter.pl';
- Xunlink 'never', 'always', 'always.2', 'always.3';
- X
- X&add_header('X-Tag: group');
- X`$cmd`;
- X$? == 0 || print "1\n";
- X-f "$user" && print "2\n"; # Mail has been deleted
- X-f 'never' && print "3\n"; # Cannot match
- X-f 'always' || print "4\n"; # This one must have matched
- X-f 'always.2' || print "5\n";
- X-f 'always.3' || print "6\n";
- X
- Xunlink 'never', 'always', 'always.2', 'always.3';
- Xprint "0\n";
- END_OF_FILE
- if test 1021 -ne `wc -c <'agent/test/filter/group.t'`; then
- echo shar: \"'agent/test/filter/group.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/filter/group.t'
- fi
- if test -f 'agent/test/filter/loop.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/filter/loop.t'\"
- else
- echo shar: Extracting \"'agent/test/filter/loop.t'\" \(932 characters\)
- sed "s/^X//" >'agent/test/filter/loop.t' <<'END_OF_FILE'
- X# Ensure loops are detected
- X
- X# $Id: loop.t,v 3.0 1993/11/29 13:50:02 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: loop.t,v $
- X# Revision 3.0 1993/11/29 13:50:02 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/filter.pl';
- X
- X&add_header('X-Tag: loop #1');
- X`$cmd`;
- X$? == 0 || print "1\n";
- X-f "$user" || print "2\n"; # Loop was detected (otherwise never ends)
- X
- X`mv $user mail 2>/dev/null`;
- X&replace_header('X-Tag: loop #2');
- X`$cmd`;
- X$? == 0 || print "3\n";
- X-f "$user" || print "4\n"; # Loop was detected (otherwise mail deleted)
- X
- Xunlink 'mail', "$user";
- Xprint "0\n";
- END_OF_FILE
- if test 932 -ne `wc -c <'agent/test/filter/loop.t'`; then
- echo shar: \"'agent/test/filter/loop.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/filter/loop.t'
- fi
- if test -f 'agent/test/filter/mode.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/filter/mode.t'\"
- else
- echo shar: Extracting \"'agent/test/filter/mode.t'\" \(1015 characters\)
- sed "s/^X//" >'agent/test/filter/mode.t' <<'END_OF_FILE'
- X# Test negated mode
- X
- X# $Id: mode.t,v 3.0 1993/11/29 13:50:02 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: mode.t,v $
- X# Revision 3.0 1993/11/29 13:50:02 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/filter.pl';
- Xunlink 'never', 'always', 'always.2', 'always.3';
- X
- X&add_header('X-Tag: mode');
- X`$cmd`;
- X$? == 0 || print "1\n";
- X-f "$user" && print "2\n"; # Mail has been deleted
- X-f 'never' && print "3\n"; # Cannot match
- X-f 'always' || print "4\n"; # This one must have matched
- X-f 'always.2' || print "5\n"; # Direct match
- X-f 'always.3' || print "6\n"; # Another implied direct match
- X
- Xunlink 'never', 'always', 'always.2', 'always.3';
- Xprint "0\n";
- END_OF_FILE
- if test 1015 -ne `wc -c <'agent/test/filter/mode.t'`; then
- echo shar: \"'agent/test/filter/mode.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/filter/mode.t'
- fi
- if test -f 'agent/test/filter/pattern.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/filter/pattern.t'\"
- else
- echo shar: Extracting \"'agent/test/filter/pattern.t'\" \(950 characters\)
- sed "s/^X//" >'agent/test/filter/pattern.t' <<'END_OF_FILE'
- X# Test selectors specified via a pattern
- X
- X# $Id: pattern.t,v 3.0 1993/11/29 13:50:05 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: pattern.t,v $
- X# Revision 3.0 1993/11/29 13:50:05 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/filter.pl';
- Xunlink 'macro';
- X
- X&add_header('X-Tag: pattern');
- X&add_header('Replied: ram@eiffel.com');
- X`$cmd`;
- X$? == 0 || print "1\n";
- X-f "$user" && print "2\n"; # Must have been deleted
- X-f 'macro' || print "3\n"; # Created by RUN
- Xchop($macro = `cat macro 2>/dev/null`);
- X$macro eq 'Received,Replied;Subject;' || print "4\n";
- X
- Xunlink 'macro';
- Xprint "0\n";
- END_OF_FILE
- if test 950 -ne `wc -c <'agent/test/filter/pattern.t'`; then
- echo shar: \"'agent/test/filter/pattern.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/filter/pattern.t'
- fi
- if test -f 'agent/test/filter/status.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/filter/status.t'\"
- else
- echo shar: Extracting \"'agent/test/filter/status.t'\" \(969 characters\)
- sed "s/^X//" >'agent/test/filter/status.t' <<'END_OF_FILE'
- X# Make sure commands record their exit status
- X
- X# $Id: status.t,v 3.0 1993/11/29 13:50:06 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: status.t,v $
- X# Revision 3.0 1993/11/29 13:50:06 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/filter.pl';
- Xunlink 'never', 'always', 'always.2', 'always.3';
- X
- X&add_header('X-Tag: status');
- X`$cmd`;
- X$? == 0 || print "1\n";
- X-f "$user" && print "2\n"; # Mail has been saved
- X-f 'never' && print "3\n"; # Cannot match
- X-f 'always' || print "4\n";
- X-f 'always.2' || print "5\n";
- X-f 'always.3' || print "6\n";
- X
- Xunlink 'never', 'always', 'always.2', 'always.3';
- Xprint "0\n";
- END_OF_FILE
- if test 969 -ne `wc -c <'agent/test/filter/status.t'`; then
- echo shar: \"'agent/test/filter/status.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/filter/status.t'
- fi
- if test -f 'agent/test/option/c.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/option/c.t'\"
- else
- echo shar: Extracting \"'agent/test/option/c.t'\" \(1019 characters\)
- sed "s/^X//" >'agent/test/option/c.t' <<'END_OF_FILE'
- X# -c : specify alternate configuration file
- X
- X# $Id: c.t,v 3.0 1993/11/29 13:50:13 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: c.t,v $
- X# Revision 3.0 1993/11/29 13:50:13 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/init.pl';
- X$output = `cat ../mail | $mailagent -c foo 2>&1`;
- X$? != 0 || print "1\n"; # Cannot open config file
- X$* = 1;
- X$output =~ /^\*\*.*not processed/ || print "2\n";
- Xchdir '../out';
- X$user = $ENV{'USER'};
- Xunlink "$user";
- X`cp .mailagent alternate`;
- X$output = `$mailagent -c alternate /dev/null 2>/dev/null`;
- X$? == 0 || print "3\n";
- X$output eq '' || print "4\n";
- X-s "$user" || print "5\n";
- Xunlink "$user", 'alternate';
- Xprint "0\n";
- END_OF_FILE
- if test 1019 -ne `wc -c <'agent/test/option/c.t'`; then
- echo shar: \"'agent/test/option/c.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/option/c.t'
- fi
- if test -f 'agent/test/option/i.t' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/option/i.t'\"
- else
- echo shar: Extracting \"'agent/test/option/i.t'\" \(948 characters\)
- sed "s/^X//" >'agent/test/option/i.t' <<'END_OF_FILE'
- X# -i: interactive usage -- print log messages on stderr
- X
- X# $Id: i.t,v 3.0 1993/11/29 13:50:17 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: i.t,v $
- X# Revision 3.0 1993/11/29 13:50:17 ram
- X# Baseline for mailagent 3.0 netwide release.
- X#
- X
- Xdo '../pl/init.pl';
- Xchdir '../out';
- Xunlink 'agentlog';
- X$output = `$mailagent -d -i 2>&1 >/dev/null`;
- X$? == 0 || print "1\n";
- X$* = 1;
- Xopen(LOG, 'agentlog') || print "2\n";
- Xundef $/;
- X$log = <LOG>;
- Xclose LOG;
- X$output =~ s/^$mailagent_prog://g;
- X$log =~ s/^.*$mailagent_prog\[.*\]\s*://g;
- X$output eq $log || print "3\n";
- X$output ne '' || print "4\n";
- Xprint "0\n";
- END_OF_FILE
- if test 948 -ne `wc -c <'agent/test/option/i.t'`; then
- echo shar: \"'agent/test/option/i.t'\" unpacked with wrong size!
- fi
- # end of 'agent/test/option/i.t'
- fi
- if test -f 'agent/test/pl/cmd.pl' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/pl/cmd.pl'\"
- else
- echo shar: Extracting \"'agent/test/pl/cmd.pl'\" \(976 characters\)
- sed "s/^X//" >'agent/test/pl/cmd.pl' <<'END_OF_FILE'
- X# Common actions at the top of each command test
- X
- X# $Id: cmd.pl,v 3.0 1993/11/29 13:50:22 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: cmd.pl,v $
- X;# Revision 3.0 1993/11/29 13:50:22 ram
- X;# Baseline for mailagent 3.0 netwide release.
- X;#
- X
- Xdo '../pl//init.pl';
- Xchdir '../out';
- Xdo '../pl/mail.pl';
- X&cp_mail;
- X$user = $ENV{'USER'};
- Xunlink "$user", 'agentlog', 'send.mail', 'send.news';
- X$cmd = "$mailagent -L $ENV{'LEVEL'} -r ../actions mail 2>/dev/null";
- X
- X# We might need this
- Xdo '../pl/logfile.pl';
- X
- Xsub cp_mail {
- X local($_);
- X open(MAIL, '../mail');
- X open(HERE, '>mail');
- X print HERE while <MAIL>;
- X close MAIL;
- X close HERE;
- X}
- X
- END_OF_FILE
- if test 976 -ne `wc -c <'agent/test/pl/cmd.pl'`; then
- echo shar: \"'agent/test/pl/cmd.pl'\" unpacked with wrong size!
- fi
- # end of 'agent/test/pl/cmd.pl'
- fi
- if test -f 'agent/test/pl/filter.pl' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'agent/test/pl/filter.pl'\"
- else
- echo shar: Extracting \"'agent/test/pl/filter.pl'\" \(957 characters\)
- sed "s/^X//" >'agent/test/pl/filter.pl' <<'END_OF_FILE'
- X# Common actions at the top of each filtering test
- X
- X# $Id: filter.pl,v 3.0 1993/11/29 13:50:23 ram Exp ram $
- X#
- X# Copyright (c) 1990-1993, Raphael Manfredi
- X#
- X# You may redistribute only under the terms of the Artistic License,
- X# as specified in the README file that comes with the distribution.
- X# You may reuse parts of this distribution only within the terms of
- X# that same Artistic License; a copy of which may be found at the root
- X# of the source tree for mailagent 3.0.
- X#
- X# $Log: filter.pl,v $
- X;# Revision 3.0 1993/11/29 13:50:23 ram
- X;# Baseline for mailagent 3.0 netwide release.
- X;#
- X
- Xdo '../pl/init.pl';
- Xchdir '../out';
- Xdo '../pl/mail.pl';
- X`cp ../mail .`;
- X$user = $ENV{'USER'};
- Xunlink "$user", 'agentlog';
- X$cmd = "$mailagent -L $ENV{'LEVEL'} -r ../rules mail 2>/dev/null";
- X
- X# Re-create pattern list
- Xopen(PATTERN, ">pattern-list");
- Xprint PATTERN <<'EOP';
- Xno-match-possible
- Xanother-impossible-match
- X# This will match
- Xpattern
- XEOP
- Xclose PATTERN;
- END_OF_FILE
- if test 957 -ne `wc -c <'agent/test/pl/filter.pl'`; then
- echo shar: \"'agent/test/pl/filter.pl'\" unpacked with wrong size!
- fi
- # end of 'agent/test/pl/filter.pl'
- fi
- echo shar: End of archive 24 \(of 26\).
- cp /dev/null ark24isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 26 archives.
- echo "Now run 'sh PACKNOTES', then read README and type Configure.'"
- 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...
-