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

  1. Newsgroups: comp.sources.misc
  2. From: Raphael Manfredi <ram@acri.fr>
  3. Subject: v41i022:  mailagent - Flexible mail filtering and processing package, v3.0, Part22/26
  4. Message-ID: <1993Dec3.213535.23100@sparky.sterling.com>
  5. X-Md4-Signature: 80fe037796689a7540372e4540baf9f9
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Advanced Computer Research Institute, Lyon, France.
  8. Date: Fri, 3 Dec 1993 21:35:35 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: Raphael Manfredi <ram@acri.fr>
  12. Posting-number: Volume 41, Issue 22
  13. Archive-name: mailagent/part22
  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:  Jmakefile agent/Jmakefile agent/files/help/addauth.SH
  24. #   agent/files/help/approve.SH agent/files/help/delpower.SH
  25. #   agent/files/help/end.SH agent/files/help/getauth.SH
  26. #   agent/files/help/password.SH agent/files/help/power.SH
  27. #   agent/files/help/remauth.SH agent/files/help/setauth.SH
  28. #   agent/filter/environ.h agent/filter/logfile.h
  29. #   agent/filter/portable.h agent/pl/period.pl agent/test/cmd/apply.t
  30. #   agent/test/cmd/forward.t agent/test/cmd/leave.t
  31. #   agent/test/cmd/notify.t agent/test/cmd/save.t
  32. #   agent/test/cmd/vacation.t agent/test/filter/range.t
  33. #   agent/test/mail agent/test/option/e.t agent/test/option/f.t
  34. #   agent/test/option/l.t
  35. # Wrapped by ram@soft208 on Mon Nov 29 16:49:57 1993
  36. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  37. echo If this archive is complete, you will see the following message:
  38. echo '          "shar: End of archive 22 (of 26)."'
  39. if test -f 'Jmakefile' -a "${1}" != "-c" ; then 
  40.   echo shar: Will not clobber existing file \"'Jmakefile'\"
  41. else
  42.   echo shar: Extracting \"'Jmakefile'\" \(697 characters\)
  43.   sed "s/^X//" >'Jmakefile' <<'END_OF_FILE'
  44. X/*
  45. X * Main Jmakefile for mailagent 2.9
  46. X */
  47. X
  48. X;# $Id: Jmakefile,v 3.0 1993/11/29 13:47:34 ram Exp ram $
  49. X;#
  50. X;#  Copyright (c) 1990-1993, Raphael Manfredi
  51. X;#  
  52. X;#  You may redistribute only under the terms of the Artistic License,
  53. X;#  as specified in the README file that comes with the distribution.
  54. X;#  You may reuse parts of this distribution only within the terms of
  55. X;#  that same Artistic License; a copy of which may be found at the root
  56. X;#  of the source tree for mailagent 3.0.
  57. X;#
  58. X;# $Log: Jmakefile,v $
  59. X;# Revision 3.0  1993/11/29  13:47:34  ram
  60. X;# Baseline for mailagent 3.0 netwide release.
  61. X;#
  62. X
  63. Xall::
  64. X
  65. XNoManPages()
  66. XSetSubdirs(agent)
  67. XAddedByConfigure(install mkdep cppstdin)
  68. XDependSubdirs()
  69. END_OF_FILE
  70.   if test 697 -ne `wc -c <'Jmakefile'`; then
  71.     echo shar: \"'Jmakefile'\" unpacked with wrong size!
  72.   fi
  73.   # end of 'Jmakefile'
  74. fi
  75. if test -f 'agent/Jmakefile' -a "${1}" != "-c" ; then 
  76.   echo shar: Will not clobber existing file \"'agent/Jmakefile'\"
  77. else
  78.   echo shar: Extracting \"'agent/Jmakefile'\" \(1548 characters\)
  79.   sed "s/^X//" >'agent/Jmakefile' <<'END_OF_FILE'
  80. X/*
  81. X * Jmakefile for mailagent
  82. X */
  83. X
  84. X;# $Id: Jmakefile,v 3.0 1993/11/29 13:47:37 ram Exp ram $
  85. X;#
  86. X;#  Copyright (c) 1990-1993, Raphael Manfredi
  87. X;#  
  88. X;#  You may redistribute only under the terms of the Artistic License,
  89. X;#  as specified in the README file that comes with the distribution.
  90. X;#  You may reuse parts of this distribution only within the terms of
  91. X;#  that same Artistic License; a copy of which may be found at the root
  92. X;#  of the source tree for mailagent 3.0.
  93. X;#
  94. X;# $Log: Jmakefile,v $
  95. X;# Revision 3.0  1993/11/29  13:47:37  ram
  96. X;# Baseline for mailagent 3.0 netwide release.
  97. X;#
  98. X
  99. XBIN = mailpatch mailhelp maillist maildist package
  100. X
  101. XNoManPages()
  102. XShellScriptTarget($(BIN))
  103. XSimpleShellScriptTarget(magent)
  104. X
  105. X/* The mailagent itself is derived from 'magent' through perload, hence
  106. X * making the program more efficient (the whole script need not be compiled
  107. X * by perl).
  108. X */
  109. X
  110. XAllTarget(mailagent)
  111. Xmailagent: magent
  112. X    perl $(TOP)/bin/perload -o magent > $@
  113. X    chmod +rx $@
  114. X
  115. X/* The mailagent carries some machine-dependant parts (for file locking)
  116. X * so it is a binary, not a script (viz it may not be shared accross
  117. X * different architectures).
  118. X */
  119. X
  120. X>BINDIR
  121. XInstallScript(mailagent,$(BINDIR))
  122. X
  123. XSetSubdirs(files filter man test)
  124. XDependDirs(filter)
  125. X
  126. XBINSH = \
  127. X|expand f!$(BIN) magent!
  128. X    !f.SH \
  129. X-expand \\
  130. X
  131. X>SED
  132. X>RM
  133. X>MKDEP
  134. X
  135. Xdepend::
  136. X    ($(SED) '/^# DO NOT DELETE/q' Makefile && \
  137. X    grep '^\$$grep' $(BINSH) | \
  138. X    $(SED) -e "s/^.*' \([^ ]*\) >>\(.*\)/\2: \1/" \
  139. X    ) > Makefile.new
  140. X    cp Makefile Makefile.bak
  141. X    cp Makefile.new Makefile
  142. X    $(RM) Makefile.new
  143. X
  144. END_OF_FILE
  145.   if test 1548 -ne `wc -c <'agent/Jmakefile'`; then
  146.     echo shar: \"'agent/Jmakefile'\" unpacked with wrong size!
  147.   fi
  148.   # end of 'agent/Jmakefile'
  149. fi
  150. if test -f 'agent/files/help/addauth.SH' -a "${1}" != "-c" ; then 
  151.   echo shar: Will not clobber existing file \"'agent/files/help/addauth.SH'\"
  152. else
  153.   echo shar: Extracting \"'agent/files/help/addauth.SH'\" \(1562 characters\)
  154.   sed "s/^X//" >'agent/files/help/addauth.SH' <<'END_OF_FILE'
  155. Xcase $CONFIG in
  156. X'')
  157. X    if test -f config.sh; then TOP=.;
  158. X    elif test -f ../config.sh; then TOP=..;
  159. X    elif test -f ../../config.sh; then TOP=../..;
  160. X    elif test -f ../../../config.sh; then TOP=../../..;
  161. X    elif test -f ../../../../config.sh; then TOP=../../../..;
  162. X    else
  163. X        echo "Can't find config.sh."; exit 1
  164. X    fi
  165. X    . $TOP/config.sh
  166. X    ;;
  167. Xesac
  168. Xcase "$0" in
  169. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  170. Xesac
  171. Xecho "Extracting agent/files/help/addauth (with variable substitutions)"
  172. X$spitshell >/dev/null <<!GROK!THIS!
  173. X# $Id: addauth.SH,v 3.0 1993/11/29 13:47:54 ram Exp ram $
  174. X#
  175. X#  Copyright (c) 1990-1993, Raphael Manfredi
  176. X#  
  177. X#  You may redistribute only under the terms of the Artistic License,
  178. X#  as specified in the README file that comes with the distribution.
  179. X#  You may reuse parts of this distribution only within the terms of
  180. X#  that same Artistic License; a copy of which may be found at the root
  181. X#  of the source tree for mailagent 3.0.
  182. X#
  183. X# $Log: addauth.SH,v $
  184. X# Revision 3.0  1993/11/29  13:47:54  ram
  185. X# Baseline for mailagent 3.0 netwide release.
  186. X#
  187. X!GROK!THIS!
  188. X$spitshell >addauth <<'!NO!SUBS!'
  189. XNAME
  190. X
  191. X    addauth -- Adds users to power clearance file
  192. X
  193. XSYNOPSIS
  194. X
  195. X    addauth power [password]
  196. X    ... users ...
  197. X    EOF
  198. X
  199. XDESCRIPTION
  200. X
  201. XThis command adds the specified users to the specified power. The power
  202. Xpassword is optional if the power is already detained or the user has
  203. Xalready got the 'system' power.
  204. X
  205. XTo alter 'root' and 'security' clearances, the corresponding power is needed.
  206. X
  207. XEXAMPLE
  208. X
  209. X    addauth list-power mypasswd
  210. X    ram@acri.fr
  211. X    ram@eiffel.com
  212. X    EOF
  213. X!NO!SUBS!
  214. Xchmod 644 addauth
  215. END_OF_FILE
  216.   if test 1562 -ne `wc -c <'agent/files/help/addauth.SH'`; then
  217.     echo shar: \"'agent/files/help/addauth.SH'\" unpacked with wrong size!
  218.   fi
  219.   chmod +x 'agent/files/help/addauth.SH'
  220.   # end of 'agent/files/help/addauth.SH'
  221. fi
  222. if test -f 'agent/files/help/approve.SH' -a "${1}" != "-c" ; then 
  223.   echo shar: Will not clobber existing file \"'agent/files/help/approve.SH'\"
  224. else
  225.   echo shar: Extracting \"'agent/files/help/approve.SH'\" \(1634 characters\)
  226.   sed "s/^X//" >'agent/files/help/approve.SH' <<'END_OF_FILE'
  227. Xcase $CONFIG in
  228. X'')
  229. X    if test -f config.sh; then TOP=.;
  230. X    elif test -f ../config.sh; then TOP=..;
  231. X    elif test -f ../../config.sh; then TOP=../..;
  232. X    elif test -f ../../../config.sh; then TOP=../../..;
  233. X    elif test -f ../../../../config.sh; then TOP=../../../..;
  234. X    else
  235. X        echo "Can't find config.sh."; exit 1
  236. X    fi
  237. X    . $TOP/config.sh
  238. X    ;;
  239. Xesac
  240. Xcase "$0" in
  241. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  242. Xesac
  243. Xecho "Extracting agent/files/help/approve (with variable substitutions)"
  244. X$spitshell >/dev/null <<!GROK!THIS!
  245. X# $Id: approve.SH,v 3.0 1993/11/29 13:47:54 ram Exp ram $
  246. X#
  247. X#  Copyright (c) 1990-1993, Raphael Manfredi
  248. X#  
  249. X#  You may redistribute only under the terms of the Artistic License,
  250. X#  as specified in the README file that comes with the distribution.
  251. X#  You may reuse parts of this distribution only within the terms of
  252. X#  that same Artistic License; a copy of which may be found at the root
  253. X#  of the source tree for mailagent 3.0.
  254. X#
  255. X# $Log: approve.SH,v $
  256. X# Revision 3.0  1993/11/29  13:47:54  ram
  257. X# Baseline for mailagent 3.0 netwide release.
  258. X#
  259. X!GROK!THIS!
  260. X$spitshell >approve <<'!NO!SUBS!'
  261. XNAME
  262. X
  263. X    approve -- Approves command in advance by specifying a password
  264. X
  265. XSYNOPSIS
  266. X
  267. X    approve password command
  268. X
  269. XDESCRIPTION
  270. X
  271. XThis command records the specified password in the environment and then
  272. Xlaunches the command given as argument.
  273. X
  274. XIt is entirely up to the command to check the approve variable when it
  275. Xotherwise expects a password, otherwise this command has no visible
  276. Xeffect.
  277. X
  278. XIt is not currently possible to approve a command which collects input.
  279. X
  280. XEXAMPLE
  281. X
  282. X    approve list-password subscribe agent-users ram@acri.fr
  283. X!NO!SUBS!
  284. Xchmod 644 approve
  285. END_OF_FILE
  286.   if test 1634 -ne `wc -c <'agent/files/help/approve.SH'`; then
  287.     echo shar: \"'agent/files/help/approve.SH'\" unpacked with wrong size!
  288.   fi
  289.   chmod +x 'agent/files/help/approve.SH'
  290.   # end of 'agent/files/help/approve.SH'
  291. fi
  292. if test -f 'agent/files/help/delpower.SH' -a "${1}" != "-c" ; then 
  293.   echo shar: Will not clobber existing file \"'agent/files/help/delpower.SH'\"
  294. else
  295.   echo shar: Extracting \"'agent/files/help/delpower.SH'\" \(1552 characters\)
  296.   sed "s/^X//" >'agent/files/help/delpower.SH' <<'END_OF_FILE'
  297. Xcase $CONFIG in
  298. X'')
  299. X    if test -f config.sh; then TOP=.;
  300. X    elif test -f ../config.sh; then TOP=..;
  301. X    elif test -f ../../config.sh; then TOP=../..;
  302. X    elif test -f ../../../config.sh; then TOP=../../..;
  303. X    elif test -f ../../../../config.sh; then TOP=../../../..;
  304. X    else
  305. X        echo "Can't find config.sh."; exit 1
  306. X    fi
  307. X    . $TOP/config.sh
  308. X    ;;
  309. Xesac
  310. Xcase "$0" in
  311. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  312. Xesac
  313. Xecho "Extracting agent/files/help/delpower (with variable substitutions)"
  314. X$spitshell >/dev/null <<!GROK!THIS!
  315. X# $Id: delpower.SH,v 3.0 1993/11/29 13:47:55 ram Exp ram $
  316. X#
  317. X#  Copyright (c) 1990-1993, Raphael Manfredi
  318. X#  
  319. X#  You may redistribute only under the terms of the Artistic License,
  320. X#  as specified in the README file that comes with the distribution.
  321. X#  You may reuse parts of this distribution only within the terms of
  322. X#  that same Artistic License; a copy of which may be found at the root
  323. X#  of the source tree for mailagent 3.0.
  324. X#
  325. X# $Log: delpower.SH,v $
  326. X# Revision 3.0  1993/11/29  13:47:55  ram
  327. X# Baseline for mailagent 3.0 netwide release.
  328. X#
  329. X!GROK!THIS!
  330. X$spitshell >delpower <<'!NO!SUBS!'
  331. XNAME
  332. X
  333. X    delpower -- Deletes a power from the system
  334. X
  335. XSYNOPSIS
  336. X
  337. X    delpower power password [security]
  338. X
  339. XDESCRIPTION
  340. X
  341. XThis command deletes a power and its associated clearance list. The 'system'
  342. Xpower is required to delete all powers but 'root' and 'security'.
  343. X
  344. XThe 'security' power may only be deleted by security and the 'root' power may
  345. Xonly be deleted when the security password is also specified.
  346. X
  347. XEXAMPLE
  348. X
  349. X    delpower list list-password
  350. X!NO!SUBS!
  351. Xchmod 644 delpower
  352. END_OF_FILE
  353.   if test 1552 -ne `wc -c <'agent/files/help/delpower.SH'`; then
  354.     echo shar: \"'agent/files/help/delpower.SH'\" unpacked with wrong size!
  355.   fi
  356.   chmod +x 'agent/files/help/delpower.SH'
  357.   # end of 'agent/files/help/delpower.SH'
  358. fi
  359. if test -f 'agent/files/help/end.SH' -a "${1}" != "-c" ; then 
  360.   echo shar: Will not clobber existing file \"'agent/files/help/end.SH'\"
  361. else
  362.   echo shar: Extracting \"'agent/files/help/end.SH'\" \(1469 characters\)
  363.   sed "s/^X//" >'agent/files/help/end.SH' <<'END_OF_FILE'
  364. Xcase $CONFIG in
  365. X'')
  366. X    if test -f config.sh; then TOP=.;
  367. X    elif test -f ../config.sh; then TOP=..;
  368. X    elif test -f ../../config.sh; then TOP=../..;
  369. X    elif test -f ../../../config.sh; then TOP=../../..;
  370. X    elif test -f ../../../../config.sh; then TOP=../../../..;
  371. X    else
  372. X        echo "Can't find config.sh."; exit 1
  373. X    fi
  374. X    . $TOP/config.sh
  375. X    ;;
  376. Xesac
  377. Xcase "$0" in
  378. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  379. Xesac
  380. Xecho "Extracting agent/files/help/end (with variable substitutions)"
  381. X$spitshell >/dev/null <<!GROK!THIS!
  382. X# $Id: end.SH,v 3.0 1993/11/29 13:47:55 ram Exp ram $
  383. X#
  384. X#  Copyright (c) 1990-1993, Raphael Manfredi
  385. X#  
  386. X#  You may redistribute only under the terms of the Artistic License,
  387. X#  as specified in the README file that comes with the distribution.
  388. X#  You may reuse parts of this distribution only within the terms of
  389. X#  that same Artistic License; a copy of which may be found at the root
  390. X#  of the source tree for mailagent 3.0.
  391. X#
  392. X# $Log: end.SH,v $
  393. X# Revision 3.0  1993/11/29  13:47:55  ram
  394. X# Baseline for mailagent 3.0 netwide release.
  395. X#
  396. X!GROK!THIS!
  397. X$spitshell >end <<'!NO!SUBS!'
  398. XNAME
  399. X
  400. X    end -- Ends a server request
  401. X
  402. XSYNOPSIS
  403. X
  404. X    end
  405. X
  406. XDESCRIPTION
  407. X
  408. XThis pseudo command simply ends the processing of your request. The remaining
  409. Xof your message is discarded.
  410. X
  411. XUsually, a server request is also ended when a signature delimiter "--" is
  412. Xreached or at the physical end of the message.
  413. X
  414. XEXAMPLE
  415. X
  416. X    ... some commands ...
  417. X    end
  418. X    ... mail message continues (ignored) ...
  419. X!NO!SUBS!
  420. Xchmod 644 end
  421. END_OF_FILE
  422.   if test 1469 -ne `wc -c <'agent/files/help/end.SH'`; then
  423.     echo shar: \"'agent/files/help/end.SH'\" unpacked with wrong size!
  424.   fi
  425.   chmod +x 'agent/files/help/end.SH'
  426.   # end of 'agent/files/help/end.SH'
  427. fi
  428. if test -f 'agent/files/help/getauth.SH' -a "${1}" != "-c" ; then 
  429.   echo shar: Will not clobber existing file \"'agent/files/help/getauth.SH'\"
  430. else
  431.   echo shar: Extracting \"'agent/files/help/getauth.SH'\" \(1509 characters\)
  432.   sed "s/^X//" >'agent/files/help/getauth.SH' <<'END_OF_FILE'
  433. Xcase $CONFIG in
  434. X'')
  435. X    if test -f config.sh; then TOP=.;
  436. X    elif test -f ../config.sh; then TOP=..;
  437. X    elif test -f ../../config.sh; then TOP=../..;
  438. X    elif test -f ../../../config.sh; then TOP=../../..;
  439. X    elif test -f ../../../../config.sh; then TOP=../../../..;
  440. X    else
  441. X        echo "Can't find config.sh."; exit 1
  442. X    fi
  443. X    . $TOP/config.sh
  444. X    ;;
  445. Xesac
  446. Xcase "$0" in
  447. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  448. Xesac
  449. Xecho "Extracting agent/files/help/getauth (with variable substitutions)"
  450. X$spitshell >/dev/null <<!GROK!THIS!
  451. X# $Id: getauth.SH,v 3.0 1993/11/29 13:47:56 ram Exp ram $
  452. X#
  453. X#  Copyright (c) 1990-1993, Raphael Manfredi
  454. X#  
  455. X#  You may redistribute only under the terms of the Artistic License,
  456. X#  as specified in the README file that comes with the distribution.
  457. X#  You may reuse parts of this distribution only within the terms of
  458. X#  that same Artistic License; a copy of which may be found at the root
  459. X#  of the source tree for mailagent 3.0.
  460. X#
  461. X# $Log: getauth.SH,v $
  462. X# Revision 3.0  1993/11/29  13:47:56  ram
  463. X# Baseline for mailagent 3.0 netwide release.
  464. X#
  465. X!GROK!THIS!
  466. X$spitshell >getauth <<'!NO!SUBS!'
  467. XNAME
  468. X
  469. X    getauth -- Gets power clearance file
  470. X
  471. XSYNOPSIS
  472. X
  473. X    getauth power [password]
  474. X
  475. XDESCRIPTION
  476. X
  477. XThis command requests the power clearance file for the specified power. The
  478. Xpower password is optional if the power is already detained or the user has
  479. Xalready got the 'system' power.
  480. X
  481. XTo get the 'root' or 'security' clearances, you need the corresponding
  482. Xpower.
  483. X
  484. XEXAMPLE
  485. X
  486. X    getauth list-power mypasswd
  487. X!NO!SUBS!
  488. Xchmod 644 getauth
  489. END_OF_FILE
  490.   if test 1509 -ne `wc -c <'agent/files/help/getauth.SH'`; then
  491.     echo shar: \"'agent/files/help/getauth.SH'\" unpacked with wrong size!
  492.   fi
  493.   chmod +x 'agent/files/help/getauth.SH'
  494.   # end of 'agent/files/help/getauth.SH'
  495. fi
  496. if test -f 'agent/files/help/password.SH' -a "${1}" != "-c" ; then 
  497.   echo shar: Will not clobber existing file \"'agent/files/help/password.SH'\"
  498. else
  499.   echo shar: Extracting \"'agent/files/help/password.SH'\" \(1513 characters\)
  500.   sed "s/^X//" >'agent/files/help/password.SH' <<'END_OF_FILE'
  501. Xcase $CONFIG in
  502. X'')
  503. X    if test -f config.sh; then TOP=.;
  504. X    elif test -f ../config.sh; then TOP=..;
  505. X    elif test -f ../../config.sh; then TOP=../..;
  506. X    elif test -f ../../../config.sh; then TOP=../../..;
  507. X    elif test -f ../../../../config.sh; then TOP=../../../..;
  508. X    else
  509. X        echo "Can't find config.sh."; exit 1
  510. X    fi
  511. X    . $TOP/config.sh
  512. X    ;;
  513. Xesac
  514. Xcase "$0" in
  515. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  516. Xesac
  517. Xecho "Extracting agent/files/help/password (with variable substitutions)"
  518. X$spitshell >/dev/null <<!GROK!THIS!
  519. X# $Id: password.SH,v 3.0 1993/11/29 13:47:57 ram Exp ram $
  520. X#
  521. X#  Copyright (c) 1990-1993, Raphael Manfredi
  522. X#  
  523. X#  You may redistribute only under the terms of the Artistic License,
  524. X#  as specified in the README file that comes with the distribution.
  525. X#  You may reuse parts of this distribution only within the terms of
  526. X#  that same Artistic License; a copy of which may be found at the root
  527. X#  of the source tree for mailagent 3.0.
  528. X#
  529. X# $Log: password.SH,v $
  530. X# Revision 3.0  1993/11/29  13:47:57  ram
  531. X# Baseline for mailagent 3.0 netwide release.
  532. X#
  533. X!GROK!THIS!
  534. X$spitshell >password <<'!NO!SUBS!'
  535. XNAME
  536. X
  537. X    password -- Sets new power password
  538. X
  539. XSYNOPSIS
  540. X
  541. X    password power new
  542. X
  543. XDESCRIPTION
  544. X
  545. XThis command sets a new power password. You usually need the corresponding
  546. Xpower or have the 'system' power, hence showing you know the password for
  547. Xthat power or have greater privileges.
  548. X
  549. XTo change the 'root' and 'security' passwords, you need the corresponding
  550. Xpower.
  551. X
  552. XEXAMPLE
  553. X
  554. X    password list-power mypass
  555. X!NO!SUBS!
  556. Xchmod 644 password
  557. END_OF_FILE
  558.   if test 1513 -ne `wc -c <'agent/files/help/password.SH'`; then
  559.     echo shar: \"'agent/files/help/password.SH'\" unpacked with wrong size!
  560.   fi
  561.   chmod +x 'agent/files/help/password.SH'
  562.   # end of 'agent/files/help/password.SH'
  563. fi
  564. if test -f 'agent/files/help/power.SH' -a "${1}" != "-c" ; then 
  565.   echo shar: Will not clobber existing file \"'agent/files/help/power.SH'\"
  566. else
  567.   echo shar: Extracting \"'agent/files/help/power.SH'\" \(1714 characters\)
  568.   sed "s/^X//" >'agent/files/help/power.SH' <<'END_OF_FILE'
  569. Xcase $CONFIG in
  570. X'')
  571. X    if test -f config.sh; then TOP=.;
  572. X    elif test -f ../config.sh; then TOP=..;
  573. X    elif test -f ../../config.sh; then TOP=../..;
  574. X    elif test -f ../../../config.sh; then TOP=../../..;
  575. X    elif test -f ../../../../config.sh; then TOP=../../../..;
  576. X    else
  577. X        echo "Can't find config.sh."; exit 1
  578. X    fi
  579. X    . $TOP/config.sh
  580. X    ;;
  581. Xesac
  582. Xcase "$0" in
  583. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  584. Xesac
  585. Xecho "Extracting agent/files/help/power (with variable substitutions)"
  586. X$spitshell >/dev/null <<!GROK!THIS!
  587. X# $Id: power.SH,v 3.0 1993/11/29 13:47:58 ram Exp ram $
  588. X#
  589. X#  Copyright (c) 1990-1993, Raphael Manfredi
  590. X#  
  591. X#  You may redistribute only under the terms of the Artistic License,
  592. X#  as specified in the README file that comes with the distribution.
  593. X#  You may reuse parts of this distribution only within the terms of
  594. X#  that same Artistic License; a copy of which may be found at the root
  595. X#  of the source tree for mailagent 3.0.
  596. X#
  597. X# $Log: power.SH,v $
  598. X# Revision 3.0  1993/11/29  13:47:58  ram
  599. X# Baseline for mailagent 3.0 netwide release.
  600. X#
  601. X!GROK!THIS!
  602. X$spitshell >power <<'!NO!SUBS!'
  603. XNAME
  604. X
  605. X    power -- Asks for a new power
  606. X
  607. XSYNOPSIS
  608. X
  609. X    power name password
  610. X
  611. XDESCRIPTION
  612. X
  613. XThis command requests for a new power. You must give the proper password and
  614. Xbe listed in the clearance file in order to get it. Moreover, the server
  615. Xprocessing your commands must be in trusted mode to grant you the power,
  616. Xeven if your credentials are otherwise perfectly valid.
  617. X
  618. XAny power is granted automatically to 'root', except 'security' of course
  619. Xwhich must be requested for separately.
  620. X
  621. XIt is recommended you release a power when you don't need it any longer,
  622. Xto guard against mistakes.
  623. X
  624. XEXAMPLE
  625. X
  626. X    power list list-passwd
  627. X!NO!SUBS!
  628. Xchmod 644 power
  629. END_OF_FILE
  630.   if test 1714 -ne `wc -c <'agent/files/help/power.SH'`; then
  631.     echo shar: \"'agent/files/help/power.SH'\" unpacked with wrong size!
  632.   fi
  633.   chmod +x 'agent/files/help/power.SH'
  634.   # end of 'agent/files/help/power.SH'
  635. fi
  636. if test -f 'agent/files/help/remauth.SH' -a "${1}" != "-c" ; then 
  637.   echo shar: Will not clobber existing file \"'agent/files/help/remauth.SH'\"
  638. else
  639.   echo shar: Extracting \"'agent/files/help/remauth.SH'\" \(1692 characters\)
  640.   sed "s/^X//" >'agent/files/help/remauth.SH' <<'END_OF_FILE'
  641. Xcase $CONFIG in
  642. X'')
  643. X    if test -f config.sh; then TOP=.;
  644. X    elif test -f ../config.sh; then TOP=..;
  645. X    elif test -f ../../config.sh; then TOP=../..;
  646. X    elif test -f ../../../config.sh; then TOP=../../..;
  647. X    elif test -f ../../../../config.sh; then TOP=../../../..;
  648. X    else
  649. X        echo "Can't find config.sh."; exit 1
  650. X    fi
  651. X    . $TOP/config.sh
  652. X    ;;
  653. Xesac
  654. Xcase "$0" in
  655. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  656. Xesac
  657. Xecho "Extracting agent/files/help/remauth (with variable substitutions)"
  658. X$spitshell >/dev/null <<!GROK!THIS!
  659. X# $Id: remauth.SH,v 3.0 1993/11/29 13:47:59 ram Exp ram $
  660. X#
  661. X#  Copyright (c) 1990-1993, Raphael Manfredi
  662. X#  
  663. X#  You may redistribute only under the terms of the Artistic License,
  664. X#  as specified in the README file that comes with the distribution.
  665. X#  You may reuse parts of this distribution only within the terms of
  666. X#  that same Artistic License; a copy of which may be found at the root
  667. X#  of the source tree for mailagent 3.0.
  668. X#
  669. X# $Log: remauth.SH,v $
  670. X# Revision 3.0  1993/11/29  13:47:59  ram
  671. X# Baseline for mailagent 3.0 netwide release.
  672. X#
  673. X!GROK!THIS!
  674. X$spitshell >remauth <<'!NO!SUBS!'
  675. XNAME
  676. X
  677. X    remauth -- Removes users from power clearance file
  678. X
  679. XSYNOPSIS
  680. X
  681. X    remauth name [password]
  682. X    ... list of users ...
  683. X    EOF
  684. X
  685. XDESCRIPTION
  686. X
  687. XThis command removes specified users from the power's clearance file. No
  688. Xspecial power is required when the target power is already detained. Otherwise
  689. Xthe 'system' power is needed.
  690. X
  691. XAs usual, 'root' and 'security' clearances require the corresponding power to
  692. Xbe held or the appropriate password.
  693. X
  694. XOnly users matching exactly the addresses listed in the clearance file will
  695. Xbe removed.
  696. X
  697. XEXAMPLE
  698. X
  699. X    remauth list list-password
  700. X    root@acri.fr
  701. X    EOF
  702. X!NO!SUBS!
  703. Xchmod 644 remauth
  704. END_OF_FILE
  705.   if test 1692 -ne `wc -c <'agent/files/help/remauth.SH'`; then
  706.     echo shar: \"'agent/files/help/remauth.SH'\" unpacked with wrong size!
  707.   fi
  708.   chmod +x 'agent/files/help/remauth.SH'
  709.   # end of 'agent/files/help/remauth.SH'
  710. fi
  711. if test -f 'agent/files/help/setauth.SH' -a "${1}" != "-c" ; then 
  712.   echo shar: Will not clobber existing file \"'agent/files/help/setauth.SH'\"
  713. else
  714.   echo shar: Extracting \"'agent/files/help/setauth.SH'\" \(1583 characters\)
  715.   sed "s/^X//" >'agent/files/help/setauth.SH' <<'END_OF_FILE'
  716. Xcase $CONFIG in
  717. X'')
  718. X    if test -f config.sh; then TOP=.;
  719. X    elif test -f ../config.sh; then TOP=..;
  720. X    elif test -f ../../config.sh; then TOP=../..;
  721. X    elif test -f ../../../config.sh; then TOP=../../..;
  722. X    elif test -f ../../../../config.sh; then TOP=../../../..;
  723. X    else
  724. X        echo "Can't find config.sh."; exit 1
  725. X    fi
  726. X    . $TOP/config.sh
  727. X    ;;
  728. Xesac
  729. Xcase "$0" in
  730. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  731. Xesac
  732. Xecho "Extracting agent/files/help/setauth (with variable substitutions)"
  733. X$spitshell >/dev/null <<!GROK!THIS!
  734. X# $Id: setauth.SH,v 3.0 1993/11/29 13:48:00 ram Exp ram $
  735. X#
  736. X#  Copyright (c) 1990-1993, Raphael Manfredi
  737. X#  
  738. X#  You may redistribute only under the terms of the Artistic License,
  739. X#  as specified in the README file that comes with the distribution.
  740. X#  You may reuse parts of this distribution only within the terms of
  741. X#  that same Artistic License; a copy of which may be found at the root
  742. X#  of the source tree for mailagent 3.0.
  743. X#
  744. X# $Log: setauth.SH,v $
  745. X# Revision 3.0  1993/11/29  13:48:00  ram
  746. X# Baseline for mailagent 3.0 netwide release.
  747. X#
  748. X!GROK!THIS!
  749. X$spitshell >setauth <<'!NO!SUBS!'
  750. XNAME
  751. X
  752. X    setauth -- Replaces current clearance file
  753. X
  754. XSYNOPSIS
  755. X
  756. X    setauth name [password]
  757. X    ... list of users ...
  758. X    EOF
  759. X
  760. XDESCRIPTION
  761. X
  762. XThis command sets the clearance file for the target power. No special power is
  763. Xrequired when the target power is already detained. Otherwise the 'system'
  764. Xpower is needed.
  765. X
  766. XAs usual, 'root' and 'security' clearances require the corresponding power to
  767. Xbe held or the appropriate password.
  768. X
  769. XEXAMPLE
  770. X
  771. X    setauth root root-password
  772. X    ram@acri.fr
  773. X    EOF
  774. X!NO!SUBS!
  775. Xchmod 644 setauth
  776. END_OF_FILE
  777.   if test 1583 -ne `wc -c <'agent/files/help/setauth.SH'`; then
  778.     echo shar: \"'agent/files/help/setauth.SH'\" unpacked with wrong size!
  779.   fi
  780.   chmod +x 'agent/files/help/setauth.SH'
  781.   # end of 'agent/files/help/setauth.SH'
  782. fi
  783. if test -f 'agent/filter/environ.h' -a "${1}" != "-c" ; then 
  784.   echo shar: Will not clobber existing file \"'agent/filter/environ.h'\"
  785. else
  786.   echo shar: Extracting \"'agent/filter/environ.h'\" \(1459 characters\)
  787.   sed "s/^X//" >'agent/filter/environ.h' <<'END_OF_FILE'
  788. X/*
  789. X
  790. X ######  #    #  #    #     #    #####    ####   #    #          #    #
  791. X #       ##   #  #    #     #    #    #  #    #  ##   #          #    #
  792. X #####   # #  #  #    #     #    #    #  #    #  # #  #          ######
  793. X #       #  # #  #    #     #    #####   #    #  #  # #   ###    #    #
  794. X #       #   ##   #  #      #    #   #   #    #  #   ##   ###    #    #
  795. X ######  #    #    ##       #    #    #   ####   #    #   ###    #    #
  796. X
  797. X    Declarations for envrironment routines.
  798. X*/
  799. X
  800. X/*
  801. X * $Id: environ.h,v 3.0 1993/11/29 13:48:08 ram Exp ram $
  802. X *
  803. X *  Copyright (c) 1990-1993, Raphael Manfredi
  804. X *  
  805. X *  You may redistribute only under the terms of the Artistic License,
  806. X *  as specified in the README file that comes with the distribution.
  807. X *  You may reuse parts of this distribution only within the terms of
  808. X *  that same Artistic License; a copy of which may be found at the root
  809. X *  of the source tree for mailagent 3.0.
  810. X *
  811. X * $Log: environ.h,v $
  812. X * Revision 3.0  1993/11/29  13:48:08  ram
  813. X * Baseline for mailagent 3.0 netwide release.
  814. X *
  815. X */
  816. X
  817. X#ifndef _environ_h_
  818. X#define _environ_h_
  819. X
  820. Xextern void print_env();            /* Print the environment */
  821. Xextern void init_env();                /* Initializes the environment table */
  822. Xextern char **make_env();            /* Make a new system environment */
  823. Xextern int append_env();            /* Append value to environment */
  824. Xextern int prepend_env();            /* Prepend value to environment */
  825. Xextern int set_env();                /* Set environment value */
  826. X
  827. X#endif
  828. END_OF_FILE
  829.   if test 1459 -ne `wc -c <'agent/filter/environ.h'`; then
  830.     echo shar: \"'agent/filter/environ.h'\" unpacked with wrong size!
  831.   fi
  832.   # end of 'agent/filter/environ.h'
  833. fi
  834. if test -f 'agent/filter/logfile.h' -a "${1}" != "-c" ; then 
  835.   echo shar: Will not clobber existing file \"'agent/filter/logfile.h'\"
  836. else
  837.   echo shar: Extracting \"'agent/filter/logfile.h'\" \(1501 characters\)
  838.   sed "s/^X//" >'agent/filter/logfile.h' <<'END_OF_FILE'
  839. X/*
  840. X
  841. X #        ####    ####   ######     #    #       ######          #    #
  842. X #       #    #  #    #  #          #    #       #               #    #
  843. X #       #    #  #       #####      #    #       #####           ######
  844. X #       #    #  #  ###  #          #    #       #        ###    #    #
  845. X #       #    #  #    #  #          #    #       #        ###    #    #
  846. X ######   ####    ####   #          #    ######  ######   ###    #    #
  847. X
  848. X    Declarations for logging.
  849. X*/
  850. X
  851. X/*
  852. X * $Id: logfile.h,v 3.0 1993/11/29 13:48:15 ram Exp ram $
  853. X *
  854. X *  Copyright (c) 1990-1993, Raphael Manfredi
  855. X *  
  856. X *  You may redistribute only under the terms of the Artistic License,
  857. X *  as specified in the README file that comes with the distribution.
  858. X *  You may reuse parts of this distribution only within the terms of
  859. X *  that same Artistic License; a copy of which may be found at the root
  860. X *  of the source tree for mailagent 3.0.
  861. X *
  862. X * $Log: logfile.h,v $
  863. X * Revision 3.0  1993/11/29  13:48:15  ram
  864. X * Baseline for mailagent 3.0 netwide release.
  865. X *
  866. X */
  867. X
  868. X#ifndef _logfile_h_
  869. X#define _logfile_h_
  870. X
  871. X#include "config.h"
  872. X
  873. X/* Routine defined by logging package */
  874. Xextern void add_log();            /* Add logging message */
  875. Xextern int open_log();            /* Open logging file */
  876. Xextern void close_log();        /* Close logging file */
  877. Xextern void set_loglvl();        /* Set logging level */
  878. X
  879. X/* The following need to be set externally but are defined here */
  880. Xextern char *progname;            /* Program name */
  881. Xextern Pid_t progpid;            /* Program PID */
  882. X
  883. X#endif
  884. X
  885. END_OF_FILE
  886.   if test 1501 -ne `wc -c <'agent/filter/logfile.h'`; then
  887.     echo shar: \"'agent/filter/logfile.h'\" unpacked with wrong size!
  888.   fi
  889.   # end of 'agent/filter/logfile.h'
  890. fi
  891. if test -f 'agent/filter/portable.h' -a "${1}" != "-c" ; then 
  892.   echo shar: Will not clobber existing file \"'agent/filter/portable.h'\"
  893. else
  894.   echo shar: Extracting \"'agent/filter/portable.h'\" \(1604 characters\)
  895.   sed "s/^X//" >'agent/filter/portable.h' <<'END_OF_FILE'
  896. X/*
  897. X
  898. X #####    ####   #####    #####    ##    #####   #       ######          #    #
  899. X #    #  #    #  #    #     #     #  #   #    #  #       #               #    #
  900. X #    #  #    #  #    #     #    #    #  #####   #       #####           ######
  901. X #####   #    #  #####      #    ######  #    #  #       #        ###    #    #
  902. X #       #    #  #   #      #    #    #  #    #  #       #        ###    #    #
  903. X #        ####   #    #     #    #    #  #####   ######  ######   ###    #    #
  904. X
  905. X    Some portable declarations.
  906. X*/
  907. X
  908. X/*
  909. X * $Id: portable.h,v 3.0 1993/11/29 13:48:20 ram Exp ram $
  910. X *
  911. X *  Copyright (c) 1990-1993, Raphael Manfredi
  912. X *  
  913. X *  You may redistribute only under the terms of the Artistic License,
  914. X *  as specified in the README file that comes with the distribution.
  915. X *  You may reuse parts of this distribution only within the terms of
  916. X *  that same Artistic License; a copy of which may be found at the root
  917. X *  of the source tree for mailagent 3.0.
  918. X *
  919. X * $Log: portable.h,v $
  920. X * Revision 3.0  1993/11/29  13:48:20  ram
  921. X * Baseline for mailagent 3.0 netwide release.
  922. X *
  923. X */
  924. X
  925. X#ifndef _portable_h_
  926. X#define _portable_h_
  927. X
  928. X/*
  929. X * Standard types
  930. X */
  931. X#if INTSIZE < 4
  932. Xtypedef int int16;
  933. Xtypedef long int32;
  934. Xtypedef unsigned int uint16;
  935. Xtypedef unsigned long uint32;
  936. X#else
  937. Xtypedef short int16;
  938. Xtypedef int int32;
  939. Xtypedef unsigned short uint16;
  940. Xtypedef unsigned int uint32;
  941. X#endif
  942. X
  943. X/*
  944. X * Scope control pseudo-keywords
  945. X */
  946. X#define public                /* default C scope */
  947. X#define private static        /* static outside a block means private */
  948. X#define shared                /* data shared between modules, but not public */
  949. X
  950. X#endif
  951. END_OF_FILE
  952.   if test 1604 -ne `wc -c <'agent/filter/portable.h'`; then
  953.     echo shar: \"'agent/filter/portable.h'\" unpacked with wrong size!
  954.   fi
  955.   # end of 'agent/filter/portable.h'
  956. fi
  957. if test -f 'agent/pl/period.pl' -a "${1}" != "-c" ; then 
  958.   echo shar: Will not clobber existing file \"'agent/pl/period.pl'\"
  959. else
  960.   echo shar: Extracting \"'agent/pl/period.pl'\" \(1611 characters\)
  961.   sed "s/^X//" >'agent/pl/period.pl' <<'END_OF_FILE'
  962. X;# $Id: period.pl,v 3.0 1993/11/29 13:49:05 ram Exp ram $
  963. X;#
  964. X;#  Copyright (c) 1990-1993, Raphael Manfredi
  965. X;#  
  966. X;#  You may redistribute only under the terms of the Artistic License,
  967. X;#  as specified in the README file that comes with the distribution.
  968. X;#  You may reuse parts of this distribution only within the terms of
  969. X;#  that same Artistic License; a copy of which may be found at the root
  970. X;#  of the source tree for mailagent 3.0.
  971. X;#
  972. X;# $Log: period.pl,v $
  973. X;# Revision 3.0  1993/11/29  13:49:05  ram
  974. X;# Baseline for mailagent 3.0 netwide release.
  975. X;#
  976. X;# 
  977. X# Compute the number of seconds in the period. An atomic period is a digit
  978. X# possibly followed by a modifier. The default modifier is 'd'.
  979. X# Here are the available modifiers (case is significant):
  980. X#  m  minute
  981. X#  h  hour
  982. X#  d  day
  983. X#  w  week
  984. X#  M  month (30 days of 24 hours)
  985. X#  y  year
  986. Xsub seconds_in_period {
  987. X    local($_) = @_;                # The string to parse
  988. X    s|^(\d+)||;
  989. X    local ($number) = int($1);    # Number of elementary periods
  990. X    $_ = 'd' unless /^\s*\w$/;    # Period modifier (defaults to day)
  991. X    local($sec);                # Number of seconds in an atomic period
  992. X    if ($_ eq 'm') {
  993. X        $sec = 60;                # One minute = 60 seconds
  994. X    } elsif ($_ eq 'h') {
  995. X        $sec = 3600;            # One hour = 3600 seconds
  996. X    } elsif ($_ eq 'd') {
  997. X        $sec = 86400;            # One day = 24 hours
  998. X    } elsif ($_ eq 'w') {
  999. X        $sec = 604800;            # One week = 7 days
  1000. X    } elsif ($_ eq 'M') {
  1001. X        $sec = 2592000;            # One month = 30 days
  1002. X    } elsif ($_ eq 'y') {
  1003. X        $sec = 31536000;        # One year = 365 days
  1004. X    } else {
  1005. X        $sec = 86400;            # Unrecognized: defaults to one day
  1006. X    }
  1007. X    $number * $sec;                # Number of seconds in the period
  1008. X}
  1009. X
  1010. END_OF_FILE
  1011.   if test 1611 -ne `wc -c <'agent/pl/period.pl'`; then
  1012.     echo shar: \"'agent/pl/period.pl'\" unpacked with wrong size!
  1013.   fi
  1014.   # end of 'agent/pl/period.pl'
  1015. fi
  1016. if test -f 'agent/test/cmd/apply.t' -a "${1}" != "-c" ; then 
  1017.   echo shar: Will not clobber existing file \"'agent/test/cmd/apply.t'\"
  1018. else
  1019.   echo shar: Extracting \"'agent/test/cmd/apply.t'\" \(1475 characters\)
  1020.   sed "s/^X//" >'agent/test/cmd/apply.t' <<'END_OF_FILE'
  1021. X# Test APPLY command
  1022. X
  1023. X# $Id: apply.t,v 3.0 1993/11/29 13:49:26 ram Exp ram $
  1024. X#
  1025. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1026. X#  
  1027. X#  You may redistribute only under the terms of the Artistic License,
  1028. X#  as specified in the README file that comes with the distribution.
  1029. X#  You may reuse parts of this distribution only within the terms of
  1030. X#  that same Artistic License; a copy of which may be found at the root
  1031. X#  of the source tree for mailagent 3.0.
  1032. X#
  1033. X# $Log: apply.t,v $
  1034. X# Revision 3.0  1993/11/29  13:49:26  ram
  1035. X# Baseline for mailagent 3.0 netwide release.
  1036. X#
  1037. X
  1038. Xdo '../pl/cmd.pl';
  1039. Xunlink 'apply.1', 'apply.2', 'never', 'always';
  1040. X
  1041. Xopen(RULES, ">apply.1") || print "1\n";
  1042. Xprint RULES <<'EOR';
  1043. X# Make sure there is no side effect with calling environment
  1044. X<INITIAL> To: ram
  1045. X    {
  1046. X        BEGIN OTHER;
  1047. X        APPLY apply.2;
  1048. X        REJECT -f;
  1049. X        BEGIN IMPOSSIBLE
  1050. X    };
  1051. X# This one will be called recursively from apply.2
  1052. X<APPLY_2>            { ABORT };
  1053. X{ SAVE never };
  1054. XEOR
  1055. Xclose RULES;
  1056. X
  1057. Xopen(RULES, ">apply.2") || print "2\n";
  1058. Xprint RULES <<'EOR';
  1059. X# We are in OTHER mode when called from apply.1
  1060. X<OTHER>        { SAVE always; BEGIN APPLY_2; APPLY apply.1; REJECT -t };
  1061. X# Called from main 'actions' file.
  1062. X<APPLY>        { SAVE always };
  1063. X{ SAVE never };
  1064. XEOR
  1065. Xclose RULES;
  1066. X
  1067. X&add_header('X-Tag: apply');
  1068. X`$cmd`;
  1069. X$? == 0 || print "3\n";
  1070. X-f "$user" && print "4\n";
  1071. X-f 'never' && print "5\n";
  1072. X&get_log(6, 'always');
  1073. X&check_log('^To: ram', 7) == 3 || print "8\n";
  1074. X
  1075. Xunlink 'mail', 'apply.1', 'apply.2', 'never', 'always';
  1076. Xprint "0\n";
  1077. END_OF_FILE
  1078.   if test 1475 -ne `wc -c <'agent/test/cmd/apply.t'`; then
  1079.     echo shar: \"'agent/test/cmd/apply.t'\" unpacked with wrong size!
  1080.   fi
  1081.   # end of 'agent/test/cmd/apply.t'
  1082. fi
  1083. if test -f 'agent/test/cmd/forward.t' -a "${1}" != "-c" ; then 
  1084.   echo shar: Will not clobber existing file \"'agent/test/cmd/forward.t'\"
  1085. else
  1086.   echo shar: Extracting \"'agent/test/cmd/forward.t'\" \(1515 characters\)
  1087.   sed "s/^X//" >'agent/test/cmd/forward.t' <<'END_OF_FILE'
  1088. X# Test FORWARD command
  1089. X
  1090. X# $Id: forward.t,v 3.0 1993/11/29 13:49:31 ram Exp ram $
  1091. X#
  1092. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1093. X#  
  1094. X#  You may redistribute only under the terms of the Artistic License,
  1095. X#  as specified in the README file that comes with the distribution.
  1096. X#  You may reuse parts of this distribution only within the terms of
  1097. X#  that same Artistic License; a copy of which may be found at the root
  1098. X#  of the source tree for mailagent 3.0.
  1099. X#
  1100. X# $Log: forward.t,v $
  1101. X# Revision 3.0  1993/11/29  13:49:31  ram
  1102. X# Baseline for mailagent 3.0 netwide release.
  1103. X#
  1104. X
  1105. Xdo '../pl/cmd.pl';
  1106. Xdo '../pl/mta.pl';
  1107. X
  1108. X&add_header('X-Tag: forward 1');
  1109. X`$cmd`;
  1110. X$? == 0 || print "1\n";
  1111. X-f "$user" && print "2\n";        # Mail not saved
  1112. X&get_log(4, 'send.mail');
  1113. X&check_log('^Resent-', 5) == 2 || print "6\n";
  1114. X&check_log('^Resent-To: nobody', 7) == 1 || print "8\n";
  1115. X&check_log('^To: ram', 9) == 1 || print "10\n";
  1116. X&check_log('^Recipients: nobody$', 11) == 1 || print "12\n";
  1117. X
  1118. Xopen(LIST, '>list') || print "13\n";
  1119. Xprint LIST <<EOM;
  1120. Xfirst
  1121. X# comment
  1122. Xsecond
  1123. Xthird
  1124. XEOM
  1125. Xclose LIST;
  1126. X
  1127. X&replace_header('X-Tag: forward 2');
  1128. Xunlink 'send.mail';
  1129. X`$cmd`;
  1130. X$? == 0 || print "14\n";
  1131. X-f "$user" && print "15\n";        # Mail not saved
  1132. X&get_log(16, 'send.mail');
  1133. X&check_log('^Resent-', 17) == 2 || print "18\n";
  1134. X&check_log('^Resent-To: first, second, third$', 19) == 1 || print "20\n";
  1135. X&check_log('^To: ram', 21) == 1 || print "22\n";
  1136. X&check_log('^Recipients: first second third$', 23) == 1 || print "24\n";
  1137. X
  1138. X&clear_mta;
  1139. Xunlink 'mail', 'list';
  1140. Xprint "0\n";
  1141. END_OF_FILE
  1142.   if test 1515 -ne `wc -c <'agent/test/cmd/forward.t'`; then
  1143.     echo shar: \"'agent/test/cmd/forward.t'\" unpacked with wrong size!
  1144.   fi
  1145.   # end of 'agent/test/cmd/forward.t'
  1146. fi
  1147. if test -f 'agent/test/cmd/leave.t' -a "${1}" != "-c" ; then 
  1148.   echo shar: Will not clobber existing file \"'agent/test/cmd/leave.t'\"
  1149. else
  1150.   echo shar: Extracting \"'agent/test/cmd/leave.t'\" \(1763 characters\)
  1151.   sed "s/^X//" >'agent/test/cmd/leave.t' <<'END_OF_FILE'
  1152. X# Test LEAVE command
  1153. X
  1154. X# $Id: leave.t,v 3.0 1993/11/29 13:49:33 ram Exp ram $
  1155. X#
  1156. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1157. X#  
  1158. X#  You may redistribute only under the terms of the Artistic License,
  1159. X#  as specified in the README file that comes with the distribution.
  1160. X#  You may reuse parts of this distribution only within the terms of
  1161. X#  that same Artistic License; a copy of which may be found at the root
  1162. X#  of the source tree for mailagent 3.0.
  1163. X#
  1164. X# $Log: leave.t,v $
  1165. X# Revision 3.0  1993/11/29  13:49:33  ram
  1166. X# Baseline for mailagent 3.0 netwide release.
  1167. X#
  1168. X
  1169. Xdo '../pl/cmd.pl';
  1170. X
  1171. X&add_header('X-Tag: leave');
  1172. X`$cmd`;
  1173. X$? == 0 || print "1\n";
  1174. X-f "$user" || print "2\n";        # Mail saved here by default
  1175. X
  1176. X# When mailbox protected against writing...
  1177. Xunlink <emerg/*>;
  1178. X$size = -s "$user";
  1179. Xchmod 0444, "$user";
  1180. X`$cmd`;
  1181. X$? == 0 || print "3\n";
  1182. X-f "$user" || print "4\n";                # Must still be there
  1183. X$size == -s "$user" || print "5\n";        # And not altered
  1184. X@emerg = <emerg/*>;
  1185. X@emerg == 1 || print "6\n";                # Emeregency as LEAVE failed
  1186. X
  1187. X# There is no X-Filter mail in the emergency saving
  1188. X`grep -v X-Filter: $user > ok`;
  1189. X$? == 0 || print "7\n";
  1190. X-s $emerg[0] eq -s 'ok' || print "8\n";    # Full mail saved, of course
  1191. X
  1192. X# Make sure From within body is escaped if preceded by blank line
  1193. X&add_header("\nFrom mailagent");        # In effect adds an EOH
  1194. X&add_body(<<'NEW');
  1195. XThe following introduces a leading
  1196. XFrom line NOT preceded by a blank line
  1197. X
  1198. XFrom my point of view,
  1199. Xthe preceding should be escaped.
  1200. XNEW
  1201. Xunlink "$user";
  1202. X`$cmd`;
  1203. X$? == 0 || print "9\n";
  1204. X-f "$user" || print "10\n";                # Must still be there
  1205. X&get_log(11, $user);
  1206. X&check_log('^>From', 12) == 2 || print "13\n";
  1207. X&check_log('^From line', 14) == 1 || print "15\n";
  1208. X
  1209. Xunlink <emerg/*>;
  1210. Xunlink "$user", 'mail', 'ok';
  1211. Xprint "0\n";
  1212. END_OF_FILE
  1213.   if test 1763 -ne `wc -c <'agent/test/cmd/leave.t'`; then
  1214.     echo shar: \"'agent/test/cmd/leave.t'\" unpacked with wrong size!
  1215.   fi
  1216.   # end of 'agent/test/cmd/leave.t'
  1217. fi
  1218. if test -f 'agent/test/cmd/notify.t' -a "${1}" != "-c" ; then 
  1219.   echo shar: Will not clobber existing file \"'agent/test/cmd/notify.t'\"
  1220. else
  1221.   echo shar: Extracting \"'agent/test/cmd/notify.t'\" \(1563 characters\)
  1222.   sed "s/^X//" >'agent/test/cmd/notify.t' <<'END_OF_FILE'
  1223. X# Test NOTIFY command
  1224. X
  1225. X# $Id: notify.t,v 3.0 1993/11/29 13:49:36 ram Exp ram $
  1226. X#
  1227. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1228. X#  
  1229. X#  You may redistribute only under the terms of the Artistic License,
  1230. X#  as specified in the README file that comes with the distribution.
  1231. X#  You may reuse parts of this distribution only within the terms of
  1232. X#  that same Artistic License; a copy of which may be found at the root
  1233. X#  of the source tree for mailagent 3.0.
  1234. X#
  1235. X# $Log: notify.t,v $
  1236. X# Revision 3.0  1993/11/29  13:49:36  ram
  1237. X# Baseline for mailagent 3.0 netwide release.
  1238. X#
  1239. X
  1240. Xdo '../pl/cmd.pl';
  1241. Xdo '../pl/mta.pl';
  1242. X
  1243. Xopen(MSG, '>msg') || print "1\n";
  1244. Xprint MSG <<EOM;
  1245. XOrganization: Public Domain Software, Earth, Milkway.
  1246. X
  1247. XSent by %n.
  1248. XEOM
  1249. Xclose MSG;
  1250. X
  1251. X&add_header('X-Tag: notify 1');
  1252. X`$cmd`;
  1253. X$? == 0 || print "2\n";
  1254. X-f "$user" && print "3\n";        # Mail not saved
  1255. X&get_log(4, 'send.mail');
  1256. X&check_log('^$', 5) == 1 || print "6\n";
  1257. X&check_log('^Subject: Re: melting', 7) == 1 || print "8\n";
  1258. X&check_log('^Recipients: nobody$', 9) == 1 || print "10\n";
  1259. X&check_log('^Sent by compilers-request.$', 11) == 1 || print "12\n";
  1260. X
  1261. Xopen(LIST, '>list') || print "13\n";
  1262. Xprint LIST <<EOM;
  1263. Xfirst
  1264. X# comment
  1265. Xsecond
  1266. Xthird
  1267. XEOM
  1268. Xclose LIST;
  1269. X
  1270. X&replace_header('X-Tag: notify 2');
  1271. Xunlink 'send.mail';
  1272. X`$cmd`;
  1273. X$? == 0 || print "14\n";
  1274. X-f "$user" && print "15\n";        # Mail not saved
  1275. X&get_log(16, 'send.mail');
  1276. X&check_log('^To: first, second, third$', 17) == 1 || print "18\n";
  1277. X&check_log('^Recipients: first second third$', 19) == 1 || print "20\n";
  1278. X
  1279. X&clear_mta;
  1280. Xunlink 'mail', 'list', 'msg';
  1281. Xprint "0\n";
  1282. END_OF_FILE
  1283.   if test 1563 -ne `wc -c <'agent/test/cmd/notify.t'`; then
  1284.     echo shar: \"'agent/test/cmd/notify.t'\" unpacked with wrong size!
  1285.   fi
  1286.   # end of 'agent/test/cmd/notify.t'
  1287. fi
  1288. if test -f 'agent/test/cmd/save.t' -a "${1}" != "-c" ; then 
  1289.   echo shar: Will not clobber existing file \"'agent/test/cmd/save.t'\"
  1290. else
  1291.   echo shar: Extracting \"'agent/test/cmd/save.t'\" \(1670 characters\)
  1292.   sed "s/^X//" >'agent/test/cmd/save.t' <<'END_OF_FILE'
  1293. X# The SAVE command
  1294. X
  1295. X# $Id: save.t,v 3.0 1993/11/29 13:49:48 ram Exp ram $
  1296. X#
  1297. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1298. X#  
  1299. X#  You may redistribute only under the terms of the Artistic License,
  1300. X#  as specified in the README file that comes with the distribution.
  1301. X#  You may reuse parts of this distribution only within the terms of
  1302. X#  that same Artistic License; a copy of which may be found at the root
  1303. X#  of the source tree for mailagent 3.0.
  1304. X#
  1305. X# $Log: save.t,v $
  1306. X# Revision 3.0  1993/11/29  13:49:48  ram
  1307. X# Baseline for mailagent 3.0 netwide release.
  1308. X#
  1309. X
  1310. Xdo '../pl/cmd.pl';
  1311. X$mbox = 'mbox';
  1312. X
  1313. X&add_header('X-Tag: save #1');
  1314. X`$cmd`;
  1315. X$? == 0 || print "1\n";
  1316. X-f "$mbox" || print "2\n";        # Mail saved here
  1317. X-f "$user" && print "3\n";        # Must not exist (yet)
  1318. X
  1319. X# When mailbox protected against writing...
  1320. Xunlink <emerg/*>;
  1321. X$size = -s "$mbox";
  1322. Xchmod 0444, "$mbox";
  1323. X`$cmd`;
  1324. X$? == 0 || print "4\n";
  1325. X-f "$mbox" || print "5\n";                # Must still be there
  1326. X$size == -s "$mbox" || print "6\n";        # And not altered
  1327. X@emerg = <emerg/*>;
  1328. X@emerg == 1 || print "7\n";                # Emeregency as SAVE failed
  1329. X-f "$user" || print "8\n";                # Not saved -> leave in mbox
  1330. X-s "$user" == -s "$mbox" || print "9\n";
  1331. X
  1332. X# There is no X-Filter mail in the emergency saving
  1333. X`grep -v X-Filter: $mbox > ok`;
  1334. X$? == 0 || print "10\n";
  1335. X-s $emerg[0] eq -s 'ok' || print "11\n";    # Full mail saved, of course
  1336. Xunlink "$mbox", "$user";
  1337. X
  1338. X# Make sure SAVE creates full path when needed
  1339. X&replace_header('X-Tag: save #2');
  1340. X`rm -rf path` if -d 'path';
  1341. X`$cmd`;
  1342. X$? == 0 || print "12\n";
  1343. X-f 'path/another/third/mbox' || print "13\n";
  1344. X
  1345. X`rm -rf path` if -d 'path';
  1346. Xunlink <emerg/*>;
  1347. Xunlink "$mbox", "$user", 'mail', 'ok';
  1348. Xprint "0\n";
  1349. END_OF_FILE
  1350.   if test 1670 -ne `wc -c <'agent/test/cmd/save.t'`; then
  1351.     echo shar: \"'agent/test/cmd/save.t'\" unpacked with wrong size!
  1352.   fi
  1353.   # end of 'agent/test/cmd/save.t'
  1354. fi
  1355. if test -f 'agent/test/cmd/vacation.t' -a "${1}" != "-c" ; then 
  1356.   echo shar: Will not clobber existing file \"'agent/test/cmd/vacation.t'\"
  1357. else
  1358.   echo shar: Extracting \"'agent/test/cmd/vacation.t'\" \(1477 characters\)
  1359.   sed "s/^X//" >'agent/test/cmd/vacation.t' <<'END_OF_FILE'
  1360. X# The VACATION command
  1361. X
  1362. X# $Id: vacation.t,v 3.0 1993/11/29 13:49:55 ram Exp ram $
  1363. X#
  1364. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1365. X#  
  1366. X#  You may redistribute only under the terms of the Artistic License,
  1367. X#  as specified in the README file that comes with the distribution.
  1368. X#  You may reuse parts of this distribution only within the terms of
  1369. X#  that same Artistic License; a copy of which may be found at the root
  1370. X#  of the source tree for mailagent 3.0.
  1371. X#
  1372. X# $Log: vacation.t,v $
  1373. X# Revision 3.0  1993/11/29  13:49:55  ram
  1374. X# Baseline for mailagent 3.0 netwide release.
  1375. X#
  1376. X
  1377. Xdo '../pl/misc.pl';
  1378. Xdo '../pl/mta.pl';
  1379. Xunlink $user, 'dbr/c/o';
  1380. X
  1381. X&add_option("-o 'vacation: ON' -o 'user: ram'");
  1382. X
  1383. Xopen(VACATION, '>.vacation') || print "1\n";
  1384. Xprint VACATION <<EOM;
  1385. XOrganization: Public Domain Software, Earth, Milkway.
  1386. X
  1387. XSent by %n.
  1388. XEOM
  1389. Xclose VACATION;
  1390. X
  1391. X&add_header('X-Tag: vacation');    # No match in actions...
  1392. X`$cmd`;
  1393. X$? == 0 || print "2\n";
  1394. X-f "$user" || print "3\n";        # Mail not saved
  1395. X&get_log(4, 'send.mail');
  1396. X&check_log('^$', 5) == 1 || print "6\n";
  1397. X&check_log('^Subject: Re: melting', 7) == 1 || print "8\n";
  1398. X&check_log('^Recipients: compilers-request@iecc', 9) == 1 || print "10\n";
  1399. X&check_log('^Sent by compilers-request.$', 11) == 1 || print "12\n";
  1400. X
  1401. Xunlink 'send.mail', $user;
  1402. X`$cmd`;                            # This time, no vacation message
  1403. X$? == 0 || print "13\n";
  1404. X-f "$user" || print "14\n";        # Mail not saved
  1405. X-f 'send.mail' && print "15\n";
  1406. X
  1407. X&clear_mta;
  1408. Xunlink 'mail', '.vacation';
  1409. Xprint "0\n";
  1410. END_OF_FILE
  1411.   if test 1477 -ne `wc -c <'agent/test/cmd/vacation.t'`; then
  1412.     echo shar: \"'agent/test/cmd/vacation.t'\" unpacked with wrong size!
  1413.   fi
  1414.   # end of 'agent/test/cmd/vacation.t'
  1415. fi
  1416. if test -f 'agent/test/filter/range.t' -a "${1}" != "-c" ; then 
  1417.   echo shar: Will not clobber existing file \"'agent/test/filter/range.t'\"
  1418. else
  1419.   echo shar: Extracting \"'agent/test/filter/range.t'\" \(1578 characters\)
  1420.   sed "s/^X//" >'agent/test/filter/range.t' <<'END_OF_FILE'
  1421. X# Test range selection
  1422. X
  1423. X# $Id: range.t,v 3.0 1993/11/29 13:50:05 ram Exp ram $
  1424. X#
  1425. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1426. X#  
  1427. X#  You may redistribute only under the terms of the Artistic License,
  1428. X#  as specified in the README file that comes with the distribution.
  1429. X#  You may reuse parts of this distribution only within the terms of
  1430. X#  that same Artistic License; a copy of which may be found at the root
  1431. X#  of the source tree for mailagent 3.0.
  1432. X#
  1433. X# $Log: range.t,v $
  1434. X# Revision 3.0  1993/11/29  13:50:05  ram
  1435. X# Baseline for mailagent 3.0 netwide release.
  1436. X#
  1437. X
  1438. Xdo '../pl/filter.pl';
  1439. Xunlink 'never', 'never.2', 'never.3', 'never.4', 'never.5', 'never.6',
  1440. X    'always', 'always.2', 'always.3', 'always.4', 'always.5', 'always.6',
  1441. X    'always.7', 'always.8';
  1442. X
  1443. X&add_header('Cc: ram@acri.fr, must@yes.com, made@no.com');
  1444. X&add_header('X-Tag: range');
  1445. X`$cmd`;
  1446. X$? == 0 || print "1\n";
  1447. X-f "$user" && print "2\n";        # Mail has been saved correctly
  1448. X-f 'never' && print "3\n";        # Never(s) cannot match
  1449. X-f 'never.2' && print "4\n";
  1450. X-f 'never.3' && print "5\n";
  1451. X-f 'never.4' && print "6\n";
  1452. X-f 'always' || print "7\n";        # Always must match
  1453. X-f 'always.2' || print "8\n";
  1454. X-f 'always.3' || print "9\n";
  1455. X-f 'always.4' || print "10\n";
  1456. X-f 'always.5' || print "11\n";
  1457. X-f 'always.6' || print "12\n";
  1458. X-f 'always.7' || print "13\n";
  1459. X-f 'always.8' || print "14\n";
  1460. X-f 'never.5' && print "15\n";
  1461. X-f 'never.6' && print "16\n";
  1462. X
  1463. Xunlink 'never', 'never.2', 'never.3', 'never.4', 'never.5', 'never.6',
  1464. X    'always', 'always.2', 'always.3', 'always.4', 'always.5', 'always.6',
  1465. X    'always.7', 'always.8';
  1466. Xprint "0\n";
  1467. END_OF_FILE
  1468.   if test 1578 -ne `wc -c <'agent/test/filter/range.t'`; then
  1469.     echo shar: \"'agent/test/filter/range.t'\" unpacked with wrong size!
  1470.   fi
  1471.   # end of 'agent/test/filter/range.t'
  1472. fi
  1473. if test -f 'agent/test/mail' -a "${1}" != "-c" ; then 
  1474.   echo shar: Will not clobber existing file \"'agent/test/mail'\"
  1475. else
  1476.   echo shar: Extracting \"'agent/test/mail'\" \(1620 characters\)
  1477.   sed "s/^X//" >'agent/test/mail' <<'END_OF_FILE'
  1478. XFrom compilers-request@iecc.cambridge.ma.us Sun Jul 12 14:45:54 PDT 1992
  1479. XReceived: from eiffel.eiffel.com by lyon.eiffel.com (5.61/1.34)
  1480. X    id AA13012; Thu, 2 Jul 92 22:34:10 -0700
  1481. XReceived: from uunet.UUCP by eiffel.eiffel.com (4.0/SMI-4.0)
  1482. X    id AA09695; Thu, 2 Jul 92 22:31:36 PDT
  1483. XReceived: from ursa-major.spdcc.com by relay2.UU.NET with SMTP 
  1484. X    (5.61/UUNET-internet-primary) id AA21794; Fri, 3 Jul 92 01:17:38 -0400
  1485. XReceived: by ursa-major.spdcc.com with sendmail-5.65/4.7 
  1486. X    id <AA13205@ursa-major.spdcc.com>; Fri, 3 Jul 92 01:17:34 -0400
  1487. XReceived: by iecc.cambridge.ma.us (smail2.5+)
  1488. X    id AA04311; 3 Jul 92 00:43:22 EDT (Fri)
  1489. XTo: ram@eiffel.com
  1490. XFrom: compilers-request@iecc.cambridge.ma.us
  1491. XSubject: Re: melting ice technology?
  1492. XDate: 3 Jul 92 00:43:22 EDT (Fri)
  1493. XMessage-Id: <9207030043.AA04311@iecc.cambridge.ma.us>
  1494. X
  1495. XYour message to the moderated usenet group comp.compilers has been
  1496. Xreceived.  Within a few days, it should either be posted to usenet or, if
  1497. Xfor some reason it's not suitable for posting, returned to you.
  1498. X
  1499. XWhen you send a message to comp.compilers, I understand that to mean that
  1500. Xyou want me to post it to usenet, which means it will be sent to tens of
  1501. Xthousands of potential readers at thousands of computers all around the
  1502. Xworld.  It may also appear in a printed comp.compilers annual and other
  1503. Xbooks, in the ACM SIGPLAN Notices and other magazines, in on-line and
  1504. Xoff-line archives, CD-ROMs, and anywhere else that some reader decides to
  1505. Xuse it.
  1506. X
  1507. XIf you don't want me to post something, please send it instead to
  1508. Xcompilers-request@iecc.cambridge.ma.us.
  1509. X
  1510. XRegards,
  1511. XJohn Levine, comp.compilers moderator
  1512. END_OF_FILE
  1513.   if test 1620 -ne `wc -c <'agent/test/mail'`; then
  1514.     echo shar: \"'agent/test/mail'\" unpacked with wrong size!
  1515.   fi
  1516.   # end of 'agent/test/mail'
  1517. fi
  1518. if test -f 'agent/test/option/e.t' -a "${1}" != "-c" ; then 
  1519.   echo shar: Will not clobber existing file \"'agent/test/option/e.t'\"
  1520. else
  1521.   echo shar: Extracting \"'agent/test/option/e.t'\" \(1574 characters\)
  1522.   sed "s/^X//" >'agent/test/option/e.t' <<'END_OF_FILE'
  1523. X# -e : enter rules to be applied
  1524. X
  1525. X# $Id: e.t,v 3.0 1993/11/29 13:50:15 ram Exp ram $
  1526. X#
  1527. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1528. X#  
  1529. X#  You may redistribute only under the terms of the Artistic License,
  1530. X#  as specified in the README file that comes with the distribution.
  1531. X#  You may reuse parts of this distribution only within the terms of
  1532. X#  that same Artistic License; a copy of which may be found at the root
  1533. X#  of the source tree for mailagent 3.0.
  1534. X#
  1535. X# $Log: e.t,v $
  1536. X# Revision 3.0  1993/11/29  13:50:15  ram
  1537. X# Baseline for mailagent 3.0 netwide release.
  1538. X#
  1539. X
  1540. Xdo '../pl/init.pl';
  1541. Xdo '../pl/logfile.pl';
  1542. Xchdir '../out';
  1543. X$output = `$mailagent -e '{ OWN_RULE_1 };' -e '{OWN_RULE_2 };' -d`;
  1544. X$? == 0 || print "1\n";
  1545. X@log = split(/\n/, $output);    # want to use check_log()
  1546. X&check_log('OWN_RULE_1', 2);
  1547. X&check_log('OWN_RULE_2', 3);
  1548. X# Single rule may not be specified between {}
  1549. X$output = `$mailagent -e 'SINGLE' -d`;
  1550. X$? == 0 || print "4\n";
  1551. X$output_bis = `$mailagent -e '{ SINGLE }' -d`;
  1552. X$? == 0 || print "5\n";
  1553. X$output eq $output_bis || print "6\n";
  1554. X$output = `$mailagent -e 'SINGLE' -e '{ OTHER }' -d`;
  1555. X$? == 0 || print "7\n";
  1556. X$output_bis = `$mailagent -e '{ SINGLE };' -e '{ OTHER }' -d`;
  1557. X$? == 0 || print "8\n";
  1558. X$output ne $output_bis || print "9\n";
  1559. X@log = split(/\n/, $output);
  1560. Xgrep(/# Rule 2/, @log) && print "10\n";            # Only one rule
  1561. Xgrep(/Subject: SINGLE/, @log) || print "11\n";    # No selector -> Subject
  1562. X@log = split(/\n/, $output_bis);
  1563. Xgrep(/# Rule 2/, @log) || print "12\n";            # Two rules
  1564. Xgrep(/Subject: \*/, @log) || print "13\n";        # No pattern -> *
  1565. Xprint "0\n";
  1566. END_OF_FILE
  1567.   if test 1574 -ne `wc -c <'agent/test/option/e.t'`; then
  1568.     echo shar: \"'agent/test/option/e.t'\" unpacked with wrong size!
  1569.   fi
  1570.   # end of 'agent/test/option/e.t'
  1571. fi
  1572. if test -f 'agent/test/option/f.t' -a "${1}" != "-c" ; then 
  1573.   echo shar: Will not clobber existing file \"'agent/test/option/f.t'\"
  1574. else
  1575.   echo shar: Extracting \"'agent/test/option/f.t'\" \(1724 characters\)
  1576.   sed "s/^X//" >'agent/test/option/f.t' <<'END_OF_FILE'
  1577. X# -f: get messages from UNIX-style mailbox file
  1578. X
  1579. X# $Id: f.t,v 3.0 1993/11/29 13:50:16 ram Exp ram $
  1580. X#
  1581. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1582. X#  
  1583. X#  You may redistribute only under the terms of the Artistic License,
  1584. X#  as specified in the README file that comes with the distribution.
  1585. X#  You may reuse parts of this distribution only within the terms of
  1586. X#  that same Artistic License; a copy of which may be found at the root
  1587. X#  of the source tree for mailagent 3.0.
  1588. X#
  1589. X# $Log: f.t,v $
  1590. X# Revision 3.0  1993/11/29  13:50:16  ram
  1591. X# Baseline for mailagent 3.0 netwide release.
  1592. X#
  1593. X
  1594. Xdo '../pl/init.pl';
  1595. Xdo '../pl/logfile.pl';
  1596. Xchdir '../out';
  1597. Xunlink 'agentlog';
  1598. X$user = $ENV{'USER'};
  1599. Xunlink "$user";
  1600. Xopen(MBOX, ">mbox") || print "1\n";
  1601. Xprint MBOX <<'EOM';
  1602. XFrom ram Sat Jul 11 17:17:12 PDT 1992
  1603. XFrom: ram
  1604. XTo: ram
  1605. XSubject: test #1
  1606. X
  1607. XBody #1
  1608. XFrom ram Sat Jul 11 17:17:12 PDT 1992
  1609. XPrevious line is just a dummy From line.
  1610. X
  1611. XFrom ram Sat Jul 11 17:17:12 PDT 1992
  1612. XFrom: ram
  1613. XTo: ram
  1614. XSubject: test #2
  1615. X
  1616. XBody #2
  1617. XFrom ram Sat Jul 11 17:17:12 PDT 1992
  1618. XFrom: nearly a header!!
  1619. XPrevious 2 lines are just dummy lines.
  1620. X
  1621. XFrom ram Sat Jul 11 17:17:12 PDT 1992
  1622. XFrom: ram
  1623. XTo: ram
  1624. XSubject: test #3
  1625. X
  1626. XBody #3
  1627. XEOM
  1628. Xclose MBOX;
  1629. X`$mailagent -e 'LEAVE' -f mbox 2>/dev/null`;
  1630. X$? == 0 || print "2\n";
  1631. X-s "$user" || print "3\n";
  1632. X&get_log(4);
  1633. X@queued = grep(/QUEUED/, @log);
  1634. X@queued == 3 || print "5\n";
  1635. X@subject = grep(/ABOUT.*test/, @log);
  1636. X@subject == 3 || print "6\n";
  1637. X@filtered = grep(/FILTERED/, @log);
  1638. X@filtered == 3 || print "7\n";
  1639. X@files = <queue/*>;
  1640. X@files == 0 || print "8\n";
  1641. Xopen(MBOX, "$user") || print "9\n";
  1642. X@mbox = <MBOX>;
  1643. Xclose MBOX;
  1644. X@msg = grep(/^X-Filter:/, @mbox);
  1645. X@msg == 3 || print "10\n";
  1646. Xunlink 'agentlog', "$user", 'mbox';
  1647. Xprint "0\n";
  1648. END_OF_FILE
  1649.   if test 1724 -ne `wc -c <'agent/test/option/f.t'`; then
  1650.     echo shar: \"'agent/test/option/f.t'\" unpacked with wrong size!
  1651.   fi
  1652.   # end of 'agent/test/option/f.t'
  1653. fi
  1654. if test -f 'agent/test/option/l.t' -a "${1}" != "-c" ; then 
  1655.   echo shar: Will not clobber existing file \"'agent/test/option/l.t'\"
  1656. else
  1657.   echo shar: Extracting \"'agent/test/option/l.t'\" \(1573 characters\)
  1658.   sed "s/^X//" >'agent/test/option/l.t' <<'END_OF_FILE'
  1659. X# -l: list message queue (special)
  1660. X
  1661. X# $Id: l.t,v 3.0 1993/11/29 13:50:18 ram Exp ram $
  1662. X#
  1663. X#  Copyright (c) 1990-1993, Raphael Manfredi
  1664. X#  
  1665. X#  You may redistribute only under the terms of the Artistic License,
  1666. X#  as specified in the README file that comes with the distribution.
  1667. X#  You may reuse parts of this distribution only within the terms of
  1668. X#  that same Artistic License; a copy of which may be found at the root
  1669. X#  of the source tree for mailagent 3.0.
  1670. X#
  1671. X# $Log: l.t,v $
  1672. X# Revision 3.0  1993/11/29  13:50:18  ram
  1673. X# Baseline for mailagent 3.0 netwide release.
  1674. X#
  1675. X
  1676. Xdo '../pl/init.pl';
  1677. Xchdir '../out';
  1678. Xunlink <queue/*>;
  1679. Xopen(MBOX, ">mbox") || print "1\n";
  1680. Xprint MBOX <<'EOM';
  1681. XFrom ram Sat Jul 11 17:17:12 PDT 1992
  1682. XFrom: ram
  1683. XTo: ram
  1684. XSubject: test #1
  1685. X
  1686. XBody #1
  1687. X
  1688. XFrom ram Sat Jul 11 17:17:12 PDT 1992
  1689. XFrom: ram
  1690. XTo: ram
  1691. XSubject: test #2
  1692. X
  1693. XBody #2
  1694. X
  1695. XFrom ram Sat Jul 11 17:17:12 PDT 1992
  1696. XFrom: ram
  1697. XTo: ram
  1698. XSubject: test #3
  1699. X
  1700. XBody #3
  1701. XEOM
  1702. Xclose MBOX;
  1703. X`$mailagent -f mbox -e 'QUEUE' 2>/dev/null`;
  1704. X$? == 0 || print "2\n";
  1705. X@output = split(/\n/, $output = `$mailagent -l 2>/dev/null`);
  1706. X@files = <queue/*>;
  1707. X@files == 3 || print "3\n";    # Not a -l failure, but that will get our attention
  1708. Xforeach $file (@files) {
  1709. X    $file =~ s|^queue/||;
  1710. X    eval "grep(/$file/, \@output)" || $failed++;
  1711. X}
  1712. X$failed == 0 || print "4\n";
  1713. X# Invoking mailagent as `mailqueue' lists the queue.
  1714. Xunlink 'mailqueue';
  1715. X`ln $mailagent_path ./mailqueue 2>/dev/null`;
  1716. X$? == 0 || print "5\n";
  1717. X$output_bis = `./mailqueue 2>/dev/null`;
  1718. X$output eq $output_bis || print "6\n";
  1719. Xunlink <queue/*>, 'mbox', 'mailqueue';
  1720. Xprint "0\n";
  1721. END_OF_FILE
  1722.   if test 1573 -ne `wc -c <'agent/test/option/l.t'`; then
  1723.     echo shar: \"'agent/test/option/l.t'\" unpacked with wrong size!
  1724.   fi
  1725.   # end of 'agent/test/option/l.t'
  1726. fi
  1727. echo shar: End of archive 22 \(of 26\).
  1728. cp /dev/null ark22isdone
  1729. MISSING=""
  1730. 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
  1731.     if test ! -f ark${I}isdone ; then
  1732.     MISSING="${MISSING} ${I}"
  1733.     fi
  1734. done
  1735. if test "${MISSING}" = "" ; then
  1736.     echo You have unpacked all 26 archives.
  1737.     echo "Now run 'sh PACKNOTES', then read README and type Configure.'"
  1738.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1739. else
  1740.     echo You still must unpack the following archives:
  1741.     echo "        " ${MISSING}
  1742. fi
  1743. exit 0
  1744.  
  1745. exit 0 # Just in case...
  1746.