home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume41 / mailagnt / part24 < prev    next >
Encoding:
Text File  |  1993-12-03  |  54.3 KB  |  1,650 lines

  1. Newsgroups: comp.sources.misc
  2. From: Raphael Manfredi <ram@acri.fr>
  3. Subject: v41i024:  mailagent - Flexible mail filtering and processing package, v3.0, Part24/26
  4. Message-ID: <1993Dec3.213637.23311@sparky.sterling.com>
  5. X-Md4-Signature: 3bc2ea2f901a048742c6601dfc7294fd
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Advanced Computer Research Institute, Lyon, France.
  8. Date: Fri, 3 Dec 1993 21:36:37 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: Raphael Manfredi <ram@acri.fr>
  12. Posting-number: Volume 41, Issue 24
  13. Archive-name: mailagent/part24
  14. Environment: UNIX, Perl
  15. Supersedes: mailagent: Volume 33, Issue 93-109
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  22. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  23. # Contents:  agent/examples/mchk agent/files/help/Jmakefile
  24. #   agent/filter/Jmakefile agent/filter/io.h agent/filter/lock.h
  25. #   agent/man/maildist.SH agent/man/maillist.SH agent/man/mailpatch.SH
  26. #   agent/pl/hostname.pl agent/pl/jobnum.pl agent/pl/makedir.pl
  27. #   agent/pl/plural.pl agent/test/cmd/annotate.t
  28. #   agent/test/cmd/assign.t agent/test/cmd/back.t
  29. #   agent/test/cmd/begin.t agent/test/cmd/give.t agent/test/cmd/pass.t
  30. #   agent/test/cmd/pipe.t agent/test/cmd/purify.t
  31. #   agent/test/cmd/reject.t agent/test/cmd/require.t
  32. #   agent/test/cmd/restart.t agent/test/cmd/select.t
  33. #   agent/test/cmd/unknown.t agent/test/filter/case.t
  34. #   agent/test/filter/group.t agent/test/filter/loop.t
  35. #   agent/test/filter/mode.t agent/test/filter/pattern.t
  36. #   agent/test/filter/status.t agent/test/option/c.t
  37. #   agent/test/option/i.t agent/test/pl/cmd.pl agent/test/pl/filter.pl
  38. # Wrapped by ram@soft208 on Mon Nov 29 16:49:58 1993
  39. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  40. echo If this archive is complete, you will see the following message:
  41. echo '          "shar: End of archive 24 (of 26)."'
  42. if test -f 'agent/examples/mchk' -a "${1}" != "-c" ; then 
  43.   echo shar: Will not clobber existing file \"'agent/examples/mchk'\"
  44. else
  45.   echo shar: Extracting \"'agent/examples/mchk'\" \(987 characters\)
  46.   sed "s/^X//" >'agent/examples/mchk' <<'END_OF_FILE'
  47. X#! /bin/sh
  48. X# @(#) Scans all the mailboxes to spot any new mail
  49. X
  50. X# Compute location of the spool mailbox
  51. Xspool=/usr/spool/mail
  52. Xif test -d /usr/mail; then
  53. X    spool=/usr/mail;
  54. Xfi
  55. Xspool=$spool/`(logname || whoami) 2>/dev/null`
  56. X
  57. X# First look for a ~/.mailfolders file, otherwise parse $MAILPATH, and
  58. X# finally use the spool mailbox if none of those worked.
  59. Xif test -f $HOME/.mailfolders; then
  60. X    set X $spool \
  61. X        `sed -e "/^[     ]*#/d" -e "s|^~|$HOME|" <$HOME/.mailfolders`
  62. Xelif test "$MAILPATH"; then
  63. X    set X `echo $MAILPATH | tr ':' '\012'`
  64. Xelse
  65. X    set X $spool
  66. Xfi
  67. Xshift
  68. X
  69. X# Loop over the computed locations and print the name of the mailboxes
  70. X# which are not empty. If a location is a directory, scan all the files
  71. X# found in that directory.
  72. Xfor location in $*
  73. Xdo
  74. X    if test -d "$location"; then
  75. X        for file in $location/*
  76. X        do
  77. X            if test -s "$file"; then
  78. X                echo "$file"
  79. X            fi
  80. X        done
  81. X    elif test -s "$location"; then
  82. X        echo "$location"
  83. X    elif test -s "$location.Z"; then
  84. X        echo "$location.Z"
  85. X    fi
  86. Xdone
  87. X
  88. END_OF_FILE
  89.   if test 987 -ne `wc -c <'agent/examples/mchk'`; then
  90.     echo shar: \"'agent/examples/mchk'\" unpacked with wrong size!
  91.   fi
  92.   chmod +x 'agent/examples/mchk'
  93.   # end of 'agent/examples/mchk'
  94. fi
  95. if test -f 'agent/files/help/Jmakefile' -a "${1}" != "-c" ; then 
  96.   echo shar: Will not clobber existing file \"'agent/files/help/Jmakefile'\"
  97. else
  98.   echo shar: Extracting \"'agent/files/help/Jmakefile'\" \(952 characters\)
  99.   sed "s/^X//" >'agent/files/help/Jmakefile' <<'END_OF_FILE'
  100. X/*
  101. X * Jmakefile for server help files.
  102. X */
  103. X
  104. X;# $Id: Jmakefile,v 3.0 1993/11/29 13:47:52 ram Exp ram $
  105. X;#
  106. X;#  Copyright (c) 1990-1993, Raphael Manfredi
  107. X;#  
  108. X;#  You may redistribute only under the terms of the Artistic License,
  109. X;#  as specified in the README file that comes with the distribution.
  110. X;#  You may reuse parts of this distribution only within the terms of
  111. X;#  that same Artistic License; a copy of which may be found at the root
  112. X;#  of the source tree for mailagent 3.0.
  113. X;#
  114. X;# $Log: Jmakefile,v $
  115. X;# Revision 3.0  1993/11/29  13:47:52  ram
  116. X;# Baseline for mailagent 3.0 netwide release.
  117. X;#
  118. X
  119. XFILES = addauth approve delpower end getauth help newpower \
  120. X    passwd password power release remauth set setauth user
  121. X
  122. X>PRIVLIB    /* Force metaconfig to ask for privlib location */
  123. X
  124. Xall::
  125. X
  126. XNoManPages()
  127. XSimpleShellScriptTarget($(FILES))
  128. XMakeInstallDirectories($(PRIVLIB) $(PRIVLIB)/help)
  129. XInstallMultipleDestFlags(install,$(FILES),$(PRIVLIB)/help,-m 444)
  130. END_OF_FILE
  131.   if test 952 -ne `wc -c <'agent/files/help/Jmakefile'`; then
  132.     echo shar: \"'agent/files/help/Jmakefile'\" unpacked with wrong size!
  133.   fi
  134.   # end of 'agent/files/help/Jmakefile'
  135. fi
  136. if test -f 'agent/filter/Jmakefile' -a "${1}" != "-c" ; then 
  137.   echo shar: Will not clobber existing file \"'agent/filter/Jmakefile'\"
  138. else
  139.   echo shar: Extracting \"'agent/filter/Jmakefile'\" \(1032 characters\)
  140.   sed "s/^X//" >'agent/filter/Jmakefile' <<'END_OF_FILE'
  141. X/*
  142. X * Jmakefile for filter
  143. X */
  144. X
  145. X;# $Id: Jmakefile,v 3.0 1993/11/29 13:48:04 ram Exp ram $
  146. X;#
  147. X;#  Copyright (c) 1990-1993, Raphael Manfredi
  148. X;#  
  149. X;#  You may redistribute only under the terms of the Artistic License,
  150. X;#  as specified in the README file that comes with the distribution.
  151. X;#  You may reuse parts of this distribution only within the terms of
  152. X;#  that same Artistic License; a copy of which may be found at the root
  153. X;#  of the source tree for mailagent 3.0.
  154. X;#
  155. X;# $Log: Jmakefile,v $
  156. X;# Revision 3.0  1993/11/29  13:48:04  ram
  157. X;# Baseline for mailagent 3.0 netwide release.
  158. X;#
  159. X
  160. X;# Files used to build the application
  161. XSRC = environ.c hash.c io.c lock.c logfile.c main.c misc.c msg.c parser.c \
  162. X    user.c
  163. X
  164. X;# Derived object file names
  165. XOBJ = \
  166. X|expand f!$(SRC)!
  167. X    !f:\.c=.o \
  168. X-expand \\
  169. X
  170. X;# File config.h is in the top-level directory
  171. XCFLAGS = -I$(TOP)
  172. XDPFLAGS = -I$(TOP)
  173. X
  174. X>PRIVLIB    /* Force metaconfig to ask for privlib location */
  175. X
  176. XDependTarget()
  177. XNormalProgramTarget(filter,$(SRC),$(OBJ))
  178. XInstallProgram(filter, $(PRIVLIB))
  179. END_OF_FILE
  180.   if test 1032 -ne `wc -c <'agent/filter/Jmakefile'`; then
  181.     echo shar: \"'agent/filter/Jmakefile'\" unpacked with wrong size!
  182.   fi
  183.   # end of 'agent/filter/Jmakefile'
  184. fi
  185. if test -f 'agent/filter/io.h' -a "${1}" != "-c" ; then 
  186.   echo shar: Will not clobber existing file \"'agent/filter/io.h'\"
  187. else
  188.   echo shar: Extracting \"'agent/filter/io.h'\" \(1000 characters\)
  189.   sed "s/^X//" >'agent/filter/io.h' <<'END_OF_FILE'
  190. X/*
  191. X
  192. X    #     ####           #    #
  193. X    #    #    #          #    #
  194. X    #    #    #          ######
  195. X    #    #    #   ###    #    #
  196. X    #    #    #   ###    #    #
  197. X    #     ####    ###    #    #
  198. X
  199. X    Declarations of I/O routines.
  200. X*/
  201. X
  202. X/*
  203. X * $Id: io.h,v 3.0 1993/11/29 13:48:11 ram Exp ram $
  204. X *
  205. X *  Copyright (c) 1990-1993, Raphael Manfredi
  206. X *  
  207. X *  You may redistribute only under the terms of the Artistic License,
  208. X *  as specified in the README file that comes with the distribution.
  209. X *  You may reuse parts of this distribution only within the terms of
  210. X *  that same Artistic License; a copy of which may be found at the root
  211. X *  of the source tree for mailagent 3.0.
  212. X *
  213. X * $Log: io.h,v $
  214. X * Revision 3.0  1993/11/29  13:48:11  ram
  215. X * Baseline for mailagent 3.0 netwide release.
  216. X *
  217. X */
  218. X
  219. X#ifndef _io_h_
  220. X#define _io_h_
  221. X
  222. Xextern void process();                /* Process mail */
  223. Xextern int emergency_save();        /* Save mail in emeregency file */
  224. Xextern int was_queued();            /* Was mail safely queued or not? */
  225. X
  226. X#endif
  227. END_OF_FILE
  228.   if test 1000 -ne `wc -c <'agent/filter/io.h'`; then
  229.     echo shar: \"'agent/filter/io.h'\" unpacked with wrong size!
  230.   fi
  231.   # end of 'agent/filter/io.h'
  232. fi
  233. if test -f 'agent/filter/lock.h' -a "${1}" != "-c" ; then 
  234.   echo shar: Will not clobber existing file \"'agent/filter/lock.h'\"
  235. else
  236.   echo shar: Extracting \"'agent/filter/lock.h'\" \(1097 characters\)
  237.   sed "s/^X//" >'agent/filter/lock.h' <<'END_OF_FILE'
  238. X/*
  239. X
  240. X #        ####    ####   #    #          #    #
  241. X #       #    #  #    #  #   #           #    #
  242. X #       #    #  #       ####            ######
  243. X #       #    #  #       #  #     ###    #    #
  244. X #       #    #  #    #  #   #    ###    #    #
  245. X ######   ####    ####   #    #   ###    #    #
  246. X
  247. X    Declarations for locking routines.
  248. X*/
  249. X
  250. X/*
  251. X * $Id: lock.h,v 3.0 1993/11/29 13:48:12 ram Exp ram $
  252. X *
  253. X *  Copyright (c) 1990-1993, Raphael Manfredi
  254. X *  
  255. X *  You may redistribute only under the terms of the Artistic License,
  256. X *  as specified in the README file that comes with the distribution.
  257. X *  You may reuse parts of this distribution only within the terms of
  258. X *  that same Artistic License; a copy of which may be found at the root
  259. X *  of the source tree for mailagent 3.0.
  260. X *
  261. X * $Log: lock.h,v $
  262. X * Revision 3.0  1993/11/29  13:48:12  ram
  263. X * Baseline for mailagent 3.0 netwide release.
  264. X *
  265. X */
  266. X
  267. X#ifndef _lock_h_
  268. X#define _lock_h_
  269. X
  270. Xextern int filter_lock();        /* Lock filter */
  271. Xextern void release_lock();        /* Release lock if necessary */
  272. Xextern int is_locked();            /* Do we have a lock file? */
  273. X
  274. X#endif
  275. END_OF_FILE
  276.   if test 1097 -ne `wc -c <'agent/filter/lock.h'`; then
  277.     echo shar: \"'agent/filter/lock.h'\" unpacked with wrong size!
  278.   fi
  279.   # end of 'agent/filter/lock.h'
  280. fi
  281. if test -f 'agent/man/maildist.SH' -a "${1}" != "-c" ; then 
  282.   echo shar: Will not clobber existing file \"'agent/man/maildist.SH'\"
  283. else
  284.   echo shar: Extracting \"'agent/man/maildist.SH'\" \(1163 characters\)
  285.   sed "s/^X//" >'agent/man/maildist.SH' <<'END_OF_FILE'
  286. Xcase $CONFIG in
  287. X'')
  288. X    if test -f config.sh; then TOP=.;
  289. X    elif test -f ../config.sh; then TOP=..;
  290. X    elif test -f ../../config.sh; then TOP=../..;
  291. X    elif test -f ../../../config.sh; then TOP=../../..;
  292. X    elif test -f ../../../../config.sh; then TOP=../../../..;
  293. X    else
  294. X        echo "Can't find config.sh."; exit 1
  295. X    fi
  296. X    . $TOP/config.sh
  297. X    ;;
  298. Xesac
  299. Xcase "$0" in
  300. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  301. Xesac
  302. Xecho "Extracting agent/man/maildist.$manext (with variable substitutions)"
  303. X$rm -f maildist.$manext
  304. X$spitshell >maildist.$manext <<!GROK!THIS!
  305. X.so $mansrc/mailhelp.$manext
  306. X''' $Id: maildist.SH,v 3.0 1993/11/29 13:48:28 ram Exp ram $
  307. X'''
  308. X'''  Copyright (c) 1990-1993, Raphael Manfredi
  309. X'''  
  310. X'''  You may redistribute only under the terms of the Artistic License,
  311. X'''  as specified in the README file that comes with the distribution.
  312. X'''  You may reuse parts of this distribution only within the terms of
  313. X'''  that same Artistic License; a copy of which may be found at the root
  314. X'''  of the source tree for mailagent 3.0.
  315. X'''
  316. X''' $Log: maildist.SH,v $
  317. X# Revision 3.0  1993/11/29  13:48:28  ram
  318. X# Baseline for mailagent 3.0 netwide release.
  319. X#
  320. X!GROK!THIS!
  321. Xchmod 444 maildist.$manext
  322. END_OF_FILE
  323.   if test 1163 -ne `wc -c <'agent/man/maildist.SH'`; then
  324.     echo shar: \"'agent/man/maildist.SH'\" unpacked with wrong size!
  325.   fi
  326.   chmod +x 'agent/man/maildist.SH'
  327.   # end of 'agent/man/maildist.SH'
  328. fi
  329. if test -f 'agent/man/maillist.SH' -a "${1}" != "-c" ; then 
  330.   echo shar: Will not clobber existing file \"'agent/man/maillist.SH'\"
  331. else
  332.   echo shar: Extracting \"'agent/man/maillist.SH'\" \(1163 characters\)
  333.   sed "s/^X//" >'agent/man/maillist.SH' <<'END_OF_FILE'
  334. Xcase $CONFIG in
  335. X'')
  336. X    if test -f config.sh; then TOP=.;
  337. X    elif test -f ../config.sh; then TOP=..;
  338. X    elif test -f ../../config.sh; then TOP=../..;
  339. X    elif test -f ../../../config.sh; then TOP=../../..;
  340. X    elif test -f ../../../../config.sh; then TOP=../../../..;
  341. X    else
  342. X        echo "Can't find config.sh."; exit 1
  343. X    fi
  344. X    . $TOP/config.sh
  345. X    ;;
  346. Xesac
  347. Xcase "$0" in
  348. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  349. Xesac
  350. Xecho "Extracting agent/man/maillist.$manext (with variable substitutions)"
  351. X$rm -f maillist.$manext
  352. X$spitshell >maillist.$manext <<!GROK!THIS!
  353. X.so $mansrc/mailhelp.$manext
  354. X''' $Id: maillist.SH,v 3.0 1993/11/29 13:48:30 ram Exp ram $
  355. X'''
  356. X'''  Copyright (c) 1990-1993, Raphael Manfredi
  357. X'''  
  358. X'''  You may redistribute only under the terms of the Artistic License,
  359. X'''  as specified in the README file that comes with the distribution.
  360. X'''  You may reuse parts of this distribution only within the terms of
  361. X'''  that same Artistic License; a copy of which may be found at the root
  362. X'''  of the source tree for mailagent 3.0.
  363. X'''
  364. X''' $Log: maillist.SH,v $
  365. X# Revision 3.0  1993/11/29  13:48:30  ram
  366. X# Baseline for mailagent 3.0 netwide release.
  367. X#
  368. X!GROK!THIS!
  369. Xchmod 444 maillist.$manext
  370. END_OF_FILE
  371.   if test 1163 -ne `wc -c <'agent/man/maillist.SH'`; then
  372.     echo shar: \"'agent/man/maillist.SH'\" unpacked with wrong size!
  373.   fi
  374.   chmod +x 'agent/man/maillist.SH'
  375.   # end of 'agent/man/maillist.SH'
  376. fi
  377. if test -f 'agent/man/mailpatch.SH' -a "${1}" != "-c" ; then 
  378.   echo shar: Will not clobber existing file \"'agent/man/mailpatch.SH'\"
  379. else
  380.   echo shar: Extracting \"'agent/man/mailpatch.SH'\" \(1166 characters\)
  381.   sed "s/^X//" >'agent/man/mailpatch.SH' <<'END_OF_FILE'
  382. Xcase $CONFIG in
  383. X'')
  384. X    if test -f config.sh; then TOP=.;
  385. X    elif test -f ../config.sh; then TOP=..;
  386. X    elif test -f ../../config.sh; then TOP=../..;
  387. X    elif test -f ../../../config.sh; then TOP=../../..;
  388. X    elif test -f ../../../../config.sh; then TOP=../../../..;
  389. X    else
  390. X        echo "Can't find config.sh."; exit 1
  391. X    fi
  392. X    . $TOP/config.sh
  393. X    ;;
  394. Xesac
  395. Xcase "$0" in
  396. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  397. Xesac
  398. Xecho "Extracting agent/man/mailpatch.$manext (with variable substitutions)"
  399. X$rm -f mailpatch.$manext
  400. X$spitshell >mailpatch.$manext <<!GROK!THIS!
  401. X.so $mansrc/mailhelp.$manext
  402. X'''
  403. X''' $Id: mailpatch.SH,v 3.0 1993/11/29 13:48:30 ram Exp ram $
  404. X'''
  405. X''' Copyright (c) 1990-1993, Raphael Manfredi
  406. X''' 
  407. X''' You may redistribute only under the terms of the Artistic License,
  408. X''' as specified in the README file that comes with the distribution.
  409. X''' You may reuse parts of this distribution only within the terms of
  410. X''' that same Artistic License; a copy of which may be found at the root
  411. X''' of the source tree for mailagent 3.0.
  412. X'''
  413. X''' $Log: mailpatch.SH,v $
  414. X# Revision 3.0  1993/11/29  13:48:30  ram
  415. X# Baseline for mailagent 3.0 netwide release.
  416. X#
  417. X!GROK!THIS!
  418. Xchmod 444 mailpatch.$manext
  419. END_OF_FILE
  420.   if test 1166 -ne `wc -c <'agent/man/mailpatch.SH'`; then
  421.     echo shar: \"'agent/man/mailpatch.SH'\" unpacked with wrong size!
  422.   fi
  423.   chmod +x 'agent/man/mailpatch.SH'
  424.   # end of 'agent/man/mailpatch.SH'
  425. fi
  426. if test -f 'agent/pl/hostname.pl' -a "${1}" != "-c" ; then 
  427.   echo shar: Will not clobber existing file \"'agent/pl/hostname.pl'\"
  428. else
  429.   echo shar: Extracting \"'agent/pl/hostname.pl'\" \(996 characters\)
  430.   sed "s/^X//" >'agent/pl/hostname.pl' <<'END_OF_FILE'
  431. X;# $Id: hostname.pl,v 3.0 1993/11/29 13:48:52 ram Exp ram $
  432. X;#
  433. X;#  Copyright (c) 1990-1993, Raphael Manfredi
  434. X;#  
  435. X;#  You may redistribute only under the terms of the Artistic License,
  436. X;#  as specified in the README file that comes with the distribution.
  437. X;#  You may reuse parts of this distribution only within the terms of
  438. X;#  that same Artistic License; a copy of which may be found at the root
  439. X;#  of the source tree for mailagent 3.0.
  440. X;#
  441. X;# $Log: hostname.pl,v $
  442. X;# Revision 3.0  1993/11/29  13:48:52  ram
  443. X;# Baseline for mailagent 3.0 netwide release.
  444. X;#
  445. X;# 
  446. X# Return only the hostname portion of the host name (no domain name)
  447. Xsub myhostname {
  448. X    local($_) = &hostname;
  449. X    s/^([^.]*)\..*/$1/;            # Trim down domain name
  450. X    $_;
  451. X}
  452. X
  453. X# Compute hostname once and for all and cache its value (since we have to fork
  454. X# to get it).
  455. Xsub hostname {
  456. X    unless ($cache'hostname) {
  457. X        chop($cache'hostname = `$phostname`);
  458. X        $cache'hostname =~ tr/A-Z/a-z/;            # Cannonicalize to lower case
  459. X    }
  460. X    $cache'hostname;
  461. X}
  462. X
  463. END_OF_FILE
  464.   if test 996 -ne `wc -c <'agent/pl/hostname.pl'`; then
  465.     echo shar: \"'agent/pl/hostname.pl'\" unpacked with wrong size!
  466.   fi
  467.   # end of 'agent/pl/hostname.pl'
  468. fi
  469. if test -f 'agent/pl/jobnum.pl' -a "${1}" != "-c" ; then 
  470.   echo shar: Will not clobber existing file \"'agent/pl/jobnum.pl'\"
  471. else
  472.   echo shar: Extracting \"'agent/pl/jobnum.pl'\" \(1153 characters\)
  473.   sed "s/^X//" >'agent/pl/jobnum.pl' <<'END_OF_FILE'
  474. X;# $Id: jobnum.pl,v 3.0 1993/11/29 13:48:54 ram Exp ram $
  475. X;#
  476. X;#  Copyright (c) 1990-1993, Raphael Manfredi
  477. X;#  
  478. X;#  You may redistribute only under the terms of the Artistic License,
  479. X;#  as specified in the README file that comes with the distribution.
  480. X;#  You may reuse parts of this distribution only within the terms of
  481. X;#  that same Artistic License; a copy of which may be found at the root
  482. X;#  of the source tree for mailagent 3.0.
  483. X;#
  484. X;# $Log: jobnum.pl,v $
  485. X;# Revision 3.0  1993/11/29  13:48:54  ram
  486. X;# Baseline for mailagent 3.0 netwide release.
  487. X;#
  488. X;# 
  489. X;# Depends on the following external routines:
  490. X;#  checklock() to check for locks older than one hour (via acs_rqst)
  491. X;#  acs_rqst() to get a lock on file
  492. X;#  free_file() to release lock on file
  493. X;#
  494. X# Computes a new job number
  495. Xsub jobnum {
  496. X    local($job);                        # Computed job number
  497. X    if (0 != &acs_rqst($cf'seqfile)) {
  498. X        $job = "?";
  499. X    } else {
  500. X        local($njob);
  501. X        open(FILE, "$cf'seqfile");
  502. X        $njob = int(<FILE>);
  503. X        close FILE;
  504. X        $njob++;
  505. X        open(FILE, ">$cf'seqfile");
  506. X        print FILE "$njob\n";
  507. X        close FILE;
  508. X        $job = "$njob";
  509. X        &free_file("$cf'seqfile");
  510. X    }
  511. X    $job;        # Return job number to be used
  512. X}
  513. X
  514. END_OF_FILE
  515.   if test 1153 -ne `wc -c <'agent/pl/jobnum.pl'`; then
  516.     echo shar: \"'agent/pl/jobnum.pl'\" unpacked with wrong size!
  517.   fi
  518.   # end of 'agent/pl/jobnum.pl'
  519. fi
  520. if test -f 'agent/pl/makedir.pl' -a "${1}" != "-c" ; then 
  521.   echo shar: Will not clobber existing file \"'agent/pl/makedir.pl'\"
  522. else
  523.   echo shar: Extracting \"'agent/pl/makedir.pl'\" \(1158 characters\)
  524.   sed "s/^X//" >'agent/pl/makedir.pl' <<'END_OF_FILE'
  525. X;# $Id: makedir.pl,v 3.0 1993/11/29 13:48:59 ram Exp ram $
  526. X;#
  527. X;#  Copyright (c) 1990-1993, Raphael Manfredi
  528. X;#  
  529. X;#  You may redistribute only under the terms of the Artistic License,
  530. X;#  as specified in the README file that comes with the distribution.
  531. X;#  You may reuse parts of this distribution only within the terms of
  532. X;#  that same Artistic License; a copy of which may be found at the root
  533. X;#  of the source tree for mailagent 3.0.
  534. X;#
  535. X;# $Log: makedir.pl,v $
  536. X;# Revision 3.0  1993/11/29  13:48:59  ram
  537. X;# Baseline for mailagent 3.0 netwide release.
  538. X;#
  539. X;# 
  540. X# Make directories for files
  541. X# E.g, for /usr/lib/perl/foo, it will check for all the
  542. X# directories /usr, /usr/lib, /usr/lib/perl and make
  543. X# them if they do not exist.
  544. Xsub makedir {
  545. X    local($dir, $mode) = @_;    # directory name, mode (optional)
  546. X    local($parent);
  547. X    $mode = 0700 unless defined $mode;
  548. X    if (!-d $dir && $dir ne '') {
  549. X        # Make parent dir first
  550. X        &makedir($parent, $mode) if ($parent = $dir) =~ s|(.*)/.*|\1|;
  551. X        if (mkdir($dir, $mode)) {
  552. X            &add_log("creating directory $dir") if $loglvl > 19;
  553. X        } else {
  554. X            &add_log("ERROR cannot create directory $dir: $!")
  555. X                if $loglvl > 1;
  556. X        }
  557. X    }
  558. X}
  559. X
  560. END_OF_FILE
  561.   if test 1158 -ne `wc -c <'agent/pl/makedir.pl'`; then
  562.     echo shar: \"'agent/pl/makedir.pl'\" unpacked with wrong size!
  563.   fi
  564.   # end of 'agent/pl/makedir.pl'
  565. fi
  566. if test -f 'agent/pl/plural.pl' -a "${1}" != "-c" ; then 
  567.   echo shar: Will not clobber existing file \"'agent/pl/plural.pl'\"
  568. else
  569.   echo shar: Extracting \"'agent/pl/plural.pl'\" \(1042 characters\)
  570.   sed "s/^X//" >'agent/pl/plural.pl' <<'END_OF_FILE'
  571. X;# $Id: plural.pl,v 3.0 1993/11/29 13:49:07 ram Exp ram $
  572. X;#
  573. X;#  Copyright (c) 1990-1993, Raphael Manfredi
  574. X;#  
  575. X;#  You may redistribute only under the terms of the Artistic License,
  576. X;#  as specified in the README file that comes with the distribution.
  577. X;#  You may reuse parts of this distribution only within the terms of
  578. X;#  that same Artistic License; a copy of which may be found at the root
  579. X;#  of the source tree for mailagent 3.0.
  580. X;#
  581. X;# $Log: plural.pl,v $
  582. X;# Revision 3.0  1993/11/29  13:49:07  ram
  583. X;# Baseline for mailagent 3.0 netwide release.
  584. X;#
  585. X;# 
  586. X# Pluralize names -- Adapted from a routine posted by Tom Christiansen in
  587. X# comp.lang.perl on June 20th, 1992.
  588. Xsub plural {
  589. X    local($_, $n) = @_;        # Word and amount (plural if not specified)
  590. X    $n = 2 if $n eq '';        # Pluralize word by default
  591. X    if ($n != 1) {            # 0 something is plural
  592. X        if ($_ eq 'was') {
  593. X            $_ = 'were';
  594. X        } else {
  595. X            s/y$/ies/   || s/s$/ses/  || s/([cs]h)$/$1es/ ||
  596. X            s/sis$/ses/ || s/ium$/ia/ || s/$/s/;
  597. X        }
  598. X    }
  599. X    "$_";            # How to write $n times the original $_
  600. X}
  601. X
  602. END_OF_FILE
  603.   if test 1042 -ne `wc -c <'agent/pl/plural.pl'`; then
  604.     echo shar: \"'agent/pl/plural.pl'\" unpacked with wrong size!
  605.   fi
  606.   # end of 'agent/pl/plural.pl'
  607. fi
  608. if test -f 'agent/test/cmd/annotate.t' -a "${1}" != "-c" ; then 
  609.   echo shar: Will not clobber existing file \"'agent/test/cmd/annotate.t'\"
  610. else
  611.   echo shar: Extracting \"'agent/test/cmd/annotate.t'\" \(991 characters\)
  612.   sed "s/^X//" >'agent/test/cmd/annotate.t' <<'END_OF_FILE'
  613. X# Test ANNOTATE command
  614. X
  615. X# $Id: annotate.t,v 3.0 1993/11/29 13:49:26 ram Exp ram $
  616. X#
  617. X#  Copyright (c) 1990-1993, Raphael Manfredi
  618. X#  
  619. X#  You may redistribute only under the terms of the Artistic License,
  620. X#  as specified in the README file that comes with the distribution.
  621. X#  You may reuse parts of this distribution only within the terms of
  622. X#  that same Artistic License; a copy of which may be found at the root
  623. X#  of the source tree for mailagent 3.0.
  624. X#
  625. X# $Log: annotate.t,v $
  626. X# Revision 3.0  1993/11/29  13:49:26  ram
  627. X# Baseline for mailagent 3.0 netwide release.
  628. X#
  629. X
  630. Xdo '../pl/cmd.pl';
  631. X
  632. X&add_header('X-Tag: annotate');
  633. X`$cmd`;
  634. X$? == 0 || print "1\n";
  635. X-f "$user" || print "2\n";        # No match -> leave
  636. X&get_log(3, $user);
  637. X&check_log('^X-Anno-1:', 4) == 2 || print "5\n";
  638. X&check_log('^X-Anno-2:', 6) == 2 || print "7\n";
  639. X&check_log('^X-Anno-3:', 8) == 1 || print "9\n";
  640. X&check_log('^X-Anno-4:', 10) == 1 || print "11\n";
  641. X¬_log('^X-Anno-Error:', 12);
  642. X
  643. Xunlink "$user", 'mail';
  644. Xprint "0\n";
  645. END_OF_FILE
  646.   if test 991 -ne `wc -c <'agent/test/cmd/annotate.t'`; then
  647.     echo shar: \"'agent/test/cmd/annotate.t'\" unpacked with wrong size!
  648.   fi
  649.   # end of 'agent/test/cmd/annotate.t'
  650. fi
  651. if test -f 'agent/test/cmd/assign.t' -a "${1}" != "-c" ; then 
  652.   echo shar: Will not clobber existing file \"'agent/test/cmd/assign.t'\"
  653. else
  654.   echo shar: Extracting \"'agent/test/cmd/assign.t'\" \(1087 characters\)
  655.   sed "s/^X//" >'agent/test/cmd/assign.t' <<'END_OF_FILE'
  656. X# Test ASSIGN command
  657. X
  658. X# $Id: assign.t,v 3.0 1993/11/29 13:49:27 ram Exp ram $
  659. X#
  660. X#  Copyright (c) 1990-1993, Raphael Manfredi
  661. X#  
  662. X#  You may redistribute only under the terms of the Artistic License,
  663. X#  as specified in the README file that comes with the distribution.
  664. X#  You may reuse parts of this distribution only within the terms of
  665. X#  that same Artistic License; a copy of which may be found at the root
  666. X#  of the source tree for mailagent 3.0.
  667. X#
  668. X# $Log: assign.t,v $
  669. X# Revision 3.0  1993/11/29  13:49:27  ram
  670. X# Baseline for mailagent 3.0 netwide release.
  671. X#
  672. X
  673. Xdo '../pl/cmd.pl';
  674. Xunlink 'output';
  675. X
  676. X&add_header('X-Tag: assign #1');
  677. X`$cmd`;
  678. X$? == 0 || print "1\n";
  679. X-f 'output' || print "2\n";        # Result of various assign commands
  680. Xchop($output = `cat output 2>/dev/null`);
  681. X$output eq 'ram,try,try.2' || print "3\n";
  682. Xunlink 'output';
  683. X
  684. X&replace_header('X-Tag: assign #2');
  685. X`$cmd`;
  686. X$? == 0 || print "4\n";
  687. X-f 'output' || print "5\n";        # Result of various assign commands
  688. Xchop($output = `cat output 2>/dev/null`);
  689. X$output eq '7,1+2,7' || print "6\n";
  690. X
  691. Xunlink 'output', 'mail';
  692. Xprint "0\n";
  693. END_OF_FILE
  694.   if test 1087 -ne `wc -c <'agent/test/cmd/assign.t'`; then
  695.     echo shar: \"'agent/test/cmd/assign.t'\" unpacked with wrong size!
  696.   fi
  697.   # end of 'agent/test/cmd/assign.t'
  698. fi
  699. if test -f 'agent/test/cmd/back.t' -a "${1}" != "-c" ; then 
  700.   echo shar: Will not clobber existing file \"'agent/test/cmd/back.t'\"
  701. else
  702.   echo shar: Extracting \"'agent/test/cmd/back.t'\" \(1097 characters\)
  703.   sed "s/^X//" >'agent/test/cmd/back.t' <<'END_OF_FILE'
  704. X# Test BACK command
  705. X
  706. X# $Id: back.t,v 3.0 1993/11/29 13:49:28 ram Exp ram $
  707. X#
  708. X#  Copyright (c) 1990-1993, Raphael Manfredi
  709. X#  
  710. X#  You may redistribute only under the terms of the Artistic License,
  711. X#  as specified in the README file that comes with the distribution.
  712. X#  You may reuse parts of this distribution only within the terms of
  713. X#  that same Artistic License; a copy of which may be found at the root
  714. X#  of the source tree for mailagent 3.0.
  715. X#
  716. X# $Log: back.t,v $
  717. X# Revision 3.0  1993/11/29  13:49:28  ram
  718. X# Baseline for mailagent 3.0 netwide release.
  719. X#
  720. X
  721. Xdo '../pl/cmd.pl';
  722. Xunlink 'output';
  723. X
  724. Xopen(PGM, ">pgm") || print "1\n";
  725. Xprint PGM '/bin/echo "RUN /bin/echo it works! > output; SAVE other"', "\n";
  726. Xclose PGM;
  727. Xchmod 0755, 'pgm';
  728. X
  729. X&add_header('X-Tag: back');
  730. X`$cmd`;
  731. X$? == 0 || print "2\n";
  732. X-f 'output' || print "3\n";        # Where output is created
  733. Xchop($output = `cat output 2>/dev/null`);
  734. X$output eq 'it works!' || print "4\n";
  735. X-f 'other' || print "5\n";        # Mail also saved
  736. X-f "$user" && print "6\n";        # So default action does not apply
  737. X
  738. Xunlink 'pgm', 'output', 'mail', 'other';
  739. Xprint "0\n";
  740. END_OF_FILE
  741.   if test 1097 -ne `wc -c <'agent/test/cmd/back.t'`; then
  742.     echo shar: \"'agent/test/cmd/back.t'\" unpacked with wrong size!
  743.   fi
  744.   # end of 'agent/test/cmd/back.t'
  745. fi
  746. if test -f 'agent/test/cmd/begin.t' -a "${1}" != "-c" ; then 
  747.   echo shar: Will not clobber existing file \"'agent/test/cmd/begin.t'\"
  748. else
  749.   echo shar: Extracting \"'agent/test/cmd/begin.t'\" \(946 characters\)
  750.   sed "s/^X//" >'agent/test/cmd/begin.t' <<'END_OF_FILE'
  751. X# Test BEGIN command
  752. X
  753. X# $Id: begin.t,v 3.0 1993/11/29 13:49:28 ram Exp ram $
  754. X#
  755. X#  Copyright (c) 1990-1993, Raphael Manfredi
  756. X#  
  757. X#  You may redistribute only under the terms of the Artistic License,
  758. X#  as specified in the README file that comes with the distribution.
  759. X#  You may reuse parts of this distribution only within the terms of
  760. X#  that same Artistic License; a copy of which may be found at the root
  761. X#  of the source tree for mailagent 3.0.
  762. X#
  763. X# $Log: begin.t,v $
  764. X# Revision 3.0  1993/11/29  13:49:28  ram
  765. X# Baseline for mailagent 3.0 netwide release.
  766. X#
  767. X
  768. Xdo '../pl/cmd.pl';
  769. Xunlink 'one', 'two', 'three';
  770. X
  771. X&add_header('X-Tag: begin');
  772. X`$cmd`;
  773. X$? == 0 || print "1\n";
  774. X-f 'one' && print "2\n";        # Cannot happen in TWO mode
  775. X-f 'two' || print "3\n";        # Must be saved here
  776. X-f 'three' || print "4\n";        # And also here by THREE mode
  777. X-f "$user" && print "5\n";        # So default action did not apply
  778. X
  779. Xunlink 'one', 'two', 'three', 'mail';
  780. Xprint "0\n";
  781. END_OF_FILE
  782.   if test 946 -ne `wc -c <'agent/test/cmd/begin.t'`; then
  783.     echo shar: \"'agent/test/cmd/begin.t'\" unpacked with wrong size!
  784.   fi
  785.   # end of 'agent/test/cmd/begin.t'
  786. fi
  787. if test -f 'agent/test/cmd/give.t' -a "${1}" != "-c" ; then 
  788.   echo shar: Will not clobber existing file \"'agent/test/cmd/give.t'\"
  789. else
  790.   echo shar: Extracting \"'agent/test/cmd/give.t'\" \(1033 characters\)
  791.   sed "s/^X//" >'agent/test/cmd/give.t' <<'END_OF_FILE'
  792. X# Test GIVE command
  793. X
  794. X# $Id: give.t,v 3.0 1993/11/29 13:49:32 ram Exp ram $
  795. X#
  796. X#  Copyright (c) 1990-1993, Raphael Manfredi
  797. X#  
  798. X#  You may redistribute only under the terms of the Artistic License,
  799. X#  as specified in the README file that comes with the distribution.
  800. X#  You may reuse parts of this distribution only within the terms of
  801. X#  that same Artistic License; a copy of which may be found at the root
  802. X#  of the source tree for mailagent 3.0.
  803. X#
  804. X# $Log: give.t,v $
  805. X# Revision 3.0  1993/11/29  13:49:32  ram
  806. X# Baseline for mailagent 3.0 netwide release.
  807. X#
  808. X
  809. Xdo '../pl/cmd.pl';
  810. Xunlink 'output';
  811. X
  812. X&add_header('X-Tag: give');
  813. X`$cmd`;
  814. X$? == 0 || print "1\n";
  815. X-f 'output' || print "2\n";        # Where output is created
  816. Xchop($output = `cat output 2>/dev/null`);
  817. X@output = split(' ', $output);
  818. X@valid = (17, 132, 804);        # Output of wc on body
  819. X$ok = 1;
  820. Xfor ($i = 0; $i < 3; $i++) {
  821. X    $ok = 0 if $valid[$i] != $output[$i];
  822. X}
  823. X$ok || print "3\n";
  824. X-f "$user" || print "4\n";        # Default action applies
  825. X
  826. Xunlink 'output', 'mail', "$user";
  827. Xprint "0\n";
  828. END_OF_FILE
  829.   if test 1033 -ne `wc -c <'agent/test/cmd/give.t'`; then
  830.     echo shar: \"'agent/test/cmd/give.t'\" unpacked with wrong size!
  831.   fi
  832.   # end of 'agent/test/cmd/give.t'
  833. fi
  834. if test -f 'agent/test/cmd/pass.t' -a "${1}" != "-c" ; then 
  835.   echo shar: Will not clobber existing file \"'agent/test/cmd/pass.t'\"
  836. else
  837.   echo shar: Extracting \"'agent/test/cmd/pass.t'\" \(998 characters\)
  838.   sed "s/^X//" >'agent/test/cmd/pass.t' <<'END_OF_FILE'
  839. X# The PASS command
  840. X
  841. X# $Id: pass.t,v 3.0 1993/11/29 13:49:37 ram Exp ram $
  842. X#
  843. X#  Copyright (c) 1990-1993, Raphael Manfredi
  844. X#  
  845. X#  You may redistribute only under the terms of the Artistic License,
  846. X#  as specified in the README file that comes with the distribution.
  847. X#  You may reuse parts of this distribution only within the terms of
  848. X#  that same Artistic License; a copy of which may be found at the root
  849. X#  of the source tree for mailagent 3.0.
  850. X#
  851. X# $Log: pass.t,v $
  852. X# Revision 3.0  1993/11/29  13:49:37  ram
  853. X# Baseline for mailagent 3.0 netwide release.
  854. X#
  855. X
  856. Xdo '../pl/cmd.pl';
  857. Xunlink 'output';
  858. X
  859. X&add_header('X-Tag: pass');
  860. X`$cmd`;
  861. X$? == 0 || print "1\n";
  862. X-f 'output' || print "2\n";        # Where mail is saved
  863. X`grep -v X-Filter: output > comp`;
  864. X$? == 0 || print "3\n";
  865. X`grep -v and mail > ok`;
  866. X((-s 'comp') - 1) == -s 'ok' || print "4\n";    # SAVE adds extra final new-line
  867. X-s 'comp' != -s 'output' || print "5\n";    # Casually check X-Filter was there
  868. X
  869. Xunlink 'output', 'mail', 'ok', 'comp';
  870. Xprint "0\n";
  871. END_OF_FILE
  872.   if test 998 -ne `wc -c <'agent/test/cmd/pass.t'`; then
  873.     echo shar: \"'agent/test/cmd/pass.t'\" unpacked with wrong size!
  874.   fi
  875.   # end of 'agent/test/cmd/pass.t'
  876. fi
  877. if test -f 'agent/test/cmd/pipe.t' -a "${1}" != "-c" ; then 
  878.   echo shar: Will not clobber existing file \"'agent/test/cmd/pipe.t'\"
  879. else
  880.   echo shar: Extracting \"'agent/test/cmd/pipe.t'\" \(1056 characters\)
  881.   sed "s/^X//" >'agent/test/cmd/pipe.t' <<'END_OF_FILE'
  882. X# The PIPE command
  883. X
  884. X# $Id: pipe.t,v 3.0 1993/11/29 13:49:39 ram Exp ram $
  885. X#
  886. X#  Copyright (c) 1990-1993, Raphael Manfredi
  887. X#  
  888. X#  You may redistribute only under the terms of the Artistic License,
  889. X#  as specified in the README file that comes with the distribution.
  890. X#  You may reuse parts of this distribution only within the terms of
  891. X#  that same Artistic License; a copy of which may be found at the root
  892. X#  of the source tree for mailagent 3.0.
  893. X#
  894. X# $Log: pipe.t,v $
  895. X# Revision 3.0  1993/11/29  13:49:39  ram
  896. X# Baseline for mailagent 3.0 netwide release.
  897. X#
  898. X
  899. Xdo '../pl/cmd.pl';
  900. Xunlink 'output';
  901. X
  902. X&add_header('X-Tag: pipe');
  903. X`$cmd`;
  904. X$? == 0 || print "1\n";
  905. X-f 'output' || print "2\n";        # Where output is created
  906. Xchop($output = `cat output 2>/dev/null`);
  907. X@output = split(' ', $output);
  908. X@valid = (35, 229, 1632);        # Output of wc on whole mail with X-Tag field
  909. X$ok = 1;
  910. Xfor ($i = 0; $i < 3; $i++) {
  911. X    $ok = 0 if $valid[$i] != $output[$i];
  912. X}
  913. X$ok || print "3\n";
  914. X-f "$user" || print "4\n";        # Default action applies
  915. X
  916. Xunlink 'output', 'mail', "$user";
  917. Xprint "0\n";
  918. END_OF_FILE
  919.   if test 1056 -ne `wc -c <'agent/test/cmd/pipe.t'`; then
  920.     echo shar: \"'agent/test/cmd/pipe.t'\" unpacked with wrong size!
  921.   fi
  922.   # end of 'agent/test/cmd/pipe.t'
  923. fi
  924. if test -f 'agent/test/cmd/purify.t' -a "${1}" != "-c" ; then 
  925.   echo shar: Will not clobber existing file \"'agent/test/cmd/purify.t'\"
  926. else
  927.   echo shar: Extracting \"'agent/test/cmd/purify.t'\" \(1011 characters\)
  928.   sed "s/^X//" >'agent/test/cmd/purify.t' <<'END_OF_FILE'
  929. X# The PURIFY command
  930. X
  931. X# $Id: purify.t,v 3.0 1993/11/29 13:49:41 ram Exp ram $
  932. X#
  933. X#  Copyright (c) 1990-1993, Raphael Manfredi
  934. X#  
  935. X#  You may redistribute only under the terms of the Artistic License,
  936. X#  as specified in the README file that comes with the distribution.
  937. X#  You may reuse parts of this distribution only within the terms of
  938. X#  that same Artistic License; a copy of which may be found at the root
  939. X#  of the source tree for mailagent 3.0.
  940. X#
  941. X# $Log: purify.t,v $
  942. X# Revision 3.0  1993/11/29  13:49:41  ram
  943. X# Baseline for mailagent 3.0 netwide release.
  944. X#
  945. X
  946. Xdo '../pl/cmd.pl';
  947. Xunlink 'output';
  948. X
  949. X&add_header('X-Tag: purify');
  950. X`$cmd`;
  951. X$? == 0 || print "1\n";
  952. X-f 'output' || print "2\n";        # Where mail is saved
  953. X`grep -v X-Filter: output > comp`;
  954. X$? == 0 || print "3\n";
  955. X`grep -v Subject: mail > ok`;
  956. X((-s 'comp') - 1) == -s 'ok' || print "4\n";    # SAVE adds extra final new-line
  957. X-s 'comp' != -s 'output' || print "5\n";    # Casually check X-Filter was there
  958. X
  959. Xunlink 'output', 'mail', 'ok', 'comp';
  960. Xprint "0\n";
  961. END_OF_FILE
  962.   if test 1011 -ne `wc -c <'agent/test/cmd/purify.t'`; then
  963.     echo shar: \"'agent/test/cmd/purify.t'\" unpacked with wrong size!
  964.   fi
  965.   # end of 'agent/test/cmd/purify.t'
  966. fi
  967. if test -f 'agent/test/cmd/reject.t' -a "${1}" != "-c" ; then 
  968.   echo shar: Will not clobber existing file \"'agent/test/cmd/reject.t'\"
  969. else
  970.   echo shar: Extracting \"'agent/test/cmd/reject.t'\" \(980 characters\)
  971.   sed "s/^X//" >'agent/test/cmd/reject.t' <<'END_OF_FILE'
  972. X# The REJECT command
  973. X
  974. X# $Id: reject.t,v 3.0 1993/11/29 13:49:44 ram Exp ram $
  975. X#
  976. X#  Copyright (c) 1990-1993, Raphael Manfredi
  977. X#  
  978. X#  You may redistribute only under the terms of the Artistic License,
  979. X#  as specified in the README file that comes with the distribution.
  980. X#  You may reuse parts of this distribution only within the terms of
  981. X#  that same Artistic License; a copy of which may be found at the root
  982. X#  of the source tree for mailagent 3.0.
  983. X#
  984. X# $Log: reject.t,v $
  985. X# Revision 3.0  1993/11/29  13:49:44  ram
  986. X# Baseline for mailagent 3.0 netwide release.
  987. X#
  988. X
  989. Xdo '../pl/cmd.pl';
  990. Xunlink "$user.1", 'always', 'never';
  991. X
  992. X# Make sure everything after a REJECT is not executed
  993. X&add_header('X-Tag: reject');
  994. X`$cmd`;
  995. X$? == 0 || print "1\n";
  996. X-f "$user" || print "2\n";        # REJECT -> no match -> leave
  997. X-f "$user.1" && print "3\n";    # This SAVE was after the REJECT
  998. X-f 'always' || print "4\n";
  999. X-f 'never' && print "5\n";
  1000. X
  1001. Xunlink "$user.1", "$user", 'always', 'never', 'mail';
  1002. Xprint "0\n";
  1003. END_OF_FILE
  1004.   if test 980 -ne `wc -c <'agent/test/cmd/reject.t'`; then
  1005.     echo shar: \"'agent/test/cmd/reject.t'\" unpacked with wrong size!
  1006.   fi
  1007.   # end of 'agent/test/cmd/reject.t'
  1008. fi
  1009. if test -f 'agent/test/cmd/require.t' -a "${1}" != "-c" ; then 
  1010.   echo shar: Will not clobber existing file \"'agent/test/cmd/require.t'\"
  1011. else
  1012.   echo shar: Extracting \"'agent/test/cmd/require.t'\" \(1112 characters\)
  1013.   sed "s/^X//" >'agent/test/cmd/require.t' <<'END_OF_FILE'
  1014. X# Test REQUIRE command
  1015. X
  1016. X# $Id: require.t,v 3.0 1993/11/29 13:49:45 ram Exp ram $
  1017. X#
  1018. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1019. X#  
  1020. X#  You may redistribute only under the terms of the Artistic License,
  1021. X#  as specified in the README file that comes with the distribution.
  1022. X#  You may reuse parts of this distribution only within the terms of
  1023. X#  that same Artistic License; a copy of which may be found at the root
  1024. X#  of the source tree for mailagent 3.0.
  1025. X#
  1026. X# $Log: require.t,v $
  1027. X# Revision 3.0  1993/11/29  13:49:45  ram
  1028. X# Baseline for mailagent 3.0 netwide release.
  1029. X#
  1030. X
  1031. Xdo '../pl/cmd.pl';
  1032. Xunlink 'perl.1', 'perl.2', 'never', 'ok';
  1033. X
  1034. Xopen(PERL, ">perl.1") || print "1\n";
  1035. Xprint PERL <<'EOP';
  1036. Xsub perl_1 {
  1037. X    local($name) = @_;
  1038. X    $name;
  1039. X}
  1040. XEOP
  1041. Xclose PERL;
  1042. X
  1043. Xopen(PERL, ">perl.2") || print "2\n";
  1044. Xprint PERL <<'EOP';
  1045. X$var = "perl_2";
  1046. X
  1047. Xsub perl_2 {
  1048. X    $var;
  1049. X}
  1050. XEOP
  1051. Xclose PERL;
  1052. X
  1053. X&add_header('X-Tag: require');
  1054. X`$cmd`;
  1055. X$? == 0 || print "3\n";
  1056. X-f "$user" && print "4\n";
  1057. X-f 'never' && print "5\n";
  1058. X&get_log(6, 'ok');
  1059. X&check_log('^We got perl_1 and perl_2 here', 7);
  1060. X
  1061. Xunlink 'mail', 'perl.1', 'perl.2', 'never', 'ok';
  1062. Xprint "0\n";
  1063. END_OF_FILE
  1064.   if test 1112 -ne `wc -c <'agent/test/cmd/require.t'`; then
  1065.     echo shar: \"'agent/test/cmd/require.t'\" unpacked with wrong size!
  1066.   fi
  1067.   # end of 'agent/test/cmd/require.t'
  1068. fi
  1069. if test -f 'agent/test/cmd/restart.t' -a "${1}" != "-c" ; then 
  1070.   echo shar: Will not clobber existing file \"'agent/test/cmd/restart.t'\"
  1071. else
  1072.   echo shar: Extracting \"'agent/test/cmd/restart.t'\" \(947 characters\)
  1073.   sed "s/^X//" >'agent/test/cmd/restart.t' <<'END_OF_FILE'
  1074. X# The RESTART command
  1075. X
  1076. X# $Id: restart.t,v 3.0 1993/11/29 13:49:46 ram Exp ram $
  1077. X#
  1078. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1079. X#  
  1080. X#  You may redistribute only under the terms of the Artistic License,
  1081. X#  as specified in the README file that comes with the distribution.
  1082. X#  You may reuse parts of this distribution only within the terms of
  1083. X#  that same Artistic License; a copy of which may be found at the root
  1084. X#  of the source tree for mailagent 3.0.
  1085. X#
  1086. X# $Log: restart.t,v $
  1087. X# Revision 3.0  1993/11/29  13:49:46  ram
  1088. X# Baseline for mailagent 3.0 netwide release.
  1089. X#
  1090. X
  1091. Xdo '../pl/cmd.pl';
  1092. Xunlink "$user.1", 'never';
  1093. X
  1094. X# Make sure everything after a RESTART is not executed
  1095. X&add_header('X-Tag: restart');
  1096. X`$cmd`;
  1097. X$? == 0 || print "1\n";
  1098. X-f "$user" || print "2\n";        # RESTART -> no match -> leave
  1099. X-f "$user.1" && print "3\n";    # This SAVE was after the RESTART
  1100. X-f 'never' && print "4\n";        # Idem
  1101. X
  1102. Xunlink "$user.1", "$user", 'never', 'mail';
  1103. Xprint "0\n";
  1104. END_OF_FILE
  1105.   if test 947 -ne `wc -c <'agent/test/cmd/restart.t'`; then
  1106.     echo shar: \"'agent/test/cmd/restart.t'\" unpacked with wrong size!
  1107.   fi
  1108.   # end of 'agent/test/cmd/restart.t'
  1109. fi
  1110. if test -f 'agent/test/cmd/select.t' -a "${1}" != "-c" ; then 
  1111.   echo shar: Will not clobber existing file \"'agent/test/cmd/select.t'\"
  1112. else
  1113.   echo shar: Extracting \"'agent/test/cmd/select.t'\" \(934 characters\)
  1114.   sed "s/^X//" >'agent/test/cmd/select.t' <<'END_OF_FILE'
  1115. X# The SELECT command
  1116. X
  1117. X# $Id: select.t,v 3.0 1993/11/29 13:49:48 ram Exp ram $
  1118. X#
  1119. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1120. X#  
  1121. X#  You may redistribute only under the terms of the Artistic License,
  1122. X#  as specified in the README file that comes with the distribution.
  1123. X#  You may reuse parts of this distribution only within the terms of
  1124. X#  that same Artistic License; a copy of which may be found at the root
  1125. X#  of the source tree for mailagent 3.0.
  1126. X#
  1127. X# $Log: select.t,v $
  1128. X# Revision 3.0  1993/11/29  13:49:48  ram
  1129. X# Baseline for mailagent 3.0 netwide release.
  1130. X#
  1131. X
  1132. Xdo '../pl/cmd.pl';
  1133. Xunlink 'one', 'two', 'three', 'four', 'five', "$user";
  1134. X
  1135. X&add_header('X-Tag: select');
  1136. X`$cmd`;
  1137. X$? == 0 || print "1\n";
  1138. X-f "$user" && print "2\n";
  1139. X-f 'one' || print "3\n";
  1140. X-f 'two' && print "4\n";
  1141. X-f 'three' || print "5\n";
  1142. X-f 'four' || print "6\n";
  1143. X-f 'five' && print "7\n";
  1144. X
  1145. Xunlink 'one', 'two', 'three', 'four', 'five', "$user", 'mail';
  1146. Xprint "0\n";
  1147. END_OF_FILE
  1148.   if test 934 -ne `wc -c <'agent/test/cmd/select.t'`; then
  1149.     echo shar: \"'agent/test/cmd/select.t'\" unpacked with wrong size!
  1150.   fi
  1151.   # end of 'agent/test/cmd/select.t'
  1152. fi
  1153. if test -f 'agent/test/cmd/unknown.t' -a "${1}" != "-c" ; then 
  1154.   echo shar: Will not clobber existing file \"'agent/test/cmd/unknown.t'\"
  1155. else
  1156.   echo shar: Extracting \"'agent/test/cmd/unknown.t'\" \(956 characters\)
  1157.   sed "s/^X//" >'agent/test/cmd/unknown.t' <<'END_OF_FILE'
  1158. X# Ensure unknown command defaults to LEAVE only when no saving was done
  1159. X
  1160. X# $Id: unknown.t,v 3.0 1993/11/29 13:49:54 ram Exp ram $
  1161. X#
  1162. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1163. X#  
  1164. X#  You may redistribute only under the terms of the Artistic License,
  1165. X#  as specified in the README file that comes with the distribution.
  1166. X#  You may reuse parts of this distribution only within the terms of
  1167. X#  that same Artistic License; a copy of which may be found at the root
  1168. X#  of the source tree for mailagent 3.0.
  1169. X#
  1170. X# $Log: unknown.t,v $
  1171. X# Revision 3.0  1993/11/29  13:49:54  ram
  1172. X# Baseline for mailagent 3.0 netwide release.
  1173. X#
  1174. X
  1175. Xdo '../pl/cmd.pl';
  1176. Xunlink "$user";
  1177. X
  1178. X&add_header('X-Tag: unknown #1');
  1179. X`$cmd`;
  1180. X$? == 0 || print "1\n";
  1181. X-f "$user" || print "2\n";        # Unknown was first
  1182. Xunlink "$user";
  1183. X
  1184. X&replace_header('X-Tag: unknown #2');
  1185. X`$cmd`;
  1186. X$? == 0 || print "3\n";
  1187. X-f "$user" && print "4\n";        # Unknown after saving status known
  1188. X
  1189. Xunlink "$user", 'mail';
  1190. Xprint "0\n";
  1191. END_OF_FILE
  1192.   if test 956 -ne `wc -c <'agent/test/cmd/unknown.t'`; then
  1193.     echo shar: \"'agent/test/cmd/unknown.t'\" unpacked with wrong size!
  1194.   fi
  1195.   # end of 'agent/test/cmd/unknown.t'
  1196. fi
  1197. if test -f 'agent/test/filter/case.t' -a "${1}" != "-c" ; then 
  1198.   echo shar: Will not clobber existing file \"'agent/test/filter/case.t'\"
  1199. else
  1200.   echo shar: Extracting \"'agent/test/filter/case.t'\" \(945 characters\)
  1201.   sed "s/^X//" >'agent/test/filter/case.t' <<'END_OF_FILE'
  1202. X# Check header field case insensitiveness
  1203. X
  1204. X# $Id: case.t,v 3.0 1993/11/29 13:49:57 ram Exp ram $
  1205. X#
  1206. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1207. X#  
  1208. X#  You may redistribute only under the terms of the Artistic License,
  1209. X#  as specified in the README file that comes with the distribution.
  1210. X#  You may reuse parts of this distribution only within the terms of
  1211. X#  that same Artistic License; a copy of which may be found at the root
  1212. X#  of the source tree for mailagent 3.0.
  1213. X#
  1214. X# $Log: case.t,v $
  1215. X# Revision 3.0  1993/11/29  13:49:57  ram
  1216. X# Baseline for mailagent 3.0 netwide release.
  1217. X#
  1218. X
  1219. Xdo '../pl/filter.pl';
  1220. Xdo '../pl/logfile.pl';
  1221. Xunlink 'always';
  1222. X
  1223. X&add_header('x-tag: case');
  1224. X&add_header('CC: root');
  1225. X`$cmd`;
  1226. X$? == 0 || print "1\n";
  1227. X-f "$user" && print "2\n";        # No default action
  1228. X-f 'always' || print "3\n";        # Recognized both X-Tag and CC
  1229. X
  1230. X&get_log(4, 'always');
  1231. X¬_log('CC:', 5);                # CC was STRIPed out
  1232. X
  1233. Xunlink 'always', "$user";
  1234. Xprint "0\n";
  1235. END_OF_FILE
  1236.   if test 945 -ne `wc -c <'agent/test/filter/case.t'`; then
  1237.     echo shar: \"'agent/test/filter/case.t'\" unpacked with wrong size!
  1238.   fi
  1239.   # end of 'agent/test/filter/case.t'
  1240. fi
  1241. if test -f 'agent/test/filter/group.t' -a "${1}" != "-c" ; then 
  1242.   echo shar: Will not clobber existing file \"'agent/test/filter/group.t'\"
  1243. else
  1244.   echo shar: Extracting \"'agent/test/filter/group.t'\" \(1021 characters\)
  1245.   sed "s/^X//" >'agent/test/filter/group.t' <<'END_OF_FILE'
  1246. X# Test grouping of selectors (mixing normal and inverted selections)
  1247. X
  1248. X# $Id: group.t,v 3.0 1993/11/29 13:49:59 ram Exp ram $
  1249. X#
  1250. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1251. X#  
  1252. X#  You may redistribute only under the terms of the Artistic License,
  1253. X#  as specified in the README file that comes with the distribution.
  1254. X#  You may reuse parts of this distribution only within the terms of
  1255. X#  that same Artistic License; a copy of which may be found at the root
  1256. X#  of the source tree for mailagent 3.0.
  1257. X#
  1258. X# $Log: group.t,v $
  1259. X# Revision 3.0  1993/11/29  13:49:59  ram
  1260. X# Baseline for mailagent 3.0 netwide release.
  1261. X#
  1262. X
  1263. Xdo '../pl/filter.pl';
  1264. Xunlink 'never', 'always', 'always.2', 'always.3';
  1265. X
  1266. X&add_header('X-Tag: group');
  1267. X`$cmd`;
  1268. X$? == 0 || print "1\n";
  1269. X-f "$user" && print "2\n";        # Mail has been deleted
  1270. X-f 'never' && print "3\n";        # Cannot match
  1271. X-f 'always' || print "4\n";        # This one must have matched
  1272. X-f 'always.2' || print "5\n";
  1273. X-f 'always.3' || print "6\n";
  1274. X
  1275. Xunlink 'never', 'always', 'always.2', 'always.3';
  1276. Xprint "0\n";
  1277. END_OF_FILE
  1278.   if test 1021 -ne `wc -c <'agent/test/filter/group.t'`; then
  1279.     echo shar: \"'agent/test/filter/group.t'\" unpacked with wrong size!
  1280.   fi
  1281.   # end of 'agent/test/filter/group.t'
  1282. fi
  1283. if test -f 'agent/test/filter/loop.t' -a "${1}" != "-c" ; then 
  1284.   echo shar: Will not clobber existing file \"'agent/test/filter/loop.t'\"
  1285. else
  1286.   echo shar: Extracting \"'agent/test/filter/loop.t'\" \(932 characters\)
  1287.   sed "s/^X//" >'agent/test/filter/loop.t' <<'END_OF_FILE'
  1288. X# Ensure loops are detected
  1289. X
  1290. X# $Id: loop.t,v 3.0 1993/11/29 13:50:02 ram Exp ram $
  1291. X#
  1292. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1293. X#  
  1294. X#  You may redistribute only under the terms of the Artistic License,
  1295. X#  as specified in the README file that comes with the distribution.
  1296. X#  You may reuse parts of this distribution only within the terms of
  1297. X#  that same Artistic License; a copy of which may be found at the root
  1298. X#  of the source tree for mailagent 3.0.
  1299. X#
  1300. X# $Log: loop.t,v $
  1301. X# Revision 3.0  1993/11/29  13:50:02  ram
  1302. X# Baseline for mailagent 3.0 netwide release.
  1303. X#
  1304. X
  1305. Xdo '../pl/filter.pl';
  1306. X
  1307. X&add_header('X-Tag: loop #1');
  1308. X`$cmd`;
  1309. X$? == 0 || print "1\n";
  1310. X-f "$user" || print "2\n";        # Loop was detected (otherwise never ends)
  1311. X
  1312. X`mv $user mail 2>/dev/null`;
  1313. X&replace_header('X-Tag: loop #2');
  1314. X`$cmd`;
  1315. X$? == 0 || print "3\n";
  1316. X-f "$user" || print "4\n";        # Loop was detected (otherwise mail deleted)
  1317. X
  1318. Xunlink 'mail', "$user";
  1319. Xprint "0\n";
  1320. END_OF_FILE
  1321.   if test 932 -ne `wc -c <'agent/test/filter/loop.t'`; then
  1322.     echo shar: \"'agent/test/filter/loop.t'\" unpacked with wrong size!
  1323.   fi
  1324.   # end of 'agent/test/filter/loop.t'
  1325. fi
  1326. if test -f 'agent/test/filter/mode.t' -a "${1}" != "-c" ; then 
  1327.   echo shar: Will not clobber existing file \"'agent/test/filter/mode.t'\"
  1328. else
  1329.   echo shar: Extracting \"'agent/test/filter/mode.t'\" \(1015 characters\)
  1330.   sed "s/^X//" >'agent/test/filter/mode.t' <<'END_OF_FILE'
  1331. X# Test negated mode
  1332. X
  1333. X# $Id: mode.t,v 3.0 1993/11/29 13:50:02 ram Exp ram $
  1334. X#
  1335. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1336. X#  
  1337. X#  You may redistribute only under the terms of the Artistic License,
  1338. X#  as specified in the README file that comes with the distribution.
  1339. X#  You may reuse parts of this distribution only within the terms of
  1340. X#  that same Artistic License; a copy of which may be found at the root
  1341. X#  of the source tree for mailagent 3.0.
  1342. X#
  1343. X# $Log: mode.t,v $
  1344. X# Revision 3.0  1993/11/29  13:50:02  ram
  1345. X# Baseline for mailagent 3.0 netwide release.
  1346. X#
  1347. X
  1348. Xdo '../pl/filter.pl';
  1349. Xunlink 'never', 'always', 'always.2', 'always.3';
  1350. X
  1351. X&add_header('X-Tag: mode');
  1352. X`$cmd`;
  1353. X$? == 0 || print "1\n";
  1354. X-f "$user" && print "2\n";        # Mail has been deleted
  1355. X-f 'never' && print "3\n";        # Cannot match
  1356. X-f 'always' || print "4\n";        # This one must have matched
  1357. X-f 'always.2' || print "5\n";    # Direct match
  1358. X-f 'always.3' || print "6\n";    # Another implied direct match
  1359. X
  1360. Xunlink 'never', 'always', 'always.2', 'always.3';
  1361. Xprint "0\n";
  1362. END_OF_FILE
  1363.   if test 1015 -ne `wc -c <'agent/test/filter/mode.t'`; then
  1364.     echo shar: \"'agent/test/filter/mode.t'\" unpacked with wrong size!
  1365.   fi
  1366.   # end of 'agent/test/filter/mode.t'
  1367. fi
  1368. if test -f 'agent/test/filter/pattern.t' -a "${1}" != "-c" ; then 
  1369.   echo shar: Will not clobber existing file \"'agent/test/filter/pattern.t'\"
  1370. else
  1371.   echo shar: Extracting \"'agent/test/filter/pattern.t'\" \(950 characters\)
  1372.   sed "s/^X//" >'agent/test/filter/pattern.t' <<'END_OF_FILE'
  1373. X# Test selectors specified via a pattern
  1374. X
  1375. X# $Id: pattern.t,v 3.0 1993/11/29 13:50:05 ram Exp ram $
  1376. X#
  1377. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1378. X#  
  1379. X#  You may redistribute only under the terms of the Artistic License,
  1380. X#  as specified in the README file that comes with the distribution.
  1381. X#  You may reuse parts of this distribution only within the terms of
  1382. X#  that same Artistic License; a copy of which may be found at the root
  1383. X#  of the source tree for mailagent 3.0.
  1384. X#
  1385. X# $Log: pattern.t,v $
  1386. X# Revision 3.0  1993/11/29  13:50:05  ram
  1387. X# Baseline for mailagent 3.0 netwide release.
  1388. X#
  1389. X
  1390. Xdo '../pl/filter.pl';
  1391. Xunlink 'macro';
  1392. X
  1393. X&add_header('X-Tag: pattern');
  1394. X&add_header('Replied: ram@eiffel.com');
  1395. X`$cmd`;
  1396. X$? == 0 || print "1\n";
  1397. X-f "$user" && print "2\n";        # Must have been deleted
  1398. X-f 'macro' || print "3\n";        # Created by RUN
  1399. Xchop($macro = `cat macro 2>/dev/null`);
  1400. X$macro eq 'Received,Replied;Subject;' || print "4\n";
  1401. X
  1402. Xunlink 'macro';
  1403. Xprint "0\n";
  1404. END_OF_FILE
  1405.   if test 950 -ne `wc -c <'agent/test/filter/pattern.t'`; then
  1406.     echo shar: \"'agent/test/filter/pattern.t'\" unpacked with wrong size!
  1407.   fi
  1408.   # end of 'agent/test/filter/pattern.t'
  1409. fi
  1410. if test -f 'agent/test/filter/status.t' -a "${1}" != "-c" ; then 
  1411.   echo shar: Will not clobber existing file \"'agent/test/filter/status.t'\"
  1412. else
  1413.   echo shar: Extracting \"'agent/test/filter/status.t'\" \(969 characters\)
  1414.   sed "s/^X//" >'agent/test/filter/status.t' <<'END_OF_FILE'
  1415. X# Make sure commands record their exit status
  1416. X
  1417. X# $Id: status.t,v 3.0 1993/11/29 13:50:06 ram Exp ram $
  1418. X#
  1419. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1420. X#  
  1421. X#  You may redistribute only under the terms of the Artistic License,
  1422. X#  as specified in the README file that comes with the distribution.
  1423. X#  You may reuse parts of this distribution only within the terms of
  1424. X#  that same Artistic License; a copy of which may be found at the root
  1425. X#  of the source tree for mailagent 3.0.
  1426. X#
  1427. X# $Log: status.t,v $
  1428. X# Revision 3.0  1993/11/29  13:50:06  ram
  1429. X# Baseline for mailagent 3.0 netwide release.
  1430. X#
  1431. X
  1432. Xdo '../pl/filter.pl';
  1433. Xunlink 'never', 'always', 'always.2', 'always.3';
  1434. X
  1435. X&add_header('X-Tag: status');
  1436. X`$cmd`;
  1437. X$? == 0 || print "1\n";
  1438. X-f "$user" && print "2\n";        # Mail has been saved
  1439. X-f 'never' && print "3\n";        # Cannot match
  1440. X-f 'always' || print "4\n";
  1441. X-f 'always.2' || print "5\n";
  1442. X-f 'always.3' || print "6\n";
  1443. X
  1444. Xunlink 'never', 'always', 'always.2', 'always.3';
  1445. Xprint "0\n";
  1446. END_OF_FILE
  1447.   if test 969 -ne `wc -c <'agent/test/filter/status.t'`; then
  1448.     echo shar: \"'agent/test/filter/status.t'\" unpacked with wrong size!
  1449.   fi
  1450.   # end of 'agent/test/filter/status.t'
  1451. fi
  1452. if test -f 'agent/test/option/c.t' -a "${1}" != "-c" ; then 
  1453.   echo shar: Will not clobber existing file \"'agent/test/option/c.t'\"
  1454. else
  1455.   echo shar: Extracting \"'agent/test/option/c.t'\" \(1019 characters\)
  1456.   sed "s/^X//" >'agent/test/option/c.t' <<'END_OF_FILE'
  1457. X# -c : specify alternate configuration file
  1458. X
  1459. X# $Id: c.t,v 3.0 1993/11/29 13:50:13 ram Exp ram $
  1460. X#
  1461. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1462. X#  
  1463. X#  You may redistribute only under the terms of the Artistic License,
  1464. X#  as specified in the README file that comes with the distribution.
  1465. X#  You may reuse parts of this distribution only within the terms of
  1466. X#  that same Artistic License; a copy of which may be found at the root
  1467. X#  of the source tree for mailagent 3.0.
  1468. X#
  1469. X# $Log: c.t,v $
  1470. X# Revision 3.0  1993/11/29  13:50:13  ram
  1471. X# Baseline for mailagent 3.0 netwide release.
  1472. X#
  1473. X
  1474. Xdo '../pl/init.pl';
  1475. X$output = `cat ../mail | $mailagent -c foo 2>&1`;
  1476. X$? != 0 || print "1\n";        # Cannot open config file
  1477. X$* = 1;
  1478. X$output =~ /^\*\*.*not processed/ || print "2\n";
  1479. Xchdir '../out';
  1480. X$user = $ENV{'USER'};
  1481. Xunlink "$user";
  1482. X`cp .mailagent alternate`;
  1483. X$output = `$mailagent -c alternate /dev/null 2>/dev/null`;
  1484. X$? == 0 || print "3\n";
  1485. X$output eq '' || print "4\n";
  1486. X-s "$user" || print "5\n";
  1487. Xunlink "$user", 'alternate';
  1488. Xprint "0\n";
  1489. END_OF_FILE
  1490.   if test 1019 -ne `wc -c <'agent/test/option/c.t'`; then
  1491.     echo shar: \"'agent/test/option/c.t'\" unpacked with wrong size!
  1492.   fi
  1493.   # end of 'agent/test/option/c.t'
  1494. fi
  1495. if test -f 'agent/test/option/i.t' -a "${1}" != "-c" ; then 
  1496.   echo shar: Will not clobber existing file \"'agent/test/option/i.t'\"
  1497. else
  1498.   echo shar: Extracting \"'agent/test/option/i.t'\" \(948 characters\)
  1499.   sed "s/^X//" >'agent/test/option/i.t' <<'END_OF_FILE'
  1500. X# -i: interactive usage -- print log messages on stderr
  1501. X
  1502. X# $Id: i.t,v 3.0 1993/11/29 13:50:17 ram Exp ram $
  1503. X#
  1504. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1505. X#  
  1506. X#  You may redistribute only under the terms of the Artistic License,
  1507. X#  as specified in the README file that comes with the distribution.
  1508. X#  You may reuse parts of this distribution only within the terms of
  1509. X#  that same Artistic License; a copy of which may be found at the root
  1510. X#  of the source tree for mailagent 3.0.
  1511. X#
  1512. X# $Log: i.t,v $
  1513. X# Revision 3.0  1993/11/29  13:50:17  ram
  1514. X# Baseline for mailagent 3.0 netwide release.
  1515. X#
  1516. X
  1517. Xdo '../pl/init.pl';
  1518. Xchdir '../out';
  1519. Xunlink 'agentlog';
  1520. X$output = `$mailagent -d -i 2>&1 >/dev/null`;
  1521. X$? == 0 || print "1\n";
  1522. X$* = 1;
  1523. Xopen(LOG, 'agentlog') || print "2\n";
  1524. Xundef $/;
  1525. X$log = <LOG>;
  1526. Xclose LOG;
  1527. X$output =~ s/^$mailagent_prog://g;
  1528. X$log =~ s/^.*$mailagent_prog\[.*\]\s*://g;
  1529. X$output eq $log || print "3\n";
  1530. X$output ne '' || print "4\n";
  1531. Xprint "0\n";
  1532. END_OF_FILE
  1533.   if test 948 -ne `wc -c <'agent/test/option/i.t'`; then
  1534.     echo shar: \"'agent/test/option/i.t'\" unpacked with wrong size!
  1535.   fi
  1536.   # end of 'agent/test/option/i.t'
  1537. fi
  1538. if test -f 'agent/test/pl/cmd.pl' -a "${1}" != "-c" ; then 
  1539.   echo shar: Will not clobber existing file \"'agent/test/pl/cmd.pl'\"
  1540. else
  1541.   echo shar: Extracting \"'agent/test/pl/cmd.pl'\" \(976 characters\)
  1542.   sed "s/^X//" >'agent/test/pl/cmd.pl' <<'END_OF_FILE'
  1543. X# Common actions at the top of each command test
  1544. X
  1545. X# $Id: cmd.pl,v 3.0 1993/11/29 13:50:22 ram Exp ram $
  1546. X#
  1547. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1548. X#  
  1549. X#  You may redistribute only under the terms of the Artistic License,
  1550. X#  as specified in the README file that comes with the distribution.
  1551. X#  You may reuse parts of this distribution only within the terms of
  1552. X#  that same Artistic License; a copy of which may be found at the root
  1553. X#  of the source tree for mailagent 3.0.
  1554. X#
  1555. X# $Log: cmd.pl,v $
  1556. X;# Revision 3.0  1993/11/29  13:50:22  ram
  1557. X;# Baseline for mailagent 3.0 netwide release.
  1558. X;#
  1559. X
  1560. Xdo '../pl//init.pl';
  1561. Xchdir '../out';
  1562. Xdo '../pl/mail.pl';
  1563. X&cp_mail;
  1564. X$user = $ENV{'USER'};
  1565. Xunlink "$user", 'agentlog', 'send.mail', 'send.news';
  1566. X$cmd = "$mailagent -L $ENV{'LEVEL'} -r ../actions mail 2>/dev/null";
  1567. X
  1568. X# We might need this
  1569. Xdo '../pl/logfile.pl';
  1570. X
  1571. Xsub cp_mail {
  1572. X    local($_);
  1573. X    open(MAIL, '../mail');
  1574. X    open(HERE, '>mail');
  1575. X    print HERE while <MAIL>;
  1576. X    close MAIL;
  1577. X    close HERE;
  1578. X}
  1579. X
  1580. END_OF_FILE
  1581.   if test 976 -ne `wc -c <'agent/test/pl/cmd.pl'`; then
  1582.     echo shar: \"'agent/test/pl/cmd.pl'\" unpacked with wrong size!
  1583.   fi
  1584.   # end of 'agent/test/pl/cmd.pl'
  1585. fi
  1586. if test -f 'agent/test/pl/filter.pl' -a "${1}" != "-c" ; then 
  1587.   echo shar: Will not clobber existing file \"'agent/test/pl/filter.pl'\"
  1588. else
  1589.   echo shar: Extracting \"'agent/test/pl/filter.pl'\" \(957 characters\)
  1590.   sed "s/^X//" >'agent/test/pl/filter.pl' <<'END_OF_FILE'
  1591. X# Common actions at the top of each filtering test
  1592. X
  1593. X# $Id: filter.pl,v 3.0 1993/11/29 13:50:23 ram Exp ram $
  1594. X#
  1595. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1596. X#  
  1597. X#  You may redistribute only under the terms of the Artistic License,
  1598. X#  as specified in the README file that comes with the distribution.
  1599. X#  You may reuse parts of this distribution only within the terms of
  1600. X#  that same Artistic License; a copy of which may be found at the root
  1601. X#  of the source tree for mailagent 3.0.
  1602. X#
  1603. X# $Log: filter.pl,v $
  1604. X;# Revision 3.0  1993/11/29  13:50:23  ram
  1605. X;# Baseline for mailagent 3.0 netwide release.
  1606. X;#
  1607. X
  1608. Xdo '../pl/init.pl';
  1609. Xchdir '../out';
  1610. Xdo '../pl/mail.pl';
  1611. X`cp ../mail .`;
  1612. X$user = $ENV{'USER'};
  1613. Xunlink "$user", 'agentlog';
  1614. X$cmd = "$mailagent -L $ENV{'LEVEL'} -r ../rules mail 2>/dev/null";
  1615. X
  1616. X# Re-create pattern list
  1617. Xopen(PATTERN, ">pattern-list");
  1618. Xprint PATTERN <<'EOP';
  1619. Xno-match-possible
  1620. Xanother-impossible-match
  1621. X# This will match
  1622. Xpattern
  1623. XEOP
  1624. Xclose PATTERN;
  1625. END_OF_FILE
  1626.   if test 957 -ne `wc -c <'agent/test/pl/filter.pl'`; then
  1627.     echo shar: \"'agent/test/pl/filter.pl'\" unpacked with wrong size!
  1628.   fi
  1629.   # end of 'agent/test/pl/filter.pl'
  1630. fi
  1631. echo shar: End of archive 24 \(of 26\).
  1632. cp /dev/null ark24isdone
  1633. MISSING=""
  1634. 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
  1635.     if test ! -f ark${I}isdone ; then
  1636.     MISSING="${MISSING} ${I}"
  1637.     fi
  1638. done
  1639. if test "${MISSING}" = "" ; then
  1640.     echo You have unpacked all 26 archives.
  1641.     echo "Now run 'sh PACKNOTES', then read README and type Configure.'"
  1642.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1643. else
  1644.     echo You still must unpack the following archives:
  1645.     echo "        " ${MISSING}
  1646. fi
  1647. exit 0
  1648.  
  1649. exit 0 # Just in case...
  1650.