home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume33 / mailagnt / part17 < prev    next >
Encoding:
Text File  |  1992-11-20  |  47.9 KB  |  1,504 lines

  1. Newsgroups: comp.sources.misc
  2. From: ram@eiffel.com (Raphael Manfredi)
  3. Subject:  v33i109:  mailagent - Rule Based Mail Filtering, Part17/17
  4. Message-ID: <1992Nov20.231347.28324@sparky.imd.sterling.com>
  5. X-Md4-Signature: 8e0f0c54a3fbe14c414ff285085d298f
  6. Date: Fri, 20 Nov 1992 23:13:47 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: ram@eiffel.com (Raphael Manfredi)
  10. Posting-number: Volume 33, Issue 109
  11. Archive-name: mailagent/part17
  12. Environment: Perl, Sendmail, UNIX
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then feed it
  16. # into a shell via "sh file" or similar.  To overwrite existing files,
  17. # type "sh file -c".
  18. # Contents:  Jmakefile agent/examples/daemon agent/examples/mailfolders
  19. #   agent/examples/mhinc agent/examples/profile
  20. #   agent/examples/vacation agent/files/Jmakefile agent/files/commands
  21. #   agent/filter/msg.h agent/man/Jmakefile agent/man/maildist.SH
  22. #   agent/man/maillist.SH agent/man/mailpatch.SH
  23. #   agent/test/cmd/abort.t agent/test/cmd/annotate.t
  24. #   agent/test/cmd/begin.t agent/test/cmd/bounce.t
  25. #   agent/test/cmd/delete.t agent/test/cmd/feed.t
  26. #   agent/test/cmd/forward.t agent/test/cmd/message.t
  27. #   agent/test/cmd/nop.t agent/test/cmd/notify.t agent/test/cmd/pass.t
  28. #   agent/test/cmd/pipe.t agent/test/cmd/post.t
  29. #   agent/test/cmd/process.t agent/test/cmd/purify.t
  30. #   agent/test/cmd/queue.t agent/test/cmd/reject.t
  31. #   agent/test/cmd/restart.t agent/test/cmd/resync.t
  32. #   agent/test/cmd/select.t agent/test/cmd/subst.t agent/test/cmd/tr.t
  33. #   agent/test/cmd/unknown.t agent/test/cmd/vacation.t
  34. #   agent/test/filter/case.t agent/test/filter/escape.t
  35. #   agent/test/filter/group.t agent/test/filter/loop.t
  36. #   agent/test/filter/pattern.t agent/test/filter/status.t
  37. #   agent/test/level agent/test/option/L.t agent/test/option/V.t
  38. #   agent/test/option/h.t agent/test/option/i.t agent/test/option/o.t
  39. #   agent/test/option/r.t agent/test/option/t.t
  40. #   agent/test/option/what.t agent/test/pl/cmd.pl
  41. #   agent/test/pl/filter.pl agent/test/pl/init.pl
  42. #   agent/test/pl/logfile.pl patchlevel.h
  43. # Wrapped by kent@sparky on Wed Nov 18 22:42:35 1992
  44. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  45. echo If this archive is complete, you will see the following message:
  46. echo '          "shar: End of archive 17 (of 17)."'
  47. if test -f 'Jmakefile' -a "${1}" != "-c" ; then 
  48.   echo shar: Will not clobber existing file \"'Jmakefile'\"
  49. else
  50.   echo shar: Extracting \"'Jmakefile'\" \(470 characters\)
  51.   sed "s/^X//" >'Jmakefile' <<'END_OF_FILE'
  52. X/*
  53. X * Main Jmakefile for mailagent 2.9
  54. X */
  55. X
  56. X;# $Id: Jmakefile,v 2.9 92/07/14 16:46:57 ram Exp $
  57. X;#
  58. X;#  Copyright (c) 1991, Raphael Manfredi
  59. X;#
  60. X;#  You may redistribute only under the terms of the GNU General Public
  61. X;#  Licence as specified in the README file that comes with dist.
  62. X;#
  63. X;# $Log:    Jmakefile,v $
  64. X;# Revision 2.9  92/07/14  16:46:57  ram
  65. X;# 3.0 beta baseline.
  66. X;# 
  67. X
  68. Xall::
  69. X
  70. XNoManPages()
  71. XSetSubdirs(agent)
  72. XAddedByConfigure(install mkdep cppstdin)
  73. XDependSubdirs()
  74. END_OF_FILE
  75.   if test 470 -ne `wc -c <'Jmakefile'`; then
  76.     echo shar: \"'Jmakefile'\" unpacked with wrong size!
  77.   fi
  78.   # end of 'Jmakefile'
  79. fi
  80. if test -f 'agent/examples/daemon' -a "${1}" != "-c" ; then 
  81.   echo shar: Will not clobber existing file \"'agent/examples/daemon'\"
  82. else
  83.   echo shar: Extracting \"'agent/examples/daemon'\" \(298 characters\)
  84.   sed "s/^X//" >'agent/examples/daemon' <<'END_OF_FILE'
  85. X#
  86. X# Rule file for mailagent
  87. X#
  88. X
  89. Xmaildir = ~/mail;
  90. X
  91. XTo Cc: ram        { BEGIN RAM; REJECT };
  92. X
  93. X<RAM> From: root, mailer-daemon, uucp    { BEGIN INITIAL; REJECT };
  94. X<RAM> { ONCE (%r,vacation,1d) MESSAGE ~/.vacation; REJECT };
  95. X
  96. X{ LEAVE; BOUNCE ram@eiffel.fr };
  97. X
  98. X<_SEEN_>    { DELETE };
  99. X
  100. X#
  101. X# End of mailagent rules
  102. X#
  103. END_OF_FILE
  104.   if test 298 -ne `wc -c <'agent/examples/daemon'`; then
  105.     echo shar: \"'agent/examples/daemon'\" unpacked with wrong size!
  106.   fi
  107.   # end of 'agent/examples/daemon'
  108. fi
  109. if test -f 'agent/examples/mailfolders' -a "${1}" != "-c" ; then 
  110.   echo shar: Will not clobber existing file \"'agent/examples/mailfolders'\"
  111. else
  112.   echo shar: Extracting \"'agent/examples/mailfolders'\" \(249 characters\)
  113.   sed "s/^X//" >'agent/examples/mailfolders' <<'END_OF_FILE'
  114. X#
  115. X# Folders which should be scanned by ksh for new mail
  116. X#
  117. X~/mail/ftp.mail
  118. X~/mail/cmds
  119. X~/mbox.filter
  120. X~/mbox.urgent
  121. X~/mail/gue
  122. X~/mail/comp.mail.mh
  123. X~/mail/unix-src
  124. X~/mail/unix-wiz
  125. X~/mail/admin
  126. X~/mail/ise
  127. X~/mail/rdb
  128. X~/mail/dist
  129. X~/mail/frog
  130. X~/mail/magic
  131. END_OF_FILE
  132.   if test 249 -ne `wc -c <'agent/examples/mailfolders'`; then
  133.     echo shar: \"'agent/examples/mailfolders'\" unpacked with wrong size!
  134.   fi
  135.   # end of 'agent/examples/mailfolders'
  136. fi
  137. if test -f 'agent/examples/mhinc' -a "${1}" != "-c" ; then 
  138.   echo shar: Will not clobber existing file \"'agent/examples/mhinc'\"
  139. else
  140.   echo shar: Extracting \"'agent/examples/mhinc'\" \(676 characters\)
  141.   sed "s/^X//" >'agent/examples/mhinc' <<'END_OF_FILE'
  142. X#! /bin/sh
  143. X# @(#) incorporates mail in an mh folder from a mail/news folder
  144. X
  145. Xif test $# -eq 0; then
  146. X    exec inc
  147. Xfi
  148. X
  149. Xif folder="$HOME/mail/$1" && test -s $folder; then
  150. X    :
  151. Xelif folder="$HOME/news/$1" && test -s $folder; then
  152. X    :
  153. Xelse
  154. X    echo "mhinc: no mail to incorporate"
  155. X    exit 0
  156. Xfi
  157. X
  158. Xif test -d $folder; then
  159. X    echo "mhinc: $folder is a directory!"
  160. X    exit 0
  161. Xfi
  162. X
  163. Xecho "mhinc: using $folder"
  164. Xinc +$1 -file $folder -truncate
  165. X
  166. X# Do not leave zero-length files. This may lead to some trouble when
  167. X# saving news articles in them (trn will not recognize the "mailbox"
  168. X# format, which is required by inc).
  169. X
  170. Xif test -s $folder; then
  171. X    echo "mhinc: folder was not emptied"
  172. Xelse
  173. X    rm $folder
  174. Xfi
  175. X
  176. END_OF_FILE
  177.   if test 676 -ne `wc -c <'agent/examples/mhinc'`; then
  178.     echo shar: \"'agent/examples/mhinc'\" unpacked with wrong size!
  179.   fi
  180.   chmod +x 'agent/examples/mhinc'
  181.   # end of 'agent/examples/mhinc'
  182. fi
  183. if test -f 'agent/examples/profile' -a "${1}" != "-c" ; then 
  184.   echo shar: Will not clobber existing file \"'agent/examples/profile'\"
  185. else
  186.   echo shar: Extracting \"'agent/examples/profile'\" \(497 characters\)
  187.   sed "s/^X//" >'agent/examples/profile' <<'END_OF_FILE'
  188. X# Check for mail every minute
  189. XMAILCHECK=60
  190. Xexport MAILCHECK
  191. X
  192. X# Where is the system mailbox ?
  193. Xif test "$MAIL"; then
  194. X    mailbox=$MAIL
  195. Xelif test -d /usr/mail; then
  196. X    mailbox=/usr/mail/ram
  197. Xelse
  198. X    mailbox=/usr/spool/mail/ram
  199. Xfi
  200. X
  201. X# List of folders to look at for new mail
  202. XMAILPATH=$mailbox
  203. X
  204. X# List all the folders to be scanned for, one per line
  205. Xif test -f $HOME/.mailfolders; then
  206. X    MAILPATH=`sed \
  207. X        -e '/^[     ]*#/d' \
  208. X        -e "s|~|$HOME|g" <$HOME/.mailfolders \
  209. X        | tr '\012' ':'`$mailbox
  210. Xfi
  211. X
  212. Xexport MAILPATH
  213. END_OF_FILE
  214.   if test 497 -ne `wc -c <'agent/examples/profile'`; then
  215.     echo shar: \"'agent/examples/profile'\" unpacked with wrong size!
  216.   fi
  217.   # end of 'agent/examples/profile'
  218. fi
  219. if test -f 'agent/examples/vacation' -a "${1}" != "-c" ; then 
  220.   echo shar: Will not clobber existing file \"'agent/examples/vacation'\"
  221. else
  222.   echo shar: Extracting \"'agent/examples/vacation'\" \(532 characters\)
  223.   sed "s/^X//" >'agent/examples/vacation' <<'END_OF_FILE'
  224. XSubject: This is a recording... [Re: %R]
  225. XOrganization: %o
  226. X
  227. X[This is a recording -- Last revision was made on %T]
  228. X
  229. XHello %N:
  230. X
  231. XI have received your message of %[Date], whose subject
  232. Xwas "%s" and dropped it into %u's mailbox.
  233. XI'll send you such an acknowledgment only once a day, unless your message is
  234. Xfiltered into one of %u's mail folders, whose reading is delayed anyway.
  235. X(Your mail was received by a program, not by a person, in case you wonder.)
  236. X
  237. X%U told me:
  238. X
  239. XSuitable vacation message goes here...
  240. X
  241. X-- mailagent speaking for %u
  242. END_OF_FILE
  243.   if test 532 -ne `wc -c <'agent/examples/vacation'`; then
  244.     echo shar: \"'agent/examples/vacation'\" unpacked with wrong size!
  245.   fi
  246.   # end of 'agent/examples/vacation'
  247. fi
  248. if test -f 'agent/files/Jmakefile' -a "${1}" != "-c" ; then 
  249.   echo shar: Will not clobber existing file \"'agent/files/Jmakefile'\"
  250. else
  251.   echo shar: Extracting \"'agent/files/Jmakefile'\" \(653 characters\)
  252.   sed "s/^X//" >'agent/files/Jmakefile' <<'END_OF_FILE'
  253. X/*
  254. X * Jmakefile for mailagent's files
  255. X */
  256. X
  257. X;# $Id: Jmakefile,v 2.9 92/07/14 16:47:32 ram Exp $
  258. X;#
  259. X;#  Copyright (c) 1991, Raphael Manfredi
  260. X;#
  261. X;#  You may redistribute only under the terms of the GNU General Public
  262. X;#  Licence as specified in the README file that comes with dist.
  263. X;#
  264. X;# $Log:    Jmakefile,v $
  265. X;# Revision 2.9  92/07/14  16:47:32  ram
  266. X;# 3.0 beta baseline.
  267. X;# 
  268. X
  269. XFILES = agenthelp commands distribs filter.sh mailagent.cf proglist \
  270. X    chkagent.sh
  271. X
  272. X>PRIVLIB    /* Force metaconfig to ask for privlib location */
  273. X
  274. Xall::
  275. X
  276. XMakeInstallDirectories($(PRIVLIB) $(PRIVLIB)/mailagent)
  277. XInstallMultipleDestFlags(install,$(FILES),$(PRIVLIB)/mailagent,-m 444)
  278. END_OF_FILE
  279.   if test 653 -ne `wc -c <'agent/files/Jmakefile'`; then
  280.     echo shar: \"'agent/files/Jmakefile'\" unpacked with wrong size!
  281.   fi
  282.   # end of 'agent/files/Jmakefile'
  283. fi
  284. if test -f 'agent/files/commands' -a "${1}" != "-c" ; then 
  285.   echo shar: Will not clobber existing file \"'agent/files/commands'\"
  286. else
  287.   echo shar: Extracting \"'agent/files/commands'\" \(37 characters\)
  288.   sed "s/^X//" >'agent/files/commands' <<'END_OF_FILE'
  289. Xmailpatch
  290. Xmailhelp
  291. Xmaillist
  292. Xmaildist
  293. END_OF_FILE
  294.   if test 37 -ne `wc -c <'agent/files/commands'`; then
  295.     echo shar: \"'agent/files/commands'\" unpacked with wrong size!
  296.   fi
  297.   # end of 'agent/files/commands'
  298. fi
  299. if test -f 'agent/filter/msg.h' -a "${1}" != "-c" ; then 
  300.   echo shar: Will not clobber existing file \"'agent/filter/msg.h'\"
  301. else
  302.   echo shar: Extracting \"'agent/filter/msg.h'\" \(710 characters\)
  303.   sed "s/^X//" >'agent/filter/msg.h' <<'END_OF_FILE'
  304. X/*
  305. X
  306. X #    #   ####    ####           #    #
  307. X ##  ##  #       #    #          #    #
  308. X # ## #   ####   #               ######
  309. X #    #       #  #  ###   ###    #    #
  310. X #    #  #    #  #    #   ###    #    #
  311. X #    #   ####    ####    ###    #    #
  312. X
  313. X    Declaration of message related functions.
  314. X*/
  315. X
  316. X/*
  317. X * $Id: msg.h,v 2.9 92/07/14 16:48:34 ram Exp $
  318. X *
  319. X *  Copyright (c) 1992, Raphael Manfredi
  320. X *
  321. X *  You may redistribute only under the terms of the GNU General Public
  322. X *  Licence as specified in the README file that comes with dist.
  323. X *
  324. X * $Log:    msg.h,v $
  325. X * Revision 2.9  92/07/14  16:48:34  ram
  326. X * 3.0 beta baseline.
  327. X * 
  328. X */
  329. X
  330. X#ifndef _msg_h_
  331. X#define _msg_h_
  332. X
  333. Xextern void fatal();                /* For fatal errors */
  334. X
  335. X#endif
  336. END_OF_FILE
  337.   if test 710 -ne `wc -c <'agent/filter/msg.h'`; then
  338.     echo shar: \"'agent/filter/msg.h'\" unpacked with wrong size!
  339.   fi
  340.   # end of 'agent/filter/msg.h'
  341. fi
  342. if test -f 'agent/man/Jmakefile' -a "${1}" != "-c" ; then 
  343.   echo shar: Will not clobber existing file \"'agent/man/Jmakefile'\"
  344. else
  345.   echo shar: Extracting \"'agent/man/Jmakefile'\" \(555 characters\)
  346.   sed "s/^X//" >'agent/man/Jmakefile' <<'END_OF_FILE'
  347. X/*
  348. X * Jmakefile for mailagent's manual pages
  349. X */
  350. X
  351. X;# $Id: Jmakefile,v 2.9 92/07/14 16:49:04 ram Exp $
  352. X;#
  353. X;#  Copyright (c) 1991, Raphael Manfredi
  354. X;#
  355. X;#  You may redistribute only under the terms of the GNU General Public
  356. X;#  Licence as specified in the README file that comes with dist.
  357. X;#
  358. X;# $Log:    Jmakefile,v $
  359. X;# Revision 2.9  92/07/14  16:49:04  ram
  360. X;# 3.0 beta baseline.
  361. X;# 
  362. X
  363. X>L        /* I expect to fix this with an |append command */
  364. X
  365. XMPAGES = mailagent.$(L) maildist.$(L) maillist.$(L) mailhelp.$(L) mailpatch.$(L)
  366. X
  367. XComplexShellManualTarget($(MPAGES))
  368. END_OF_FILE
  369.   if test 555 -ne `wc -c <'agent/man/Jmakefile'`; then
  370.     echo shar: \"'agent/man/Jmakefile'\" unpacked with wrong size!
  371.   fi
  372.   # end of 'agent/man/Jmakefile'
  373. fi
  374. if test -f 'agent/man/maildist.SH' -a "${1}" != "-c" ; then 
  375.   echo shar: Will not clobber existing file \"'agent/man/maildist.SH'\"
  376. else
  377.   echo shar: Extracting \"'agent/man/maildist.SH'\" \(464 characters\)
  378.   sed "s/^X//" >'agent/man/maildist.SH' <<'END_OF_FILE'
  379. Xcase $CONFIG in
  380. X'')
  381. X    if test ! -f config.sh; then
  382. X        ln ../config.sh . || \
  383. X        ln ../../config.sh . || \
  384. X        ln ../../../config.sh . || \
  385. X        (echo "Can't find config.sh."; exit 1)
  386. X    fi
  387. X    . config.sh
  388. X    ;;
  389. Xesac
  390. Xcase "$0" in
  391. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  392. Xesac
  393. Xecho "Extracting agent/man/maildist.$manext (with variable substitutions)"
  394. X$rm -f maildist.$manext
  395. X$spitshell >maildist.$manext <<!GROK!THIS!
  396. X.so $mansrc/mailhelp.$manext
  397. X!GROK!THIS!
  398. Xchmod 444 maildist.$manext
  399. END_OF_FILE
  400.   if test 464 -ne `wc -c <'agent/man/maildist.SH'`; then
  401.     echo shar: \"'agent/man/maildist.SH'\" unpacked with wrong size!
  402.   fi
  403.   chmod +x 'agent/man/maildist.SH'
  404.   # end of 'agent/man/maildist.SH'
  405. fi
  406. if test -f 'agent/man/maillist.SH' -a "${1}" != "-c" ; then 
  407.   echo shar: Will not clobber existing file \"'agent/man/maillist.SH'\"
  408. else
  409.   echo shar: Extracting \"'agent/man/maillist.SH'\" \(464 characters\)
  410.   sed "s/^X//" >'agent/man/maillist.SH' <<'END_OF_FILE'
  411. Xcase $CONFIG in
  412. X'')
  413. X    if test ! -f config.sh; then
  414. X        ln ../config.sh . || \
  415. X        ln ../../config.sh . || \
  416. X        ln ../../../config.sh . || \
  417. X        (echo "Can't find config.sh."; exit 1)
  418. X    fi
  419. X    . config.sh
  420. X    ;;
  421. Xesac
  422. Xcase "$0" in
  423. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  424. Xesac
  425. Xecho "Extracting agent/man/maillist.$manext (with variable substitutions)"
  426. X$rm -f maillist.$manext
  427. X$spitshell >maillist.$manext <<!GROK!THIS!
  428. X.so $mansrc/mailhelp.$manext
  429. X!GROK!THIS!
  430. Xchmod 444 maillist.$manext
  431. END_OF_FILE
  432.   if test 464 -ne `wc -c <'agent/man/maillist.SH'`; then
  433.     echo shar: \"'agent/man/maillist.SH'\" unpacked with wrong size!
  434.   fi
  435.   chmod +x 'agent/man/maillist.SH'
  436.   # end of 'agent/man/maillist.SH'
  437. fi
  438. if test -f 'agent/man/mailpatch.SH' -a "${1}" != "-c" ; then 
  439.   echo shar: Will not clobber existing file \"'agent/man/mailpatch.SH'\"
  440. else
  441.   echo shar: Extracting \"'agent/man/mailpatch.SH'\" \(468 characters\)
  442.   sed "s/^X//" >'agent/man/mailpatch.SH' <<'END_OF_FILE'
  443. Xcase $CONFIG in
  444. X'')
  445. X    if test ! -f config.sh; then
  446. X        ln ../config.sh . || \
  447. X        ln ../../config.sh . || \
  448. X        ln ../../../config.sh . || \
  449. X        (echo "Can't find config.sh."; exit 1)
  450. X    fi
  451. X    . config.sh
  452. X    ;;
  453. Xesac
  454. Xcase "$0" in
  455. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  456. Xesac
  457. Xecho "Extracting agent/man/mailpatch.$manext (with variable substitutions)"
  458. X$rm -f mailpatch.$manext
  459. X$spitshell >mailpatch.$manext <<!GROK!THIS!
  460. X.so $mansrc/mailhelp.$manext
  461. X!GROK!THIS!
  462. Xchmod 444 mailpatch.$manext
  463. END_OF_FILE
  464.   if test 468 -ne `wc -c <'agent/man/mailpatch.SH'`; then
  465.     echo shar: \"'agent/man/mailpatch.SH'\" unpacked with wrong size!
  466.   fi
  467.   chmod +x 'agent/man/mailpatch.SH'
  468.   # end of 'agent/man/mailpatch.SH'
  469. fi
  470. if test -f 'agent/test/cmd/abort.t' -a "${1}" != "-c" ; then 
  471.   echo shar: Will not clobber existing file \"'agent/test/cmd/abort.t'\"
  472. else
  473.   echo shar: Extracting \"'agent/test/cmd/abort.t'\" \(309 characters\)
  474.   sed "s/^X//" >'agent/test/cmd/abort.t' <<'END_OF_FILE'
  475. X# Test ABORT command
  476. Xdo '../pl/cmd.pl';
  477. Xunlink "$user.1", 'always';
  478. X
  479. X&add_header('X-Tag: abort');
  480. X`$cmd`;
  481. X$? == 0 || print "1\n";
  482. X-f "$user.1" && print "2\n";    # Have aborted
  483. X-f "$user" && print "3\n";        # match -> no leave
  484. X-f 'always' || print "4\n";
  485. X
  486. Xunlink "$user", "$user.1", 'always', 'mail';
  487. Xprint "0\n";
  488. END_OF_FILE
  489.   if test 309 -ne `wc -c <'agent/test/cmd/abort.t'`; then
  490.     echo shar: \"'agent/test/cmd/abort.t'\" unpacked with wrong size!
  491.   fi
  492.   # end of 'agent/test/cmd/abort.t'
  493. fi
  494. if test -f 'agent/test/cmd/annotate.t' -a "${1}" != "-c" ; then 
  495.   echo shar: Will not clobber existing file \"'agent/test/cmd/annotate.t'\"
  496. else
  497.   echo shar: Extracting \"'agent/test/cmd/annotate.t'\" \(444 characters\)
  498.   sed "s/^X//" >'agent/test/cmd/annotate.t' <<'END_OF_FILE'
  499. X# Test ANNOTATE command
  500. Xdo '../pl/cmd.pl';
  501. X
  502. X&add_header('X-Tag: annotate');
  503. X`$cmd`;
  504. X$? == 0 || print "1\n";
  505. X-f "$user" || print "2\n";        # No match -> leave
  506. X&get_log(3, $user);
  507. X&check_log('^X-Anno-1:', 4) == 2 || print "5\n";
  508. X&check_log('^X-Anno-2:', 6) == 2 || print "7\n";
  509. X&check_log('^X-Anno-3:', 8) == 1 || print "9\n";
  510. X&check_log('^X-Anno-4:', 10) == 1 || print "11\n";
  511. X¬_log('^X-Anno-Error:', 12);
  512. X
  513. Xunlink "$user", 'mail';
  514. Xprint "0\n";
  515. END_OF_FILE
  516.   if test 444 -ne `wc -c <'agent/test/cmd/annotate.t'`; then
  517.     echo shar: \"'agent/test/cmd/annotate.t'\" unpacked with wrong size!
  518.   fi
  519.   # end of 'agent/test/cmd/annotate.t'
  520. fi
  521. if test -f 'agent/test/cmd/begin.t' -a "${1}" != "-c" ; then 
  522.   echo shar: Will not clobber existing file \"'agent/test/cmd/begin.t'\"
  523. else
  524.   echo shar: Extracting \"'agent/test/cmd/begin.t'\" \(405 characters\)
  525.   sed "s/^X//" >'agent/test/cmd/begin.t' <<'END_OF_FILE'
  526. X# Test BEGIN command
  527. Xdo '../pl/cmd.pl';
  528. Xunlink 'one', 'two', 'three';
  529. X
  530. X&add_header('X-Tag: begin');
  531. X`$cmd`;
  532. X$? == 0 || print "1\n";
  533. X-f 'one' && print "2\n";        # Cannot happen in TWO mode
  534. X-f 'two' || print "3\n";        # Must be saved here
  535. X-f 'three' || print "4\n";        # And also here by THREE mode
  536. X-f "$user" && print "5\n";        # So default action did not apply
  537. X
  538. Xunlink 'one', 'two', 'three', 'mail';
  539. Xprint "0\n";
  540. END_OF_FILE
  541.   if test 405 -ne `wc -c <'agent/test/cmd/begin.t'`; then
  542.     echo shar: \"'agent/test/cmd/begin.t'\" unpacked with wrong size!
  543.   fi
  544.   # end of 'agent/test/cmd/begin.t'
  545. fi
  546. if test -f 'agent/test/cmd/bounce.t' -a "${1}" != "-c" ; then 
  547.   echo shar: Will not clobber existing file \"'agent/test/cmd/bounce.t'\"
  548. else
  549.   echo shar: Extracting \"'agent/test/cmd/bounce.t'\" \(66 characters\)
  550.   sed "s/^X//" >'agent/test/cmd/bounce.t' <<'END_OF_FILE'
  551. X# Test BOUNCE command
  552. Xprint "-1\n";    # Automatic testing difficult
  553. END_OF_FILE
  554.   if test 66 -ne `wc -c <'agent/test/cmd/bounce.t'`; then
  555.     echo shar: \"'agent/test/cmd/bounce.t'\" unpacked with wrong size!
  556.   fi
  557.   # end of 'agent/test/cmd/bounce.t'
  558. fi
  559. if test -f 'agent/test/cmd/delete.t' -a "${1}" != "-c" ; then 
  560.   echo shar: Will not clobber existing file \"'agent/test/cmd/delete.t'\"
  561. else
  562.   echo shar: Extracting \"'agent/test/cmd/delete.t'\" \(176 characters\)
  563.   sed "s/^X//" >'agent/test/cmd/delete.t' <<'END_OF_FILE'
  564. X# Test DELETE command
  565. Xdo '../pl/cmd.pl';
  566. X
  567. X&add_header('X-Tag: delete');
  568. X`$cmd`;
  569. X$? == 0 || print "1\n";
  570. X-f "$user" && print "2\n";        # Mail deleted
  571. X
  572. Xunlink 'mail';
  573. Xprint "0\n";
  574. END_OF_FILE
  575.   if test 176 -ne `wc -c <'agent/test/cmd/delete.t'`; then
  576.     echo shar: \"'agent/test/cmd/delete.t'\" unpacked with wrong size!
  577.   fi
  578.   # end of 'agent/test/cmd/delete.t'
  579. fi
  580. if test -f 'agent/test/cmd/feed.t' -a "${1}" != "-c" ; then 
  581.   echo shar: Will not clobber existing file \"'agent/test/cmd/feed.t'\"
  582. else
  583.   echo shar: Extracting \"'agent/test/cmd/feed.t'\" \(385 characters\)
  584.   sed "s/^X//" >'agent/test/cmd/feed.t' <<'END_OF_FILE'
  585. X# Test FEED command
  586. Xdo '../pl/cmd.pl';
  587. Xunlink 'ok', 'no_resync';
  588. X
  589. X&add_header('X-Tag: feed');
  590. X`$cmd`;
  591. X$? == 0 || print "1\n";
  592. X-f "$user" && print "2\n";        # Mail saved...
  593. X-f 'ok' || print "3\n";            # ...here
  594. X&get_log(4, 'ok');
  595. X¬_log('^To:', 5);            # Make sure To: disappeared
  596. X-f 'no_resync' || print "6\n";    # Ensure header not disturbed
  597. X
  598. Xunlink 'ok', 'no_resync', 'mail';
  599. Xprint "0\n";
  600. END_OF_FILE
  601.   if test 385 -ne `wc -c <'agent/test/cmd/feed.t'`; then
  602.     echo shar: \"'agent/test/cmd/feed.t'\" unpacked with wrong size!
  603.   fi
  604.   # end of 'agent/test/cmd/feed.t'
  605. fi
  606. if test -f 'agent/test/cmd/forward.t' -a "${1}" != "-c" ; then 
  607.   echo shar: Will not clobber existing file \"'agent/test/cmd/forward.t'\"
  608. else
  609.   echo shar: Extracting \"'agent/test/cmd/forward.t'\" \(67 characters\)
  610.   sed "s/^X//" >'agent/test/cmd/forward.t' <<'END_OF_FILE'
  611. X# Test FORWARD command
  612. Xprint "-1\n";    # Automatic testing difficult
  613. END_OF_FILE
  614.   if test 67 -ne `wc -c <'agent/test/cmd/forward.t'`; then
  615.     echo shar: \"'agent/test/cmd/forward.t'\" unpacked with wrong size!
  616.   fi
  617.   # end of 'agent/test/cmd/forward.t'
  618. fi
  619. if test -f 'agent/test/cmd/message.t' -a "${1}" != "-c" ; then 
  620.   echo shar: Will not clobber existing file \"'agent/test/cmd/message.t'\"
  621. else
  622.   echo shar: Extracting \"'agent/test/cmd/message.t'\" \(67 characters\)
  623.   sed "s/^X//" >'agent/test/cmd/message.t' <<'END_OF_FILE'
  624. X# Test MESSAGE command
  625. Xprint "-1\n";    # Automatic testing difficult
  626. END_OF_FILE
  627.   if test 67 -ne `wc -c <'agent/test/cmd/message.t'`; then
  628.     echo shar: \"'agent/test/cmd/message.t'\" unpacked with wrong size!
  629.   fi
  630.   # end of 'agent/test/cmd/message.t'
  631. fi
  632. if test -f 'agent/test/cmd/nop.t' -a "${1}" != "-c" ; then 
  633.   echo shar: Will not clobber existing file \"'agent/test/cmd/nop.t'\"
  634. else
  635.   echo shar: Extracting \"'agent/test/cmd/nop.t'\" \(208 characters\)
  636.   sed "s/^X//" >'agent/test/cmd/nop.t' <<'END_OF_FILE'
  637. X# The NOP command
  638. Xdo '../pl/cmd.pl';
  639. X
  640. X# Make sure NOP is recognized (not defaulted to LEAVE)
  641. X&add_header('X-Tag: nop');
  642. X`$cmd`;
  643. X$? == 0 || print "1\n";
  644. X-f "$user" && print "2\n";
  645. X
  646. Xunlink 'mail';
  647. Xprint "0\n";
  648. END_OF_FILE
  649.   if test 208 -ne `wc -c <'agent/test/cmd/nop.t'`; then
  650.     echo shar: \"'agent/test/cmd/nop.t'\" unpacked with wrong size!
  651.   fi
  652.   # end of 'agent/test/cmd/nop.t'
  653. fi
  654. if test -f 'agent/test/cmd/notify.t' -a "${1}" != "-c" ; then 
  655.   echo shar: Will not clobber existing file \"'agent/test/cmd/notify.t'\"
  656. else
  657.   echo shar: Extracting \"'agent/test/cmd/notify.t'\" \(66 characters\)
  658.   sed "s/^X//" >'agent/test/cmd/notify.t' <<'END_OF_FILE'
  659. X# Test NOTIFY command
  660. Xprint "-1\n";    # Automatic testing difficult
  661. END_OF_FILE
  662.   if test 66 -ne `wc -c <'agent/test/cmd/notify.t'`; then
  663.     echo shar: \"'agent/test/cmd/notify.t'\" unpacked with wrong size!
  664.   fi
  665.   # end of 'agent/test/cmd/notify.t'
  666. fi
  667. if test -f 'agent/test/cmd/pass.t' -a "${1}" != "-c" ; then 
  668.   echo shar: Will not clobber existing file \"'agent/test/cmd/pass.t'\"
  669. else
  670.   echo shar: Extracting \"'agent/test/cmd/pass.t'\" \(459 characters\)
  671.   sed "s/^X//" >'agent/test/cmd/pass.t' <<'END_OF_FILE'
  672. X# The PASS command
  673. Xdo '../pl/cmd.pl';
  674. Xunlink 'output';
  675. X
  676. X&add_header('X-Tag: pass');
  677. X`$cmd`;
  678. X$? == 0 || print "1\n";
  679. X-f 'output' || print "2\n";        # Where mail is saved
  680. X`grep -v X-Filter: output > comp`;
  681. X$? == 0 || print "3\n";
  682. X`grep -v and mail > ok`;
  683. X((-s 'comp') - 1) == -s 'ok' || print "4\n";    # SAVE adds extra final new-line
  684. X-s 'comp' != -s 'output' || print "5\n";    # Casually check X-Filter was there
  685. X
  686. Xunlink 'output', 'mail', 'ok', 'comp';
  687. Xprint "0\n";
  688. END_OF_FILE
  689.   if test 459 -ne `wc -c <'agent/test/cmd/pass.t'`; then
  690.     echo shar: \"'agent/test/cmd/pass.t'\" unpacked with wrong size!
  691.   fi
  692.   # end of 'agent/test/cmd/pass.t'
  693. fi
  694. if test -f 'agent/test/cmd/pipe.t' -a "${1}" != "-c" ; then 
  695.   echo shar: Will not clobber existing file \"'agent/test/cmd/pipe.t'\"
  696. else
  697.   echo shar: Extracting \"'agent/test/cmd/pipe.t'\" \(517 characters\)
  698.   sed "s/^X//" >'agent/test/cmd/pipe.t' <<'END_OF_FILE'
  699. X# The PIPE command
  700. Xdo '../pl/cmd.pl';
  701. Xunlink 'output';
  702. X
  703. X&add_header('X-Tag: pipe');
  704. X`$cmd`;
  705. X$? == 0 || print "1\n";
  706. X-f 'output' || print "2\n";        # Where output is created
  707. Xchop($output = `cat output 2>/dev/null`);
  708. X@output = split(' ', $output);
  709. X@valid = (35, 229, 1632);        # Output of wc on whole mail with X-Tag field
  710. X$ok = 1;
  711. Xfor ($i = 0; $i < 3; $i++) {
  712. X    $ok = 0 if $valid[$i] != $output[$i];
  713. X}
  714. X$ok || print "3\n";
  715. X-f "$user" || print "4\n";        # Default action applies
  716. X
  717. Xunlink 'output', 'mail', "$user";
  718. Xprint "0\n";
  719. END_OF_FILE
  720.   if test 517 -ne `wc -c <'agent/test/cmd/pipe.t'`; then
  721.     echo shar: \"'agent/test/cmd/pipe.t'\" unpacked with wrong size!
  722.   fi
  723.   # end of 'agent/test/cmd/pipe.t'
  724. fi
  725. if test -f 'agent/test/cmd/post.t' -a "${1}" != "-c" ; then 
  726.   echo shar: Will not clobber existing file \"'agent/test/cmd/post.t'\"
  727. else
  728.   echo shar: Extracting \"'agent/test/cmd/post.t'\" \(64 characters\)
  729.   sed "s/^X//" >'agent/test/cmd/post.t' <<'END_OF_FILE'
  730. X# Test POST command
  731. Xprint "-1\n";    # Automatic testing difficult
  732. END_OF_FILE
  733.   if test 64 -ne `wc -c <'agent/test/cmd/post.t'`; then
  734.     echo shar: \"'agent/test/cmd/post.t'\" unpacked with wrong size!
  735.   fi
  736.   # end of 'agent/test/cmd/post.t'
  737. fi
  738. if test -f 'agent/test/cmd/process.t' -a "${1}" != "-c" ; then 
  739.   echo shar: Will not clobber existing file \"'agent/test/cmd/process.t'\"
  740. else
  741.   echo shar: Extracting \"'agent/test/cmd/process.t'\" \(66 characters\)
  742.   sed "s/^X//" >'agent/test/cmd/process.t' <<'END_OF_FILE'
  743. X# The PROCESS command
  744. Xprint "-1\n";    # Automatic testing difficult
  745. END_OF_FILE
  746.   if test 66 -ne `wc -c <'agent/test/cmd/process.t'`; then
  747.     echo shar: \"'agent/test/cmd/process.t'\" unpacked with wrong size!
  748.   fi
  749.   # end of 'agent/test/cmd/process.t'
  750. fi
  751. if test -f 'agent/test/cmd/purify.t' -a "${1}" != "-c" ; then 
  752.   echo shar: Will not clobber existing file \"'agent/test/cmd/purify.t'\"
  753. else
  754.   echo shar: Extracting \"'agent/test/cmd/purify.t'\" \(468 characters\)
  755.   sed "s/^X//" >'agent/test/cmd/purify.t' <<'END_OF_FILE'
  756. X# The PURIFY command
  757. Xdo '../pl/cmd.pl';
  758. Xunlink 'output';
  759. X
  760. X&add_header('X-Tag: purify');
  761. X`$cmd`;
  762. X$? == 0 || print "1\n";
  763. X-f 'output' || print "2\n";        # Where mail is saved
  764. X`grep -v X-Filter: output > comp`;
  765. X$? == 0 || print "3\n";
  766. X`grep -v Subject: mail > ok`;
  767. X((-s 'comp') - 1) == -s 'ok' || print "4\n";    # SAVE adds extra final new-line
  768. X-s 'comp' != -s 'output' || print "5\n";    # Casually check X-Filter was there
  769. X
  770. Xunlink 'output', 'mail', 'ok', 'comp';
  771. Xprint "0\n";
  772. END_OF_FILE
  773.   if test 468 -ne `wc -c <'agent/test/cmd/purify.t'`; then
  774.     echo shar: \"'agent/test/cmd/purify.t'\" unpacked with wrong size!
  775.   fi
  776.   # end of 'agent/test/cmd/purify.t'
  777. fi
  778. if test -f 'agent/test/cmd/queue.t' -a "${1}" != "-c" ; then 
  779.   echo shar: Will not clobber existing file \"'agent/test/cmd/queue.t'\"
  780. else
  781.   echo shar: Extracting \"'agent/test/cmd/queue.t'\" \(368 characters\)
  782.   sed "s/^X//" >'agent/test/cmd/queue.t' <<'END_OF_FILE'
  783. X# Test QUEUE command
  784. Xdo '../pl/cmd.pl';
  785. X
  786. Xunlink <queue/*>;
  787. X
  788. X&add_header('X-Tag: queue');
  789. X`$cmd`;
  790. X$? == 0 || print "1\n";
  791. X-f "$user" && print "2\n";        # Mail queued -> saved
  792. X
  793. X@queue = <queue/qm*>;
  794. X@queue == 4 || print "3\n";
  795. X$size = -s 'mail';
  796. X$ok = 1;
  797. Xforeach (@queue) {
  798. X    $ok == 0 if $size != -s $_;
  799. X}
  800. X$ok || print "4\n";
  801. X
  802. Xunlink <queue/*>;
  803. Xunlink 'mail';
  804. Xprint "0\n";
  805. END_OF_FILE
  806.   if test 368 -ne `wc -c <'agent/test/cmd/queue.t'`; then
  807.     echo shar: \"'agent/test/cmd/queue.t'\" unpacked with wrong size!
  808.   fi
  809.   # end of 'agent/test/cmd/queue.t'
  810. fi
  811. if test -f 'agent/test/cmd/reject.t' -a "${1}" != "-c" ; then 
  812.   echo shar: Will not clobber existing file \"'agent/test/cmd/reject.t'\"
  813. else
  814.   echo shar: Extracting \"'agent/test/cmd/reject.t'\" \(437 characters\)
  815.   sed "s/^X//" >'agent/test/cmd/reject.t' <<'END_OF_FILE'
  816. X# The REJECT command
  817. Xdo '../pl/cmd.pl';
  818. Xunlink "$user.1", 'always', 'never';
  819. X
  820. X# Make sure everything after a REJECT is not executed
  821. X&add_header('X-Tag: reject');
  822. X`$cmd`;
  823. X$? == 0 || print "1\n";
  824. X-f "$user" || print "2\n";        # REJECT -> no match -> leave
  825. X-f "$user.1" && print "3\n";    # This SAVE was after the REJECT
  826. X-f 'always' || print "4\n";
  827. X-f 'never' && print "5\n";
  828. X
  829. Xunlink "$user.1", "$user", 'always', 'never', 'mail';
  830. Xprint "0\n";
  831. END_OF_FILE
  832.   if test 437 -ne `wc -c <'agent/test/cmd/reject.t'`; then
  833.     echo shar: \"'agent/test/cmd/reject.t'\" unpacked with wrong size!
  834.   fi
  835.   # end of 'agent/test/cmd/reject.t'
  836. fi
  837. if test -f 'agent/test/cmd/restart.t' -a "${1}" != "-c" ; then 
  838.   echo shar: Will not clobber existing file \"'agent/test/cmd/restart.t'\"
  839. else
  840.   echo shar: Extracting \"'agent/test/cmd/restart.t'\" \(402 characters\)
  841.   sed "s/^X//" >'agent/test/cmd/restart.t' <<'END_OF_FILE'
  842. X# The RESTART command
  843. Xdo '../pl/cmd.pl';
  844. Xunlink "$user.1", 'never';
  845. X
  846. X# Make sure everything after a RESTART is not executed
  847. X&add_header('X-Tag: restart');
  848. X`$cmd`;
  849. X$? == 0 || print "1\n";
  850. X-f "$user" || print "2\n";        # RESTART -> no match -> leave
  851. X-f "$user.1" && print "3\n";    # This SAVE was after the RESTART
  852. X-f 'never' && print "4\n";        # Idem
  853. X
  854. Xunlink "$user.1", "$user", 'never', 'mail';
  855. Xprint "0\n";
  856. END_OF_FILE
  857.   if test 402 -ne `wc -c <'agent/test/cmd/restart.t'`; then
  858.     echo shar: \"'agent/test/cmd/restart.t'\" unpacked with wrong size!
  859.   fi
  860.   # end of 'agent/test/cmd/restart.t'
  861. fi
  862. if test -f 'agent/test/cmd/resync.t' -a "${1}" != "-c" ; then 
  863.   echo shar: Will not clobber existing file \"'agent/test/cmd/resync.t'\"
  864. else
  865.   echo shar: Extracting \"'agent/test/cmd/resync.t'\" \(370 characters\)
  866.   sed "s/^X//" >'agent/test/cmd/resync.t' <<'END_OF_FILE'
  867. X# The RESYNC command
  868. Xdo '../pl/cmd.pl';
  869. Xunlink 'output', "$user.1";
  870. X
  871. X&add_header('X-Tag: resync');
  872. X`$cmd`;
  873. X$? == 0 || print "1\n";
  874. X-f 'output' || print "2\n";        # Where mail is saved
  875. X-f "$user.1" && print "3\n";    # Cannot be there if RESYNC worked
  876. X-f "$user" && print "4\n";        # That would mean first match failed
  877. X
  878. Xunlink 'output', 'mail', "$user", "$user.1";
  879. Xprint "0\n";
  880. END_OF_FILE
  881.   if test 370 -ne `wc -c <'agent/test/cmd/resync.t'`; then
  882.     echo shar: \"'agent/test/cmd/resync.t'\" unpacked with wrong size!
  883.   fi
  884.   # end of 'agent/test/cmd/resync.t'
  885. fi
  886. if test -f 'agent/test/cmd/select.t' -a "${1}" != "-c" ; then 
  887.   echo shar: Will not clobber existing file \"'agent/test/cmd/select.t'\"
  888. else
  889.   echo shar: Extracting \"'agent/test/cmd/select.t'\" \(391 characters\)
  890.   sed "s/^X//" >'agent/test/cmd/select.t' <<'END_OF_FILE'
  891. X# The SELECT command
  892. Xdo '../pl/cmd.pl';
  893. Xunlink 'one', 'two', 'three', 'four', 'five', "$user";
  894. X
  895. X&add_header('X-Tag: select');
  896. X`$cmd`;
  897. X$? == 0 || print "1\n";
  898. X-f "$user" && print "2\n";
  899. X-f 'one' || print "3\n";
  900. X-f 'two' && print "4\n";
  901. X-f 'three' || print "5\n";
  902. X-f 'four' || print "6\n";
  903. X-f 'five' && print "7\n";
  904. X
  905. Xunlink 'one', 'two', 'three', 'four', 'five', "$user", 'mail';
  906. Xprint "0\n";
  907. END_OF_FILE
  908.   if test 391 -ne `wc -c <'agent/test/cmd/select.t'`; then
  909.     echo shar: \"'agent/test/cmd/select.t'\" unpacked with wrong size!
  910.   fi
  911.   # end of 'agent/test/cmd/select.t'
  912. fi
  913. if test -f 'agent/test/cmd/subst.t' -a "${1}" != "-c" ; then 
  914.   echo shar: Will not clobber existing file \"'agent/test/cmd/subst.t'\"
  915. else
  916.   echo shar: Extracting \"'agent/test/cmd/subst.t'\" \(348 characters\)
  917.   sed "s/^X//" >'agent/test/cmd/subst.t' <<'END_OF_FILE'
  918. X# The SUBST command
  919. Xdo '../pl/cmd.pl';
  920. Xunlink 'output';
  921. X
  922. X&add_header('X-Tag: subst');
  923. X`$cmd`;
  924. X$? == 0 || print "1\n";
  925. X-f "$user" && print "2\n";
  926. X-f 'output' || print "3\n";
  927. Xchop ($output = `cat output 2>/dev/null`);
  928. X$output eq 'ram@eiffel.fr,melting ice technology?,melting ice technology?'
  929. X    || print "4\n";
  930. X
  931. Xunlink 'mail', 'output';
  932. Xprint "0\n";
  933. X
  934. END_OF_FILE
  935.   if test 348 -ne `wc -c <'agent/test/cmd/subst.t'`; then
  936.     echo shar: \"'agent/test/cmd/subst.t'\" unpacked with wrong size!
  937.   fi
  938.   # end of 'agent/test/cmd/subst.t'
  939. fi
  940. if test -f 'agent/test/cmd/tr.t' -a "${1}" != "-c" ; then 
  941.   echo shar: Will not clobber existing file \"'agent/test/cmd/tr.t'\"
  942. else
  943.   echo shar: Extracting \"'agent/test/cmd/tr.t'\" \(361 characters\)
  944.   sed "s/^X//" >'agent/test/cmd/tr.t' <<'END_OF_FILE'
  945. X# The TR command
  946. Xdo '../pl/cmd.pl';
  947. Xunlink 'output';
  948. X
  949. X&add_header('X-Tag: tr');
  950. X`$cmd`;
  951. X$? == 0 || print "1\n";
  952. X-f "$user" && print "2\n";
  953. X-f 'output' || print "3\n";
  954. Xchop ($output = `cat output 2>/dev/null`);
  955. X$output eq 'RAM@EIFFEL.COM,' .
  956. X    'RE: mEltIng ICE tEChnology?,'.
  957. X    'RE: mEltIng ICE tEChnology?' || print "4\n";
  958. X
  959. Xunlink 'mail', 'output';
  960. Xprint "0\n";
  961. X
  962. END_OF_FILE
  963.   if test 361 -ne `wc -c <'agent/test/cmd/tr.t'`; then
  964.     echo shar: \"'agent/test/cmd/tr.t'\" unpacked with wrong size!
  965.   fi
  966.   # end of 'agent/test/cmd/tr.t'
  967. fi
  968. if test -f 'agent/test/cmd/unknown.t' -a "${1}" != "-c" ; then 
  969.   echo shar: Will not clobber existing file \"'agent/test/cmd/unknown.t'\"
  970. else
  971.   echo shar: Extracting \"'agent/test/cmd/unknown.t'\" \(411 characters\)
  972.   sed "s/^X//" >'agent/test/cmd/unknown.t' <<'END_OF_FILE'
  973. X# Ensure unknown command defaults to LEAVE only when no saving was done
  974. Xdo '../pl/cmd.pl';
  975. Xunlink "$user";
  976. X
  977. X&add_header('X-Tag: unknown #1');
  978. X`$cmd`;
  979. X$? == 0 || print "1\n";
  980. X-f "$user" || print "2\n";        # Unknown was first
  981. Xunlink "$user";
  982. X
  983. X&replace_header('X-Tag: unknown #2');
  984. X`$cmd`;
  985. X$? == 0 || print "3\n";
  986. X-f "$user" && print "4\n";        # Unknown after saving status known
  987. X
  988. Xunlink "$user", 'mail';
  989. Xprint "0\n";
  990. END_OF_FILE
  991.   if test 411 -ne `wc -c <'agent/test/cmd/unknown.t'`; then
  992.     echo shar: \"'agent/test/cmd/unknown.t'\" unpacked with wrong size!
  993.   fi
  994.   # end of 'agent/test/cmd/unknown.t'
  995. fi
  996. if test -f 'agent/test/cmd/vacation.t' -a "${1}" != "-c" ; then 
  997.   echo shar: Will not clobber existing file \"'agent/test/cmd/vacation.t'\"
  998. else
  999.   echo shar: Extracting \"'agent/test/cmd/vacation.t'\" \(67 characters\)
  1000.   sed "s/^X//" >'agent/test/cmd/vacation.t' <<'END_OF_FILE'
  1001. X# The VACATION command
  1002. Xprint "-1\n";    # Automatic testing difficult
  1003. END_OF_FILE
  1004.   if test 67 -ne `wc -c <'agent/test/cmd/vacation.t'`; then
  1005.     echo shar: \"'agent/test/cmd/vacation.t'\" unpacked with wrong size!
  1006.   fi
  1007.   # end of 'agent/test/cmd/vacation.t'
  1008. fi
  1009. if test -f 'agent/test/filter/case.t' -a "${1}" != "-c" ; then 
  1010.   echo shar: Will not clobber existing file \"'agent/test/filter/case.t'\"
  1011. else
  1012.   echo shar: Extracting \"'agent/test/filter/case.t'\" \(406 characters\)
  1013.   sed "s/^X//" >'agent/test/filter/case.t' <<'END_OF_FILE'
  1014. X# Check header field case insensitiveness
  1015. Xdo '../pl/filter.pl';
  1016. Xdo '../pl/logfile.pl';
  1017. Xunlink 'always';
  1018. X
  1019. X&add_header('x-tag: case');
  1020. X&add_header('CC: root');
  1021. X`$cmd`;
  1022. X$? == 0 || print "1\n";
  1023. X-f "$user" && print "2\n";        # No default action
  1024. X-f 'always' || print "3\n";        # Recognized both X-Tag and CC
  1025. X
  1026. X&get_log(4, 'always');
  1027. X¬_log('CC:', 5);                # CC was STRIPed out
  1028. X
  1029. Xunlink 'always', "$user";
  1030. Xprint "0\n";
  1031. END_OF_FILE
  1032.   if test 406 -ne `wc -c <'agent/test/filter/case.t'`; then
  1033.     echo shar: \"'agent/test/filter/case.t'\" unpacked with wrong size!
  1034.   fi
  1035.   # end of 'agent/test/filter/case.t'
  1036. fi
  1037. if test -f 'agent/test/filter/escape.t' -a "${1}" != "-c" ; then 
  1038.   echo shar: Will not clobber existing file \"'agent/test/filter/escape.t'\"
  1039. else
  1040.   echo shar: Extracting \"'agent/test/filter/escape.t'\" \(353 characters\)
  1041.   sed "s/^X//" >'agent/test/filter/escape.t' <<'END_OF_FILE'
  1042. X# Test escape sequences within rules
  1043. Xdo '../pl/filter.pl';
  1044. Xunlink 'output';
  1045. X
  1046. X&add_header('X-Tag: escape');
  1047. X`$cmd`;
  1048. X$? == 0 || print "1\n";
  1049. X-f "$user" && print "2\n";        # Must have been deleted
  1050. X-f 'output' || print "3\n";        # Created by RUN
  1051. Xchop($output = `cat output 2>/dev/null`);
  1052. X$output eq ';,\\;,\\,\\w' || print "4\n";
  1053. X
  1054. Xunlink 'output';
  1055. Xprint "0\n";
  1056. END_OF_FILE
  1057.   if test 353 -ne `wc -c <'agent/test/filter/escape.t'`; then
  1058.     echo shar: \"'agent/test/filter/escape.t'\" unpacked with wrong size!
  1059.   fi
  1060.   # end of 'agent/test/filter/escape.t'
  1061. fi
  1062. if test -f 'agent/test/filter/group.t' -a "${1}" != "-c" ; then 
  1063.   echo shar: Will not clobber existing file \"'agent/test/filter/group.t'\"
  1064. else
  1065.   echo shar: Extracting \"'agent/test/filter/group.t'\" \(480 characters\)
  1066.   sed "s/^X//" >'agent/test/filter/group.t' <<'END_OF_FILE'
  1067. X# Test grouping of selectors (mixing normal and inverted selections)
  1068. Xdo '../pl/filter.pl';
  1069. Xunlink 'never', 'always', 'always.2', 'always.3';
  1070. X
  1071. X&add_header('X-Tag: group');
  1072. X`$cmd`;
  1073. X$? == 0 || print "1\n";
  1074. X-f "$user" && print "2\n";        # Mail has been deleted
  1075. X-f 'never' && print "3\n";        # Cannot match
  1076. X-f 'always' || print "4\n";        # This one must have matched
  1077. X-f 'always.2' || print "5\n";
  1078. X-f 'always.3' || print "6\n";
  1079. X
  1080. Xunlink 'never', 'always', 'always.2', 'always.3';
  1081. Xprint "0\n";
  1082. END_OF_FILE
  1083.   if test 480 -ne `wc -c <'agent/test/filter/group.t'`; then
  1084.     echo shar: \"'agent/test/filter/group.t'\" unpacked with wrong size!
  1085.   fi
  1086.   # end of 'agent/test/filter/group.t'
  1087. fi
  1088. if test -f 'agent/test/filter/loop.t' -a "${1}" != "-c" ; then 
  1089.   echo shar: Will not clobber existing file \"'agent/test/filter/loop.t'\"
  1090. else
  1091.   echo shar: Extracting \"'agent/test/filter/loop.t'\" \(393 characters\)
  1092.   sed "s/^X//" >'agent/test/filter/loop.t' <<'END_OF_FILE'
  1093. X# Ensure loops are detected
  1094. Xdo '../pl/filter.pl';
  1095. X
  1096. X&add_header('X-Tag: loop #1');
  1097. X`$cmd`;
  1098. X$? == 0 || print "1\n";
  1099. X-f "$user" || print "2\n";        # Loop was detected (otherwise never ends)
  1100. X
  1101. X`mv $user mail 2>/dev/null`;
  1102. X&replace_header('X-Tag: loop #2');
  1103. X`$cmd`;
  1104. X$? == 0 || print "3\n";
  1105. X-f "$user" || print "4\n";        # Loop was detected (otherwise mail deleted)
  1106. X
  1107. Xunlink 'mail', "$user";
  1108. Xprint "0\n";
  1109. END_OF_FILE
  1110.   if test 393 -ne `wc -c <'agent/test/filter/loop.t'`; then
  1111.     echo shar: \"'agent/test/filter/loop.t'\" unpacked with wrong size!
  1112.   fi
  1113.   # end of 'agent/test/filter/loop.t'
  1114. fi
  1115. if test -f 'agent/test/filter/pattern.t' -a "${1}" != "-c" ; then 
  1116.   echo shar: Will not clobber existing file \"'agent/test/filter/pattern.t'\"
  1117. else
  1118.   echo shar: Extracting \"'agent/test/filter/pattern.t'\" \(405 characters\)
  1119.   sed "s/^X//" >'agent/test/filter/pattern.t' <<'END_OF_FILE'
  1120. X# Test selectors specified via a pattern
  1121. Xdo '../pl/filter.pl';
  1122. Xunlink 'macro';
  1123. X
  1124. X&add_header('X-Tag: pattern');
  1125. X&add_header('Replied: ram@eiffel.com');
  1126. X`$cmd`;
  1127. X$? == 0 || print "1\n";
  1128. X-f "$user" && print "2\n";        # Must have been deleted
  1129. X-f 'macro' || print "3\n";        # Created by RUN
  1130. Xchop($macro = `cat macro 2>/dev/null`);
  1131. X$macro eq 'Received,Replied;Subject;' || print "4\n";
  1132. X
  1133. Xunlink 'macro';
  1134. Xprint "0\n";
  1135. END_OF_FILE
  1136.   if test 405 -ne `wc -c <'agent/test/filter/pattern.t'`; then
  1137.     echo shar: \"'agent/test/filter/pattern.t'\" unpacked with wrong size!
  1138.   fi
  1139.   # end of 'agent/test/filter/pattern.t'
  1140. fi
  1141. if test -f 'agent/test/filter/status.t' -a "${1}" != "-c" ; then 
  1142.   echo shar: Will not clobber existing file \"'agent/test/filter/status.t'\"
  1143. else
  1144.   echo shar: Extracting \"'agent/test/filter/status.t'\" \(426 characters\)
  1145.   sed "s/^X//" >'agent/test/filter/status.t' <<'END_OF_FILE'
  1146. X# Make sure commands record their exit status
  1147. Xdo '../pl/filter.pl';
  1148. Xunlink 'never', 'always', 'always.2', 'always.3';
  1149. X
  1150. X&add_header('X-Tag: status');
  1151. X`$cmd`;
  1152. X$? == 0 || print "1\n";
  1153. X-f "$user" && print "2\n";        # Mail has been saved
  1154. X-f 'never' && print "3\n";        # Cannot match
  1155. X-f 'always' || print "4\n";
  1156. X-f 'always.2' || print "5\n";
  1157. X-f 'always.3' || print "6\n";
  1158. X
  1159. Xunlink 'never', 'always', 'always.2', 'always.3';
  1160. Xprint "0\n";
  1161. END_OF_FILE
  1162.   if test 426 -ne `wc -c <'agent/test/filter/status.t'`; then
  1163.     echo shar: \"'agent/test/filter/status.t'\" unpacked with wrong size!
  1164.   fi
  1165.   # end of 'agent/test/filter/status.t'
  1166. fi
  1167. if test -f 'agent/test/level' -a "${1}" != "-c" ; then 
  1168.   echo shar: Will not clobber existing file \"'agent/test/level'\"
  1169. else
  1170.   echo shar: Extracting \"'agent/test/level'\" \(2 characters\)
  1171.   sed "s/^X//" >'agent/test/level' <<'END_OF_FILE'
  1172. X0
  1173. END_OF_FILE
  1174.   if test 2 -ne `wc -c <'agent/test/level'`; then
  1175.     echo shar: \"'agent/test/level'\" unpacked with wrong size!
  1176.   fi
  1177.   # end of 'agent/test/level'
  1178. fi
  1179. if test -f 'agent/test/option/L.t' -a "${1}" != "-c" ; then 
  1180.   echo shar: Will not clobber existing file \"'agent/test/option/L.t'\"
  1181. else
  1182.   echo shar: Extracting \"'agent/test/option/L.t'\" \(182 characters\)
  1183.   sed "s/^X//" >'agent/test/option/L.t' <<'END_OF_FILE'
  1184. X# -L: force logging level
  1185. Xdo '../pl/init.pl';
  1186. Xchdir '../out';
  1187. Xunlink 'agentlog';
  1188. X`$mailagent -L 0 -d 2>/dev/null`;
  1189. X$? == 0 || print "1\n";
  1190. X-f 'agentlog' && print "2\n";
  1191. Xprint "0\n";
  1192. END_OF_FILE
  1193.   if test 182 -ne `wc -c <'agent/test/option/L.t'`; then
  1194.     echo shar: \"'agent/test/option/L.t'\" unpacked with wrong size!
  1195.   fi
  1196.   # end of 'agent/test/option/L.t'
  1197. fi
  1198. if test -f 'agent/test/option/V.t' -a "${1}" != "-c" ; then 
  1199.   echo shar: Will not clobber existing file \"'agent/test/option/V.t'\"
  1200. else
  1201.   echo shar: Extracting \"'agent/test/option/V.t'\" \(160 characters\)
  1202.   sed "s/^X//" >'agent/test/option/V.t' <<'END_OF_FILE'
  1203. X# -V: print version number and exits
  1204. Xdo '../pl/init.pl';
  1205. X$version = `$mailagent -V 2>&1`;
  1206. X$? == 0 || print "1\n";
  1207. X$version =~ /PL/ || print "2\n";
  1208. Xprint "0\n";
  1209. END_OF_FILE
  1210.   if test 160 -ne `wc -c <'agent/test/option/V.t'`; then
  1211.     echo shar: \"'agent/test/option/V.t'\" unpacked with wrong size!
  1212.   fi
  1213.   # end of 'agent/test/option/V.t'
  1214. fi
  1215. if test -f 'agent/test/option/h.t' -a "${1}" != "-c" ; then 
  1216.   echo shar: Will not clobber existing file \"'agent/test/option/h.t'\"
  1217. else
  1218.   echo shar: Extracting \"'agent/test/option/h.t'\" \(200 characters\)
  1219.   sed "s/^X//" >'agent/test/option/h.t' <<'END_OF_FILE'
  1220. X# -h: print this help message and exits
  1221. Xdo '../pl/init.pl';
  1222. X$output = `$mailagent -h 2>&1`;
  1223. X$? != 0 || print "1\n";        # -h -> exit status 1
  1224. X$* = 1;
  1225. X$output =~ /-h : print/ || print "2\n";
  1226. Xprint "0\n";
  1227. END_OF_FILE
  1228.   if test 200 -ne `wc -c <'agent/test/option/h.t'`; then
  1229.     echo shar: \"'agent/test/option/h.t'\" unpacked with wrong size!
  1230.   fi
  1231.   # end of 'agent/test/option/h.t'
  1232. fi
  1233. if test -f 'agent/test/option/i.t' -a "${1}" != "-c" ; then 
  1234.   echo shar: Will not clobber existing file \"'agent/test/option/i.t'\"
  1235. else
  1236.   echo shar: Extracting \"'agent/test/option/i.t'\" \(415 characters\)
  1237.   sed "s/^X//" >'agent/test/option/i.t' <<'END_OF_FILE'
  1238. X# -i: interactive usage -- print log messages on stderr
  1239. Xdo '../pl/init.pl';
  1240. Xchdir '../out';
  1241. Xunlink 'agentlog';
  1242. X$output = `$mailagent -d -i 2>&1 >/dev/null`;
  1243. X$? == 0 || print "1\n";
  1244. X$* = 1;
  1245. Xopen(LOG, 'agentlog') || print "2\n";
  1246. Xundef $/;
  1247. X$log = <LOG>;
  1248. Xclose LOG;
  1249. X$output =~ s/^$mailagent_prog://g;
  1250. X$log =~ s/^.*$mailagent_prog\[.*\]\s*://g;
  1251. X$output eq $log || print "3\n";
  1252. X$output ne '' || print "4\n";
  1253. Xprint "0\n";
  1254. END_OF_FILE
  1255.   if test 415 -ne `wc -c <'agent/test/option/i.t'`; then
  1256.     echo shar: \"'agent/test/option/i.t'\" unpacked with wrong size!
  1257.   fi
  1258.   # end of 'agent/test/option/i.t'
  1259. fi
  1260. if test -f 'agent/test/option/o.t' -a "${1}" != "-c" ; then 
  1261.   echo shar: Will not clobber existing file \"'agent/test/option/o.t'\"
  1262. else
  1263.   echo shar: Extracting \"'agent/test/option/o.t'\" \(230 characters\)
  1264.   sed "s/^X//" >'agent/test/option/o.t' <<'END_OF_FILE'
  1265. X# -o: overwrite config file with supplied definition
  1266. Xdo '../pl/init.pl';
  1267. Xchdir '../out';
  1268. Xunlink 'mylog';
  1269. X`$mailagent -d -o 'log: mylog' 2>/dev/null`;
  1270. X$? == 0 || print "1\n";
  1271. X-s 'mylog' || print "2\n";
  1272. Xunlink 'mylog';
  1273. Xprint "0\n";
  1274. END_OF_FILE
  1275.   if test 230 -ne `wc -c <'agent/test/option/o.t'`; then
  1276.     echo shar: \"'agent/test/option/o.t'\" unpacked with wrong size!
  1277.   fi
  1278.   # end of 'agent/test/option/o.t'
  1279. fi
  1280. if test -f 'agent/test/option/r.t' -a "${1}" != "-c" ; then 
  1281.   echo shar: Will not clobber existing file \"'agent/test/option/r.t'\"
  1282. else
  1283.   echo shar: Extracting \"'agent/test/option/r.t'\" \(324 characters\)
  1284.   sed "s/^X//" >'agent/test/option/r.t' <<'END_OF_FILE'
  1285. X# -r: sepcify alternate rule file
  1286. Xdo '../pl/init.pl';
  1287. Xchdir '../out';
  1288. X`cp ../rules .rules`;
  1289. X$output = `$mailagent -d 2>/dev/null`;
  1290. X$? == 0 || print "1\n";
  1291. X`cp .rules myrules`;
  1292. X$output_bis = `$mailagent -r myrules -d 2>/dev/null`;
  1293. X$? == 0 || print "2\n";
  1294. X$output eq $output_bis || print "3\n";
  1295. Xunlink 'myrules';
  1296. Xprint "0\n";
  1297. END_OF_FILE
  1298.   if test 324 -ne `wc -c <'agent/test/option/r.t'`; then
  1299.     echo shar: \"'agent/test/option/r.t'\" unpacked with wrong size!
  1300.   fi
  1301.   # end of 'agent/test/option/r.t'
  1302. fi
  1303. if test -f 'agent/test/option/t.t' -a "${1}" != "-c" ; then 
  1304.   echo shar: Will not clobber existing file \"'agent/test/option/t.t'\"
  1305. else
  1306.   echo shar: Extracting \"'agent/test/option/t.t'\" \(644 characters\)
  1307.   sed "s/^X//" >'agent/test/option/t.t' <<'END_OF_FILE'
  1308. X# -t: track rules on stdout
  1309. Xdo '../pl/init.pl';
  1310. Xchdir '../out';
  1311. Xopen(MBOX, ">mbox") || print "1\n";
  1312. Xprint MBOX <<'EOM';
  1313. XFrom ram Sat Jul 11 18:51:16 PDT 1992
  1314. XFrom: ram
  1315. XTo: ram
  1316. XSubject: test
  1317. X
  1318. XThis is a test.
  1319. XEOM
  1320. Xclose MBOX;
  1321. X$trace = `$mailagent -t -e 'STRIP To; DELETE; LEAVE' mbox 2>/dev/null`;
  1322. X$? == 0 || print "2\n";
  1323. X@trace = split(/\n/, $trace);
  1324. Xgrep(/^-+\s+From/, @trace) || print "3\n";
  1325. Xgrep(/^>> STRIP/, @trace) || print "4\n";
  1326. Xgrep(/^>> DELETE/, @trace) || print "5\n";
  1327. Xgrep(/^>> LEAVE/, @trace) || print "6\n";
  1328. Xgrep(/match/i, @trace) || print "7\n";
  1329. X$user = $ENV{'USER'};
  1330. X-s "$user" || print "8\n";
  1331. Xunlink "$user", 'mbox';
  1332. Xprint "0\n";
  1333. END_OF_FILE
  1334.   if test 644 -ne `wc -c <'agent/test/option/t.t'`; then
  1335.     echo shar: \"'agent/test/option/t.t'\" unpacked with wrong size!
  1336.   fi
  1337.   # end of 'agent/test/option/t.t'
  1338. fi
  1339. if test -f 'agent/test/option/what.t' -a "${1}" != "-c" ; then 
  1340.   echo shar: Will not clobber existing file \"'agent/test/option/what.t'\"
  1341. else
  1342.   echo shar: Extracting \"'agent/test/option/what.t'\" \(147 characters\)
  1343.   sed "s/^X//" >'agent/test/option/what.t' <<'END_OF_FILE'
  1344. X# Make sure invalid option leads to a meaningful exit status
  1345. Xdo '../pl/init.pl';
  1346. X`$mailagent -foo -bar 2>&1`;
  1347. X$? != 0 || print "1\n";
  1348. Xprint "0\n";
  1349. END_OF_FILE
  1350.   if test 147 -ne `wc -c <'agent/test/option/what.t'`; then
  1351.     echo shar: \"'agent/test/option/what.t'\" unpacked with wrong size!
  1352.   fi
  1353.   # end of 'agent/test/option/what.t'
  1354. fi
  1355. if test -f 'agent/test/pl/cmd.pl' -a "${1}" != "-c" ; then 
  1356.   echo shar: Will not clobber existing file \"'agent/test/pl/cmd.pl'\"
  1357. else
  1358.   echo shar: Extracting \"'agent/test/pl/cmd.pl'\" \(408 characters\)
  1359.   sed "s/^X//" >'agent/test/pl/cmd.pl' <<'END_OF_FILE'
  1360. X# Common actions at the top of each command test
  1361. Xdo '../pl//init.pl';
  1362. Xchdir '../out';
  1363. Xdo '../pl/mail.pl';
  1364. X&cp_mail;
  1365. X$user = $ENV{'USER'};
  1366. Xunlink "$user", 'agentlog';
  1367. X$cmd = "$mailagent -L $ENV{'LEVEL'} -r ../actions mail 2>/dev/null";
  1368. X
  1369. X# We might need this
  1370. Xdo '../pl/logfile.pl';
  1371. X
  1372. Xsub cp_mail {
  1373. X    local($_);
  1374. X    open(MAIL, '../mail');
  1375. X    open(HERE, '>mail');
  1376. X    print HERE while <MAIL>;
  1377. X    close MAIL;
  1378. X    close HERE;
  1379. X}
  1380. X
  1381. END_OF_FILE
  1382.   if test 408 -ne `wc -c <'agent/test/pl/cmd.pl'`; then
  1383.     echo shar: \"'agent/test/pl/cmd.pl'\" unpacked with wrong size!
  1384.   fi
  1385.   # end of 'agent/test/pl/cmd.pl'
  1386. fi
  1387. if test -f 'agent/test/pl/filter.pl' -a "${1}" != "-c" ; then 
  1388.   echo shar: Will not clobber existing file \"'agent/test/pl/filter.pl'\"
  1389. else
  1390.   echo shar: Extracting \"'agent/test/pl/filter.pl'\" \(409 characters\)
  1391.   sed "s/^X//" >'agent/test/pl/filter.pl' <<'END_OF_FILE'
  1392. X# Common actions at the top of each filtering test
  1393. Xdo '../pl/init.pl';
  1394. Xchdir '../out';
  1395. Xdo '../pl/mail.pl';
  1396. X`cp ../mail .`;
  1397. X$user = $ENV{'USER'};
  1398. Xunlink "$user", 'agentlog';
  1399. X$cmd = "$mailagent -L $ENV{'LEVEL'} -r ../rules mail 2>/dev/null";
  1400. X
  1401. X# Re-create pattern list
  1402. Xopen(PATTERN, ">pattern-list");
  1403. Xprint PATTERN <<'EOP';
  1404. Xno-match-possible
  1405. Xanother-impossible-match
  1406. X# This will match
  1407. Xpattern
  1408. XEOP
  1409. Xclose PATTERN;
  1410. END_OF_FILE
  1411.   if test 409 -ne `wc -c <'agent/test/pl/filter.pl'`; then
  1412.     echo shar: \"'agent/test/pl/filter.pl'\" unpacked with wrong size!
  1413.   fi
  1414.   # end of 'agent/test/pl/filter.pl'
  1415. fi
  1416. if test -f 'agent/test/pl/init.pl' -a "${1}" != "-c" ; then 
  1417.   echo shar: Will not clobber existing file \"'agent/test/pl/init.pl'\"
  1418. else
  1419.   echo shar: Extracting \"'agent/test/pl/init.pl'\" \(367 characters\)
  1420.   sed "s/^X//" >'agent/test/pl/init.pl' <<'END_OF_FILE'
  1421. X# Set up mailagent and filter paths
  1422. X$pwd = $ENV{'PWD'};                    # Where TEST was invoked from
  1423. X($up) = $pwd =~ m|^(.*)/.*|;
  1424. X$mailagent_prog = $ENV{'MAILAGENT'};
  1425. X$mailagent_path = "$up/$mailagent_prog";
  1426. X$mailagent = "$mailagent_path -TEST";
  1427. X$filter = "$up/filter/filter";
  1428. X
  1429. X# Make sure no lock were left by previous test
  1430. Xunlink "$pwd/out/filter.lock", "$pwd/out/perl.lock";
  1431. END_OF_FILE
  1432.   if test 367 -ne `wc -c <'agent/test/pl/init.pl'`; then
  1433.     echo shar: \"'agent/test/pl/init.pl'\" unpacked with wrong size!
  1434.   fi
  1435.   # end of 'agent/test/pl/init.pl'
  1436. fi
  1437. if test -f 'agent/test/pl/logfile.pl' -a "${1}" != "-c" ; then 
  1438.   echo shar: Will not clobber existing file \"'agent/test/pl/logfile.pl'\"
  1439. else
  1440.   echo shar: Extracting \"'agent/test/pl/logfile.pl'\" \(612 characters\)
  1441.   sed "s/^X//" >'agent/test/pl/logfile.pl' <<'END_OF_FILE'
  1442. X# Get log file (by default) or any other file into @log
  1443. Xsub get_log {
  1444. X    local($num, $file) = @_;
  1445. X    $file = 'agentlog' unless $file;
  1446. X    open(LOG, $file) || print "$num\n";
  1447. X    @log = <LOG>;
  1448. X    close LOG;
  1449. X}
  1450. X
  1451. X# Make sure a pattern is within @log, return number of matches
  1452. Xsub check_log {
  1453. X    local($pattern, $num) = @_;
  1454. X    local(@matches);
  1455. X    eval "\@matches = grep(/$pattern/, \@log)" || print "$num\n";
  1456. X    0 + @matches;
  1457. X}
  1458. X
  1459. X# Make sure a pattern is NOT within @log, return number of matches
  1460. Xsub not_log {
  1461. X    local($pattern, $num) = @_;
  1462. X    local(@matches);
  1463. X    eval "\@matches = grep(/$pattern/, \@log)" && print "$num\n";
  1464. X    0 + @matches;
  1465. X}
  1466. END_OF_FILE
  1467.   if test 612 -ne `wc -c <'agent/test/pl/logfile.pl'`; then
  1468.     echo shar: \"'agent/test/pl/logfile.pl'\" unpacked with wrong size!
  1469.   fi
  1470.   # end of 'agent/test/pl/logfile.pl'
  1471. fi
  1472. if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  1473.   echo shar: Will not clobber existing file \"'patchlevel.h'\"
  1474. else
  1475.   echo shar: Extracting \"'patchlevel.h'\" \(93 characters\)
  1476.   sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
  1477. X/* 3.0 BETA TEST RELEASE -- agent subdirectory */
  1478. X
  1479. X#define VERSION 2.9
  1480. X#define PATCHLEVEL 12
  1481. END_OF_FILE
  1482.   if test 93 -ne `wc -c <'patchlevel.h'`; then
  1483.     echo shar: \"'patchlevel.h'\" unpacked with wrong size!
  1484.   fi
  1485.   # end of 'patchlevel.h'
  1486. fi
  1487. echo shar: End of archive 17 \(of 17\).
  1488. cp /dev/null ark17isdone
  1489. MISSING=""
  1490. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ; do
  1491.     if test ! -f ark${I}isdone ; then
  1492.     MISSING="${MISSING} ${I}"
  1493.     fi
  1494. done
  1495. if test "${MISSING}" = "" ; then
  1496.     echo You have unpacked all 17 archives.
  1497.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1498. else
  1499.     echo You still must unpack the following archives:
  1500.     echo "        " ${MISSING}
  1501. fi
  1502. exit 0
  1503. exit 0 # Just in case...
  1504.