home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume38 / procmail / part11 < prev    next >
Text File  |  1993-07-05  |  49KB  |  1,641 lines

  1. Newsgroups: comp.sources.misc
  2. From: berg@pool.informatik.rwth-aachen.de (Stephen R. van den Berg)
  3. Subject: v38i030:  procmail - mail processing package v2.90, Part11/11
  4. Message-ID: <1993Jul1.151726.22321@sparky.imd.sterling.com>
  5. X-Md4-Signature: 57d24e9ee95c5deb649eed0ad013f5f3
  6. Sender: kent@sparky.imd.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Thu, 1 Jul 1993 15:17:26 GMT
  9. Approved: kent@sparky.imd.sterling.com
  10.  
  11. Submitted-by: berg@pool.informatik.rwth-aachen.de (Stephen R. van den Berg)
  12. Posting-number: Volume 38, Issue 30
  13. Archive-name: procmail/part11
  14. Environment: sendmail, smail, MMDF, mailsurr, UNIX, POSIX
  15. Supersedes: procmail: Volume 35, Issue 21-32,124,125
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of archive 11 (of 11)."
  24. # Contents:  procmail/examples/forward procmail/man/procmail.man
  25. #   procmail/src/autoconf
  26. # Wrapped by berg@tubastos on Thu Jul  1 14:06:19 1993
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'procmail/examples/forward' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'procmail/examples/forward'\"
  30. else
  31. echo shar: Extracting \"'procmail/examples/forward'\" \(57 characters\)
  32. sed "s/^X//" >'procmail/examples/forward' <<'END_OF_FILE'
  33. X"|IFS=' ';exec /usr/local/bin/procmail #YOUR_LOGIN_NAME"
  34. END_OF_FILE
  35. if test 57 -ne `wc -c <'procmail/examples/forward'`; then
  36.     echo shar: \"'procmail/examples/forward'\" unpacked with wrong size!
  37. fi
  38. # end of 'procmail/examples/forward'
  39. fi
  40. if test -f 'procmail/man/procmail.man' -a "${1}" != "-c" ; then 
  41.   echo shar: Will not clobber existing file \"'procmail/man/procmail.man'\"
  42. else
  43. echo shar: Extracting \"'procmail/man/procmail.man'\" \(17351 characters\)
  44. sed "s/^X//" >'procmail/man/procmail.man' <<'END_OF_FILE'
  45. X.Id $Id: procmail.man,v 1.23 1993/06/30 16:01:33 berg Exp $
  46. X.TH PROCMAIL 1 \*(Dt BuGless
  47. X.na
  48. X.SH NAME
  49. Xprocmail \- autonomous mail processor
  50. X.SH SYNOPSIS
  51. X.B procmail
  52. X.RB [ \-@PRESERVOPT@@TEMPFAILOPT@ ]
  53. X.RB [ "\-@FROMWHOPT@ \fIfromwhom\fP" ]
  54. X.RI [ "parameter\fB=\fPvalue " | " rcfile" ]
  55. X\&.\|.\|.
  56. X.br
  57. X.B procmail
  58. X.RB [ \-@PRESERVOPT@@TEMPFAILOPT@ ]
  59. X.RB [ "\-@FROMWHOPT@ \fIfromwhom\fP" ]
  60. X.RB [ "\-@ARGUMENTOPT@ \fIargument\fP" ]
  61. X.B \-@DELIVEROPT@
  62. X.I recipient
  63. X\&.\|.\|.
  64. X.br
  65. X.B procmail
  66. X.RB [ \-@PRESERVOPT@@TEMPFAILOPT@ ]
  67. X.B \-@MAILFILTOPT@
  68. X.RI [ "parameter\fB=\fPvalue" ]
  69. X\&.\|.\|.
  70. X.I rcfile mail_from rcpt_to
  71. X\&.\|.\|.
  72. X.br
  73. X.B procmail
  74. X.B \-@VERSIONOPT@
  75. X.ad
  76. X.Sh DESCRIPTION
  77. XFor a quick start, see
  78. X.B NOTES
  79. Xat the end.
  80. X.PP
  81. X.B Procmail
  82. Xshould be invoked automatically over the
  83. X.B @DOT_FORWARD@
  84. Xfile mechanism as soon as mail arrives.  Alternatively, when installed by
  85. Xa system administrator, it can be invoked from within the mailer immediately.
  86. XWhen invoked, it first sets some environment variables to default values,
  87. Xreads the mail message from stdin until an EOF, separates the body from the
  88. Xheader, and then, if no command line arguments are present, it starts to look
  89. Xfor a file named
  90. X.B @PROCMAILRC@
  91. Xin your home directory.  According to the processing recipes in this file,
  92. Xthe mail message that just arrived gets distributed into the right folder
  93. X(and more).
  94. X.PP
  95. XIf running suid root or with root privileges, procmail will be able to
  96. Xperform as a functionally enhanced, backwards compatible mail delivery agent.
  97. X.PP
  98. XProcmail can also be used as a general purpose mail filter, i.e. provisions
  99. Xhave been made to enable procmail to be invoked in a special sendmail rule.
  100. X.PP
  101. XThe rcfile format is described in detail in the
  102. X.BR procmailrc (5)
  103. Xman page.
  104. X.PP
  105. XExamples for rcfile recipes can be looked up in the
  106. X.BR procmailex (5)
  107. Xman page.
  108. X.Ss Signals
  109. X.Tp 1.2i
  110. X.B TERMINATE
  111. XTerminate prematurely and requeue the mail.
  112. X.Tp
  113. X.B HANGUP
  114. XTerminate prematurely and bounce the mail.
  115. X.Tp
  116. X.B INTERRUPT
  117. XTerminate prematurely and bounce the mail.
  118. X.Tp
  119. X.B QUIT
  120. XTerminate prematurely and silently lose the mail.
  121. X.Tp
  122. X.B ALARM
  123. XForce a timeout (see
  124. X.BR TIMEOUT).
  125. X.Sh OPTIONS
  126. X.Tp 0.5i
  127. X.B \-@VERSIONOPT@
  128. XProcmail will print its version number and exit.
  129. X.Tp
  130. X.B \-@PRESERVOPT@
  131. XPreserve any old environment.  Normally procmail clears the environment
  132. Xupon startup@KEEPENV@.  However, in any case: any default values will override
  133. Xany preexisting environment variables, i.e. procmail will not pay any attention
  134. Xto any predefined environment variables, it will happily overwrite them
  135. Xwith its own defaults.
  136. X.Tp
  137. X.B \-@TEMPFAILOPT@
  138. XMake procmail fail softly, i.e. if procmail cannot deliver the mail to
  139. Xany of the destinations you gave, the mail will not bounce, but will return
  140. Xto the mailqueue.  Another delivery-attempt will be made at some time in
  141. Xthe future.
  142. X.Tp
  143. X.I "\fB\-@FROMWHOPT@\fP fromwhom"
  144. XCauses procmail to regenerate the leading `@FROM@' line with
  145. X.I fromwhom
  146. Xas the sender (instead of \-@FROMWHOPT@ one could use the alternate and
  147. Xobsolete \-@ALTFROMWHOPT@).
  148. X.Tp
  149. X.I "\fB\-@ARGUMENTOPT@\fP argument"
  150. XThis will set $1 to be equal to
  151. X.IR argument .
  152. XIt can be used to pass meta information along to procmail.  This is
  153. Xtypically done by passing along the $@x information from the sendmail
  154. Xmailer rule.
  155. X.Tp
  156. X.I "\fB\-@DELIVEROPT@\fP recipient .\|.\|."
  157. XThis turns on explicit delivery mode, delivery will be to the local user
  158. X.IR recipient .
  159. XThis, of course, only is possible if procmail has root privileges.
  160. XProcmail will setuid to the intended recipients and shall
  161. X.I only
  162. Xread the recipient's @PROCMAILRC@ file (if present, if not, delivery is like
  163. Xordinary mail).
  164. X.Tp
  165. X.B \-@MAILFILTOPT@
  166. XTurns procmail into a general purpose mail filter.  In this mode an rcfile
  167. Xmust be specified on the command line.  You should also specify the
  168. Xenvelope sender and one or more envelope recipient addresses on the command
  169. Xline so that the mail can be transparently resent if needed.
  170. XFor some typical usage of this option you should look in the
  171. X.B EXAMPLES
  172. Xsection below.
  173. X.Sh ARGUMENTS
  174. XAny arguments containing an '=' are considered to be environment variable
  175. Xassignments, they will
  176. X.I all
  177. Xbe evaluated after the default values have been
  178. Xassigned and before the first rcfile is opened.
  179. X.PP
  180. XAny other arguments are presumed to be rcfile paths (either absolute,
  181. Xor if they start with `@chCURDIR@@MCDIRSEP@' relative to the current
  182. Xdirectory;
  183. X.B any other relative
  184. Xpath is relative to $HOME); procmail will start with the first one it finds
  185. Xon the command line.  The following ones will only be parsed if the preceding
  186. Xones have a not matching HOST-directive entry, or in case they should not
  187. Xexist.
  188. X.PP
  189. XIf no rcfiles are specified, it looks for
  190. X.BR $HOME/@PROCMAILRC@ .
  191. XIf not even that can be found, processing will continue according to
  192. Xthe default settings of the environment variables and the ones specified
  193. Xon the command line.
  194. X.Sh EXAMPLES
  195. XExamples for rcfile recipes can be looked up in the
  196. X.BR procmailex (5)
  197. Xman page.
  198. XA small sample rcfile can be found in the
  199. X.B NOTES
  200. Xsection below.
  201. X.PP
  202. XThe
  203. X.B \-@MAILFILTOPT@
  204. Xoption is typically used when procmail is called from within a rule in the
  205. Xsendmail.cf file.  In order to be able to do this it is convenient to create
  206. Xan extra `procmail' mailer in your sendmail.cf file (in addition to the perhaps
  207. Xalready present `local' mailer that starts up procmail).  To create such a
  208. X`procmail' mailer I'd suggest something like:
  209. X.Sx 2
  210. XMprocmail, P=@BINDIR@/procmail, F=mSDFMhun, S=11, R=21,
  211. X        A=procmail \-@MAILFILTOPT@ $h $u
  212. X.Ex
  213. XThis enables you to use rules like the following (most likely in ruleset 0)
  214. Xto filter mail through the procmail mailer (please note the leading tab
  215. Xto continue the rule, and the tab to separate the comments):
  216. X.Sx 4
  217. XR$*<@some.where>$*
  218. X        $#procmail $@/etc/some.rc $:$1@some.where.procmail$2
  219. XR$*<@somehost.somewhere.procmail>$*
  220. X        $1<@somehost.somewhere>$*       Already filtered, map back
  221. X.Ex
  222. XAnd /etc/some.rc could be as simple as:
  223. X.Sx 6
  224. X:0                              # sink all junk mail
  225. X* ^Subject:.*junk
  226. X/dev/null
  227. X
  228. X:0                              # pass along all other mail
  229. X! \-oi \-f "$@"
  230. X.Ex
  231. X.Sh FILES
  232. X.Tp 2.3i
  233. X.B /etc/passwd
  234. Xto set the recipient's LOGNAME, HOME and SHELL variable defaults
  235. X.Tp
  236. X.B @SYSTEM_MBOX@
  237. Xsystem mailbox
  238. X.Tp
  239. X.B $HOME/@PROCMAILRC@
  240. Xdefault rcfile
  241. X.Tp
  242. X.B @SYSTEM_MBOX@@DEFlockext@
  243. Xlockfile for the system mailbox (not used by procmail automatically, unless
  244. X$DEFAULT equals @SYSTEM_MBOX@ and procmail is delivering to $DEFAULT)
  245. X.Tp
  246. X.B @DEFsendmail@
  247. Xdefault mail forwarder
  248. X.Tp
  249. X.B @UNIQ_PREFIX@????`hostname`
  250. Xtemporary `unique' zero-length files created by procmail
  251. X.Sh "SEE ALSO"
  252. X.na
  253. X.nh
  254. X.BR procmailrc (5),
  255. X.BR procmailex (5),
  256. X.BR sh (1),
  257. X.BR csh (1),
  258. X.BR mail (1),
  259. X.BR mailx (1),
  260. X.BR binmail (1),
  261. X.BR uucp (1),
  262. X.BR aliases (5),
  263. X.BR sendmail (8),
  264. X.BR egrep (1),
  265. X.BR grep (1),
  266. X.BR biff (1),
  267. X.BR comsat (8),
  268. X.BR lockfile (1),
  269. X.BR formail (1),
  270. X.BR cron (1)
  271. X.hy
  272. X.ad
  273. X.Sh DIAGNOSTICS
  274. X.Tp 2.3i
  275. XAutoforwarding mailbox found
  276. XThe system mailbox had its suid or sgid bit set, procmail terminates with
  277. XEX_NOUSER assuming that this mailbox must not be delivered to.
  278. X.Tp
  279. XBad substitution of "x"
  280. XNot a valid environment variable name specified.
  281. X.Tp
  282. XConflicting options
  283. XNot all option combinations are useful
  284. X.Tp
  285. XCouldn't create "x"
  286. XThe system mailbox was missing and could not/will not be created.
  287. X.Tp
  288. XCouldn't determine implicit lockfile from "x"
  289. XThere were no `>>' redirectors to be found, using simply `$LOCKEXT' as
  290. Xlocallockfile.
  291. X.Tp
  292. XCouldn't unlock "x"
  293. XLockfile was already gone, or write permission to the directory were the
  294. Xlockfile is has been denied.
  295. X.Tp
  296. XDeadlock attempted on "x"
  297. XThe locallockfile specified on this recipe is equal to a still active
  298. X$LOCKFILE.
  299. X.Tp
  300. XError while writing to "x"
  301. XNonexistent subdirectory, no write permission, pipe died or disk full.
  302. X.Tp
  303. XExceeded LINEBUF
  304. XBuffer overflow detected, LINEBUF was too small, memory might be corrupted.
  305. X.Tp
  306. XExcessive output quenched from "x"
  307. XThe program or filter "x" tried to produce too much output for the current
  308. XLINEBUF, discarded the rest.
  309. X.Tp
  310. XExtraneous filter-flag ignored
  311. XYou specified the `@FILTER@'-flag on a recipe with a filename as the
  312. Xdestination, or where stdout is captured.
  313. X.Tp
  314. XFailed forking "x"
  315. XProcess table is full (and NORESRETRY has been exhausted).
  316. X.Tp
  317. XFailed to execute "x"
  318. XProgram not in path, or not executable.
  319. X.Tp
  320. XForced unlock denied on "x"
  321. XNo write permission in the directory where
  322. X.B lockfile
  323. X"x" resides, or more than one procmail trying to force a lock at exactly the
  324. Xsame time.
  325. X.Tp
  326. XForcing lock on "x"
  327. X.B Lockfile
  328. X"x" is going to be removed by force because of a timeout (see also:
  329. X.BR LOCKTIMEOUT ).
  330. X.Tp
  331. XInvalid regexp "x"
  332. XThe regular expression "x" contains errors (most likely some missing or
  333. Xextraneous parens).
  334. X.Tp
  335. XKernel-lock failed
  336. XWhile trying to use the kernel-supported locking calls, one of them failed
  337. X(usually indicates an OS error), procmail ignores this error and proceeds.
  338. X.Tp
  339. XKernel-unlock failed
  340. XSee above.
  341. X.Tp
  342. XLock failure on "x"
  343. XCan only occur if you specify some real weird (and illegal) lockfilenames
  344. Xor if the
  345. X.B lockfile
  346. Xcould not be created because of insufficient permissions or nonexistent
  347. Xsubdirectories.
  348. X.Tp
  349. XMissing name
  350. XThe \-@FROMWHOPT@ option needs an extra argument
  351. X.Tp
  352. XMissing argument
  353. XYou specified the \-@ARGUMENTOPT@ option but forgot the argument
  354. X.Tp
  355. XMissing rcfile
  356. XYou specified the \-@MAILFILTOPT@ option, procmail expects the name of an
  357. Xrcfile as argument
  358. X.Tp
  359. XMissing recipient
  360. XYou specified the \-@DELIVEROPT@ option or called procmail under a different
  361. Xname, it expects one or more recipients as arguments
  362. X.Tp
  363. XOut of memory
  364. XThe system is out of swap space (and NORESRETRY has been exhausted).
  365. X.Tp
  366. XProcessing continued
  367. XThe unrecognised options on the command line are ignored, proceeding as
  368. Xusual.
  369. X.Tp
  370. XProgram failure of "x"
  371. XProgram that was started by procmail didn't return EX_OK (=@EX_OK@).
  372. X.Tp
  373. XSkipped: "x"
  374. XCouldn't do anything with "x" in the rcfile (syntax error), ignoring it.
  375. X.Tp
  376. XSuspicious rcfile
  377. XThe owner of the rcfile was not the recipient, or the directory that contained
  378. Xit was world writeable (the rcfile was not used)
  379. X.Tp
  380. XTerminating prematurely whilst waiting for .\|.\|.
  381. XProcmail received a signal while it was waiting for .\|.\|.
  382. X.Tp
  383. XTimeout, terminating "x"
  384. XTimeout has occurred on program/filter "x".
  385. X.Tp
  386. XTruncating "x" and retrying lock
  387. X"x" does not seem to be a valid filename or the file is not empty.
  388. X.Tp
  389. XReiterating kernel-lock
  390. XWhile attempting several locking methods, one of these failed.  Procmail will
  391. Xreiterate until they all succeed in rapid succession.
  392. X.Tp
  393. XRescue of unfiltered data succeeded/failed
  394. XA filter returned unsuccessfully, procmail tried to get back the original text.
  395. X.Tp
  396. XUnexpected EOL
  397. XMissing closing quote, or trying to escape EOF.
  398. X.Tp
  399. XUnknown user "x"
  400. XThe specified recipient does not have a corresponding uid.
  401. X.Sh "EXTENDED DIAGNOSTICS"
  402. X.Tp 2.3i
  403. XAssigning "x"
  404. XEnvironment variable assignment.
  405. X.Tp
  406. XBypassed locking "x"
  407. XThe mail spool directory was not accessible to procmail, it relied solely
  408. Xon kernel locks.
  409. X.Tp
  410. XExecuting "x"
  411. XStarting program "x".  If it is started by procmail directly (without an
  412. Xintermediate shell), procmail will show where it separated the arguments
  413. Xby inserting commas.
  414. X.Tp
  415. XHOST mismatched "x"
  416. XThis host was called "x", HOST contained something else.
  417. X.Tp
  418. XLocking "x"
  419. XCreating lockfile "x".
  420. X.Tp
  421. XLinking to "x"
  422. XCreating a hardlink between directory folders.
  423. X.Tp
  424. XMatch on "x"
  425. XCondition matched.
  426. X.Tp
  427. XNo match on "x"
  428. XCondition didn't match, recipe skipped.
  429. X.Tp
  430. XNotified comsat: "$LOGNAME@offset:file"
  431. XSent comsat/biff a notice that mail arrived for user $LOGNAME at `offset'
  432. Xin `file'.
  433. X.Tp
  434. XOpening "x"
  435. XOpening file "x" for appending.
  436. X.Tp
  437. XRcfile: "x"
  438. XRcfile changed to "x".
  439. X.Tp
  440. XUnlocking "x"
  441. XRemoving lockfile "x" again.
  442. X.Sh WARNINGS
  443. XYou should create a shell script that uses
  444. X.BR lockfile (1)
  445. Xbefore invoking your mail shell on any mailbox file other than the system
  446. Xmailbox (unless of course, your mail shell uses the same lockfiles (local
  447. Xor global) you specified in your rcfile).
  448. X.PP
  449. XIn the unlikely event that you absolutely need to kill procmail before it has
  450. Xfinished, first try and use the regular kill command (i.e.
  451. X.I not
  452. Xkill -9, see the subsection
  453. X.I Signals
  454. Xfor suggestions), otherwise some
  455. X.I lockfiles
  456. Xmight not get removed.
  457. X.PP
  458. XBeware when using the
  459. X.B \-@TEMPFAILOPT@
  460. Xoption, if procmail repeatedly is unable to deliver the mail (e.g. due to
  461. Xan incorrect rcfile), the system mailqueue could fill up.  This could
  462. Xaggravate both the local postmaster and other users.
  463. X.Sh BUGS
  464. XAfter removing a lockfile by force, procmail waits $SUSPEND seconds before
  465. Xcreating a new lockfile so that another process that decides to remove the
  466. Xstale lockfile will not remove the newly created lock by mistake.
  467. X.PP
  468. XProcmail uses the regular TERMINATE signal to terminate any runaway filter,
  469. Xbut it does not check if the filter responds to that signal and it only sends
  470. Xit to the filter itself, not to any of the filter's children.
  471. X.Sh MISCELLANEOUS
  472. XWhen appending to regular mailfolders any lines in the body of the message that
  473. Xlook like postmarks are prepended with `@ESCAP@' (disarms bogus mailheaders).
  474. XThe regular expression that is used to search for these postmarks is:
  475. X.Rs
  476. X`@FROM_EXPR@'
  477. X.Re
  478. X.PP
  479. XIf the destination name used in explicit delivery mode is not in /etc/passwd,
  480. Xprocmail will proceed as if explicit delivery mode was not in effect.
  481. XIf not in explicit delivery mode and
  482. Xshould the uid procmail is running under, have no corresponding /etc/passwd
  483. Xentry, then HOME will default to @RootDir@, LOGNAME will default to #uid and
  484. XSHELL will default to @BinSh@.
  485. X.PP
  486. XWhen in explicit delivery mode, procmail will generate a leading `@FROM@'
  487. Xline if none is present.  If one is already present@TRUSTED_IDS@ procmail will
  488. Xleave it intact.
  489. X.PP
  490. XFor security reasons procmail will only use an rcfile if it is owned by the
  491. Xrecipient or if the directory it is contained in, is not world writeable.
  492. X.PP
  493. XIf @SYSTEM_MBOX@ is a bogus mailbox (i.e. does not belong to the recipient,
  494. Xis unwriteable, is a symbolic link or is a hard link), procmail will upon
  495. Xstartup try to rename it into a file starting with `@BOGUSprefix@' and
  496. Xending in an inode-sequence-code.  If this turns out to be impossible,
  497. X.B ORGMAIL
  498. Xwill have
  499. X.I no
  500. Xinitial value, and hence will inhibit delivery without a proper rcfile.
  501. X.PP
  502. XWhen delivering to directories (or to MH folders) you
  503. X.B don't
  504. Xneed to use lockfiles to prevent several concurrently running procmail
  505. Xprograms from messing up.
  506. X.PP
  507. XDelivering to MH folders is slightly more time consuming than delivering
  508. Xto normal directories or mailboxes, because procmail has to search for
  509. Xthe next available number (instead of having the filename immediately
  510. Xavailable).
  511. X.PP
  512. XOn general failure procmail will return EX_CANTCREAT, unless option
  513. X.B \-@TEMPFAILOPT@
  514. Xis specified, in which case it will return EX_TEMPFAIL.
  515. X.PP
  516. XTo make `egrepping' of headers more consistent, procmail concatenates all
  517. Xcontinued header fields; but only internally.  When delivering the mail, line
  518. Xbreaks will appear as before.
  519. X.PP
  520. XIf procmail is called under a different name than `procmail' (i.e. if it
  521. Xis linked to another name and invoked as such), it comes up in explicit
  522. Xdelivery mode, and expects the recipients' names as command line arguments
  523. X(as if \-@DELIVEROPT@ had been specified).
  524. X.PP
  525. XComsat/biff notifications are done using @COMSATprotocol@.  They are sent off
  526. Xonce when procmail generates the regular logfile entry.  The notification
  527. Xmessages have the following extended format (or as close as you can get when
  528. Xfinal delivery was not to a file):
  529. X.Rs
  530. X$LOGNAME@offset_of_message_in_mailbox@COMSATxtrsep@absolute_path_to_mailbox
  531. X.Re
  532. X.PP
  533. XWhenever procmail itself opens a file to deliver to, it
  534. X@KERNEL_LOCKING@.
  535. X.PP
  536. XProcmail is NFS-resistant and eight-bit clean.
  537. X.br
  538. X.ne 11
  539. X.Sh NOTES
  540. XCalling up procmail with the \-@HELPOPT1@ or \-@HELPOPT2@ options will cause
  541. Xit to display a command-line help and recipe flag quick-reference page.
  542. X.PP
  543. X@CF_procmail@
  544. XIn this case your $HOME/@DOT_FORWARD@ (beware, it
  545. X.B has
  546. Xto be world readable) file should contain the line below.  Be sure to include
  547. Xthe single and double quotes, and it
  548. X.I must
  549. Xbe an
  550. X.I absolute
  551. Xpath.  The `#YOUR_LOGIN_NAME' is not actually a parameter that is required by
  552. Xprocmail, in fact, it will be discarded by sh before procmail ever sees it;
  553. Xit is however a necessary kludge against overoptimising sendmail programs:
  554. X.PP
  555. X.na
  556. X.nf
  557. X@FW_content@
  558. X.fi
  559. X.ad
  560. X.PP
  561. XProcmail can also be invoked to postprocess an already filled system
  562. Xmailbox.  This can be useful if you don't want to or can't use a
  563. X$HOME/@DOT_FORWARD@ file (in which case the following script could
  564. Xperiodically be called from within
  565. X.BR cron (1),
  566. Xor whenever you start reading mail):
  567. X.Rs
  568. X#!/bin/sh
  569. X
  570. Xif test -s $@SYSTEM_MBOX@
  571. Xthen
  572. X  umask 077
  573. X  lockfile \-l3600 $HOME/.newmail.lock
  574. X  lockfile \-l3600 \-ml
  575. X  cat @SYSTEM_MBOX@ >>$HOME/.newmail &&
  576. X   cat /dev/null >@SYSTEM_MBOX@
  577. X  lockfile \-mu
  578. X  formail \-@FM_SPLIT@ procmail <$HOME/.newmail
  579. X  rm \-f $HOME/.newmail $HOME/.newmail.lock
  580. Xfi
  581. Xexit 0
  582. X.Re
  583. X.br
  584. X.ne 14
  585. X.Ss "A sample small @PROCMAILRC@:"
  586. X.na
  587. X.nf
  588. XPATH=/bin:/usr/bin:@BINDIR@
  589. XMAILDIR=$HOME/Mail      #you'd better make sure it exists
  590. XDEFAULT=$MAILDIR/mbox
  591. XLOGFILE=$MAILDIR/from
  592. X:0:
  593. X* ^From.*berg
  594. Xfrom_me
  595. X:0
  596. X* ^Subject:.*Flame
  597. X/dev/null
  598. X.fi
  599. X.ad
  600. END_OF_FILE
  601. if test 17351 -ne `wc -c <'procmail/man/procmail.man'`; then
  602.     echo shar: \"'procmail/man/procmail.man'\" unpacked with wrong size!
  603. fi
  604. # end of 'procmail/man/procmail.man'
  605. fi
  606. if test -f 'procmail/src/autoconf' -a "${1}" != "-c" ; then 
  607.   echo shar: Will not clobber existing file \"'procmail/src/autoconf'\"
  608. else
  609. echo shar: Extracting \"'procmail/src/autoconf'\" \(27101 characters\)
  610. sed "s/^X//" >'procmail/src/autoconf' <<'END_OF_FILE'
  611. X#! /bin/sh
  612. X:
  613. X#$Id: autoconf,v 1.56 1993/06/23 14:35:13 berg Exp $
  614. X
  615. X# All possible entries in autoconf.h:
  616. X
  617. X#    #define UNISTD_H_MISSING
  618. X#    #define STDDEF_H_MISSING
  619. X#    #define STDLIB_H_MISSING
  620. X#    #define DIRENT_H_MISSING
  621. X#    #define SYS_DIRENT_H_MISSING
  622. X#    #define NDIR_H_MISSING
  623. X#    #define SYS_NDIR_H_MISSING
  624. X#    #define SYS_DIR_H_MISSING
  625. X#    #define SYS_WAIT_H_MISSING
  626. X#    #define SYS_UTSNAME_H_MISSING
  627. X#    #define STRING_H_MISSING
  628. X#    #define SYSEXITS_H_MISSING
  629. X#Ok    #define SYS_FILE_H_MISSING
  630. X#    #define const
  631. X#    #define volatile
  632. X#    #define P(args) ()
  633. X#    #define void char
  634. X#    typedef int mode_t;
  635. X#    typedef int pid_t;
  636. X#    typedef int uid_t;
  637. X#    typedef int gid_t;
  638. X#    typedef unsigned size_t;
  639. X#    typedef long off_t;
  640. X#    typedef long time_t;
  641. X#    #define NOmemmove
  642. X#    #define NObcopy
  643. X#    #define NOstrcspn
  644. X#    #define NOstrpbrk
  645. X#    #define NOopendir
  646. X#    #define NOrename
  647. X#    #define NOsetrgid
  648. X#    #define NOsetregid
  649. X#    #define NOmkdir
  650. X#    #define NOuname
  651. X#    #define NOstrstr
  652. X#    #define NOstrtol
  653. X#    #define strchr(s,c) index(s,c)
  654. X#    #define initgroups(n,g)
  655. X#Ok    #define endpwent()
  656. X#Ok    #define endgrent()
  657. X#Ok    #define endhostent()
  658. X#Ok    #define endservent()
  659. X#Ok    #define endprotoent()
  660. X#    #define h_0addr_list h_addr
  661. X#Ok    #define NO_COMSAT
  662. X#    #define _GUID_T
  663. X#Ok    #define UDP_protocolno 17
  664. X#Ok    #define BIFF_serviceport "512"
  665. X#Ok    #define IP_localhost {127,0,0,1,}
  666. X#    #define WMACROS_NON_POSIX
  667. X#    #define oBRAIN_DAMAGE
  668. X#Ok    #define LD_ENV_FIX
  669. X#Ok    #define GOT_bin_test
  670. X#Ok    #define SMALLHEAP
  671. X#    #define NOfcntl_lock
  672. X#Ok    #define USElockf
  673. X#Ok    #define USEflock
  674. X#Ok    #define SYSTEM_MAILBOX "/usr/spool/mail/$LOGNAME"
  675. X#Ok    #define SENDMAIL "/usr/lib/sendmail"
  676. X#Ok    #define CF_no_procmail_yet
  677. X
  678. X# A conforming ANSI compiler and POSIX library should not have any defines not
  679. X# marked as "Ok" in the autoconf.h file.
  680. X# Anything else indicates failure of your system to comply with either
  681. X# the ANSI or POSIX standards (but procmail should be installable anyway).
  682. X
  683. XSHELL=$1
  684. XPATH=.:$PATH
  685. Xshift; RM="$1"
  686. Xshift; MV="$1"
  687. Xshift; DEVNULL=$1
  688. Xshift; FGREP="$1"
  689. Xshift; MAKE="$1"
  690. Xshift; O=$1
  691. Xshift; LOCKINGTEST="$1"
  692. Xshift; ACONF=$1
  693. X
  694. Xtest 1 != $# &&
  695. X echo "Don't start this script directly, use \`make ../autoconf.h'" && exit 1
  696. X
  697. Xexport SHELL PATH
  698. X
  699. XOLDTESTDIRS=""
  700. Xtailpid=""
  701. Xecho "" >_locktst.pid
  702. X
  703. Xif test -f $ACONF
  704. Xthen
  705. X  trap "kill \`cat _locktst.pid\` 2>$DEVNULL;cp $ACONF $ACONF.tmp
  706. X   $RM -r \$OLDTESTDIRS;test ! -z \"\$tailpid\" && kill \$tailpid 2>$DEVNULL
  707. X   kill \`cat _locktst.pid\` 2>$DEVNULL; exit 1" 1 2 3 15
  708. Xelse
  709. X  trap "kill \`cat _locktst.pid\` 2>$DEVNULL;$RM -r \$OLDTESTDIRS $ACONF.tmp
  710. X   mv $ACONF $ACONF.tmp 2>$DEVNULL
  711. X   test ! -z \"\$tailpid\" && kill \$tailpid 2>$DEVNULL
  712. X   kill \`cat _locktst.pid\` 2>$DEVNULL; exit 1" 1 2 3 15
  713. Xfi
  714. X
  715. Xnocore=yes
  716. Xtest -f core && nocore=no
  717. X
  718. Xcat 2>&1 <<HERE
  719. X==============================================================================
  720. XIn order for the kernel-locking tests to work as intended I have to be able to
  721. Xtest-lock files on as many semantically different filesystems as possible (for
  722. Xmore information about this, READ PARAGRAPH TWO in INSTALL).  To suppress this
  723. Xprompt you can set the LOCKINGTEST variable in the Makefile.
  724. X
  725. XPlease add writeable directories to the list.  You should only add directories
  726. Xthat reside on filesystems that have unique characterics.  E.g. if you have
  727. Xseveral remote NFS partitions, pick some unique client-server pairs, there is
  728. Xlittle use in picking the same server twice from the same client-machine.
  729. XAn excellent candidate would be a remotely mounted mail spool directory.
  730. X==============================================================================
  731. XHERE
  732. X
  733. Xtestdirs="/tmp ."
  734. Xb=dummy
  735. Xwhile test ! -z "$b"
  736. Xdo
  737. X  echo 2>&1 ""
  738. X  b=""
  739. X  OLDTESTDIRS="$TESTDIRS"
  740. X  TESTDIRS=""
  741. X  for a in $testdirs
  742. X  do $RM -r $a/_locktest
  743. X     if mkdir $a/_locktest
  744. X     then
  745. X    b="$b $a"
  746. X    TESTDIRS="$TESTDIRS $a/_locktest"
  747. X     else
  748. X    echo 2>&1 "Can't create $a/_locktest"
  749. X     fi
  750. X  done
  751. X  OLDTESTDIRS="$TESTDIRS"
  752. X  testdirs="$b"
  753. X  echo 2>&1 ""
  754. X  echo 2>&1 "I will temporarily use a testdirectory named _locktest"
  755. X  echo 2>&1 "in the following directories:"
  756. X  echo 2>&1 ""
  757. X  echo 2>&1 $testdirs
  758. X  echo 2>&1 ""
  759. X  echo 2>&1 "If you would like to add any, please specify them below,"
  760. X  echo 2>&1 "press return to continue:"
  761. X  echo 2>&1 ""
  762. X  if test -z "$LOCKINGTEST"
  763. X  then
  764. X     read b
  765. X  elif test dummy = "$LOCKINGTEST"
  766. X  then
  767. X     b=""
  768. X  else
  769. X     testdirs=""; b="$LOCKINGTEST"; LOCKINGTEST=dummy
  770. X     echo $b
  771. X  fi
  772. X  testdirs="$testdirs $b"
  773. Xdone
  774. X
  775. Xcat >grepfor <<HERE
  776. X$FGREP -e "\$1" _autotst.rrr >$DEVNULL && echo "\$2" >>$ACONF
  777. XHERE
  778. Xchmod 0755 grepfor
  779. X
  780. Xcat >$ACONF <<HERE
  781. X/* This file was automagically generated by autoconf */
  782. X
  783. XHERE
  784. X
  785. Xecho >_locktst.h
  786. X
  787. X$RM _autotst.$O
  788. X
  789. Xcat >_autotst.c <<HERE
  790. X#include "$ACONF"
  791. X#include <sys/types.h>
  792. X#include <time.h>
  793. Xvoid*vvoid;
  794. Xmain(){int i;char*p="t";
  795. X {time_t vtime_t;i=vtime_t=1;}
  796. X {off_t voff_t;i=voff_t=1;}
  797. X vvoid=p;
  798. X return !vvoid;}
  799. X#include <unistd.h>
  800. Xstruct {char a;char b;} setsid;
  801. XHERE
  802. X
  803. Xif $MAKE _autotst.$O 2>&1 | $FGREP -v include/ >_autotst.rrr
  804. X test -f _autotst.$O
  805. Xthen
  806. X  echo "#define setsid()" >>_locktst.h
  807. Xelse
  808. X  grepfor void '#define void char'
  809. X  grepfor time_t 'typedef long time_t;'
  810. X  grepfor off_t 'typedef long off_t;'
  811. X  if $FGREP setsid _autotst.rrr >$DEVNULL 2>&1
  812. X  then
  813. X  :
  814. X  else
  815. X     echo "#define setsid()" >>_locktst.h
  816. X     $MAKE _autotst.$O 2>&1 >$DEVNULL
  817. X     test -f _autotst.$O || echo "#define UNISTD_H_MISSING" >>$ACONF
  818. X  fi
  819. Xfi
  820. X
  821. X$RM _autotst.$O _autotst
  822. X
  823. Xcat >_autotst.c <<HERE
  824. X#include "$ACONF"
  825. X#include <sys/types.h>
  826. X#ifndef UNISTD_H_MISSING
  827. X#include <unistd.h>
  828. X#endif
  829. X#include <fcntl.h>
  830. X#ifndef SYS_FILE_H_MISSING
  831. X#include <sys/file.h>
  832. X#endif
  833. Xmain(){
  834. X#ifdef F_SETLKW
  835. X fcntl(0,F_SETLKW,0);
  836. X#endif
  837. X#ifdef F_LOCK
  838. X  lockf(0,F_LOCK,(off_t)0);
  839. X#endif
  840. X#ifdef LOCK_EX
  841. X  flock(0,LOCK_EX);
  842. X#endif
  843. X return 0;}
  844. XHERE
  845. X
  846. Xecho 'Initiating fcntl()/kernel-locking-support tests'
  847. Xif $MAKE _autotst.$O >$DEVNULL 2>&1
  848. Xthen
  849. X:
  850. Xelse
  851. X  $RM _autotst.$O
  852. X  echo "#define SYS_FILE_H_MISSING" >>$ACONF
  853. X  if $MAKE _autotst.$O >_autotst.rrr 2>&1
  854. X  then
  855. X  :
  856. X  else
  857. X     echo 2>&1 "Whoeaaa!  There's something fishy going on here."
  858. X     echo 2>&1 "You have a look and see if you detect anything uncanny:"
  859. X     echo 2>&1 "*******************************************************"
  860. X     cat 2>&1 _autotst.rrr
  861. X     echo 2>&1 "*******************************************************"
  862. X     echo 2>&1 "I suggest you take a look at the definition of CFLAGS* and CC"
  863. X     echo 2>&1 "in the Makefile before you try make again."
  864. X     kill -15 $$
  865. X  fi
  866. Xfi
  867. X$MAKE _autotst >_autotst.rrr 2>&1
  868. X$RM _autotst.$O _autotst
  869. X
  870. X$FGREP fcntl _autotst.rrr >$DEVNULL && echo "#undef F_SETLKW" >>_locktst.h
  871. X$FGREP lockf _autotst.rrr >$DEVNULL && echo "#undef F_LOCK" >>_locktst.h
  872. X$FGREP flock _autotst.rrr >$DEVNULL && cat >>_locktst.h <<HERE
  873. X#ifdef LOCK_EX
  874. X#undef LOCK_EX
  875. X#endif
  876. X#ifndef SYS_FILE_H_MISSING
  877. X#define SYS_FILE_H_MISSING
  878. X#endif
  879. XHERE
  880. X
  881. Xcat >_autotst.c <<HERE
  882. X#include "$ACONF"
  883. X#include "../config.h"
  884. X#include <sys/types.h>
  885. X#ifndef UNISTD_H_MISSING
  886. X#include <unistd.h>        /* getpid() getppid() */
  887. X#endif
  888. X#include <stdio.h>
  889. X#include <time.h>
  890. X#include <fcntl.h>
  891. X#include <signal.h>        /* SIGKILL */
  892. X#ifndef tell
  893. X#define tell(fd)    lseek(fd,(off_t)0,SEEK_CUR)
  894. X#endif
  895. X#define EX_OK    0
  896. X#include "_locktst.h"
  897. X#ifndef SYS_FILE_H_MISSING
  898. X#include <sys/file.h>
  899. X#endif
  900. X#ifndef SEEK_SET
  901. X#define SEEK_SET    0
  902. X#define SEEK_CUR    1
  903. X#define SEEK_END    2
  904. X#endif
  905. X
  906. X#define MIN_locks    128      /* minimum of consecutive successful locks */
  907. X#define SLEEP_loop    64              /* iterations in the busy loop */
  908. X#define SLEEP_delay    0          /* sleep() time per busy iteration */
  909. X#define SLEEP_retreat    1         /* extra sleep() when quota reached */
  910. X#define TIME_OUT_SEC    16             /* initial timeout per lock */
  911. X#define NR_of_forks    8             /* concurrent test-programs */
  912. X#define NR_of_lockfiles 2          /* lockfiles used in testing (<=4) */
  913. X#define GROW        3                /* when timing got worse */
  914. X#define DECAY        7/8               /* when timing got better */
  915. X#define GOBBLE        256             /* for the SunOS crash test */
  916. X
  917. X#define LOCKS_per_child (((MIN_locks+NR_of_forks-1)/NR_of_forks+1)/2)
  918. X#define SHIFT_childno    3
  919. X#define MASK_fileno    ((1<<SHIFT_childno)-1)
  920. X#define MASK_childno    (~MASK_fileno)
  921. X
  922. X#ifdef NO_fcntl_LOCK
  923. X#undef F_SETLKW
  924. X#endif
  925. X#ifdef NO_lockf_LOCK
  926. X#undef F_LOCK
  927. X#endif
  928. X#ifdef NO_flock_LOCK
  929. X#undef LOCK_EX
  930. X#endif
  931. X
  932. X#define FIRST_lock    0x04        /* testing is in order of importance */
  933. X#define MSK_fcntl    0x04           /* don't change this order unless you */
  934. X#define MSK_lockf    0x02           /* change locking.c as well, fdlock() */
  935. X#define MSK_flock    0x01
  936. X
  937. Xint dolock,child[NR_of_forks],timeout,fdcollect;
  938. Xchar dirlocktest[]="_locktest";
  939. X
  940. Xvoid stimeout()
  941. X{ timeout=1;close(fdcollect);killchildren();
  942. X}
  943. X
  944. Xvoid terminate()
  945. X{ stimeout();exit(1);
  946. X}
  947. X
  948. Xstatic unsigned long seed;
  949. X
  950. Xunsigned psrand()
  951. X{ return(unsigned)(seed*=69069L)>>8;
  952. X}
  953. X
  954. Xunsigned sfork()
  955. X{ int pid;
  956. X  while((pid=fork())<0)
  957. X     fprintf(stderr,"Couldn't fork _locktst, retrying\n"),sleep(TIME_OUT_SEC);
  958. X  return pid;
  959. X}
  960. X
  961. Xmain(argc,argv)char*argv[];
  962. X{ int goodlock,testlock,i,pip[2],pipw[2];unsigned otimet,dtimet;
  963. X  static char filename[]="_locktst.l0";
  964. X  close(0);goodlock=0;testlock=FIRST_lock;signal(SIGPIPE,SIG_DFL);
  965. X  if(sfork())                 /* try to ditch the controlling tty */
  966. X     return EX_OK;    /* mainly to prevent rather messy kernel-diagnostics */
  967. X  setsid();                       /* from appearing on your tty */
  968. X  do
  969. X   { int countlocks;
  970. X     signal(SIGTERM,SIG_DFL);argc=1;dolock=goodlock|testlock;
  971. X     do
  972. X      { char*curdir;
  973. X    curdir=argv[argc];otimet=time((time_t*)0);
  974. X    if(sfork())
  975. X     { close(1);close(2);i=NR_of_lockfiles;chdir(curdir);
  976. X       chdir(dirlocktest);
  977. X       do                   /* prime the lock, see if it vanishes */
  978. X        { filename[sizeof filename-2]='0'+--i;
  979. X          lseek(goodlock=open(filename,O_WRONLY),(off_t)0,SEEK_END);
  980. X          fdlock(goodlock);
  981. X        }
  982. X       while(i);
  983. X       for(;;)                /* synchronising "busy"-wait */
  984. X          sleep(TIME_OUT_SEC);       /* until the games can be started */
  985. X     }
  986. X    sleep(1);pipe(pip);pipe(pipw);i=NR_of_forks;*child=0;
  987. X    fprintf(stderr,"\nStarting test %x on %s\n",dolock,curdir);
  988. X    while((child[--i]=sfork())&&i);               /* divide and conquer */
  989. X    if(!*child)
  990. X     { unsigned char lockflag;int fd,childno=i<<SHIFT_childno;
  991. X       int mylocks=LOCKS_per_child;
  992. X       close(pipw[0]);close(pip[0]);close(1);
  993. X       seed=time((time_t*)0)+getpid()|1;chdir(curdir);chdir(dirlocktest);
  994. X       close(pipw[1]);
  995. X       for(;;)                       /* and lock away! */
  996. X        { filename[sizeof filename-2]='0'+(i=psrand()%NR_of_lockfiles);
  997. X          lockflag=childno|i<<1|1;
  998. X          lseek(fd=open(filename,O_WRONLY),(off_t)0,SEEK_END);
  999. X          if(sfdlock(fd))
  1000. X         lockflag&=~1,fprintf(stderr,"XX%02x",lockflag);
  1001. X          write(pip[1],&lockflag,1);
  1002. X          fprintf(stderr,"%2x%02x",i,childno>>SHIFT_childno);
  1003. X          lseek(fd,(off_t)0,SEEK_END);write(fd,&lockflag,1);
  1004. X          for(i=SLEEP_loop;i;i--,time((time_t*)0),sleep(SLEEP_delay));
  1005. X          lockflag&=~1;write(pip[1],&lockflag,1);
  1006. X          if(fdunlock()||close(fd))
  1007. X           { write(pip[1],&lockflag,1);fprintf(stderr,"XX%02x",lockflag);
  1008. X         return 1;
  1009. X           }
  1010. X          if(--mylocks<0)
  1011. X         sleep(SLEEP_retreat);
  1012. X        }
  1013. X     }
  1014. X    signal(SIGTERM,terminate);
  1015. X    ;{ unsigned char lckdfil[NR_of_lockfiles],curflag;
  1016. X       int j,ppid;                   /* give all children a chance */
  1017. X       ppid=getppid();
  1018. X       if(sfork())    /* discard the old body, let init adopt our children */
  1019. X          return EX_OK;
  1020. X       ;{ FILE*fp;
  1021. X          if(fp=fopen("_locktst.pid","w"))
  1022. X         fprintf(fp,"%ld",(long)getpid()),fclose(fp);
  1023. X        }
  1024. X       countlocks=MIN_locks;close(pip[1]);close(pipw[1]);
  1025. X       for(j=NR_of_lockfiles;lckdfil[--j]=0,j;);
  1026. X       timeout=0;sleep(1);read(pipw[0],&curflag,1);close(pipw[0]);
  1027. X       kill(ppid,SIGKILL);fdcollect=pip[0];signal(SIGALRM,stimeout);
  1028. X       dtimet=(((unsigned)time((time_t*)0)-otimet)*GROW)+TIME_OUT_SEC;
  1029. X       do
  1030. X        { unlink("_locktst.alive");alarm(dtimet+2);         /* watchdog */
  1031. X          dtimet=(otimet=time((time_t*)0)-otimet)>dtimet?
  1032. X           otimet*GROW:otimet+(dtimet-otimet)*DECAY+1; /* load dependent */
  1033. X          otimet=time((time_t*)0);
  1034. X        }
  1035. X       while(1==read(fdcollect,&curflag,1)&&
  1036. X        (j=lckdfil[i=(curflag&MASK_fileno)>>1],!timeout)&&
  1037. X        ((j^(lckdfil[i]=curflag))==1||!(j&1)&&curflag&1)&&--countlocks);
  1038. X       alarm(0);close(fdcollect);killchildren();
  1039. X       fprintf(stdout,
  1040. X        "/*locktype: %x, countlocks: %x, timeout %x, watchdog %x, %s*/\n",
  1041. X        dolock,countlocks,timeout,dtimet,curdir);fflush(stdout);
  1042. X     }
  1043. X      }
  1044. X     while(!countlocks&&argv[++argc]);
  1045. X     if(!countlocks)                /* Hurray!    Locking was flawless */
  1046. X    goodlock=dolock;              /* make a mark on our colt */
  1047. X   }
  1048. X  while(testlock>>=1);
  1049. X  if(!(goodlock&MSK_fcntl))                  /* report our findings */
  1050. X     puts("#define NOfcntl_lock");
  1051. X  if(goodlock&MSK_lockf)
  1052. X     puts("#define USElockf");
  1053. X  if(goodlock&MSK_flock)
  1054. X   { puts("#define USEflock");
  1055. X#ifdef SYS_FILE_H_MISSING
  1056. X     puts("#define SYS_FILE_H_MISSING");
  1057. X#endif
  1058. X   }
  1059. X  puts("Kernel-locking tests completed.");
  1060. X  return EX_OK;
  1061. X}
  1062. X
  1063. Xkillchildren()
  1064. X{ int i;
  1065. X  i=NR_of_forks;
  1066. X  do
  1067. X     if(child[--i]>0)
  1068. X    kill(child[i],SIGTERM),child[i]=0;
  1069. X  while(i);
  1070. X}
  1071. X
  1072. Xsfdlock(fd)
  1073. X{ int i;unsigned gobble[GOBBLE>>2];
  1074. X  for(i=GOBBLE>>2;i;gobble[--i]=~(unsigned)0);         /* SunOS crash test */
  1075. X  return fdlock(fd);
  1076. X}
  1077. X
  1078. Xstatic oldfdlock;
  1079. X#ifdef F_SETLKW
  1080. Xstatic struct flock flck;        /* why can't it be a local variable? */
  1081. X#endif
  1082. X#ifdef F_LOCK
  1083. Xstatic off_t oldlockoffset;
  1084. X#endif
  1085. X
  1086. Xfdlock(fd)
  1087. X{ int i;unsigned gobble[GOBBLE>>2];
  1088. X  for(i=GOBBLE>>2;i;gobble[--i]=~(unsigned)0);         /* SunOS crash test */
  1089. X  oldfdlock=fd;fd=0;
  1090. X  if(MSK_fcntl&dolock)
  1091. X#ifdef F_SETLKW
  1092. X   { flck.l_type=F_WRLCK;flck.l_whence=SEEK_SET;flck.l_len=0;
  1093. X     flck.l_start=tell(oldfdlock);fd|=fcntl(oldfdlock,F_SETLKW,&flck);
  1094. X   }
  1095. X#else
  1096. X     fd=1;
  1097. X#endif
  1098. X  if(MSK_lockf&dolock)
  1099. X#ifdef F_LOCK
  1100. X     oldlockoffset=tell(oldfdlock),fd|=lockf(oldfdlock,F_LOCK,(off_t)0);
  1101. X#else
  1102. X     fd=1;
  1103. X#endif
  1104. X  if(MSK_flock&dolock)
  1105. X#ifdef LOCK_EX
  1106. X     fd|=flock(oldfdlock,LOCK_EX);
  1107. X#else
  1108. X     fd=1;
  1109. X#endif
  1110. X  return fd;
  1111. X}
  1112. X
  1113. Xfdunlock()
  1114. X{ int i;unsigned gobble[GOBBLE];
  1115. X  for(i=GOBBLE;i;gobble[--i]=~(unsigned)0);         /* SunOS crash test */
  1116. X  if(MSK_flock&dolock)
  1117. X#ifdef LOCK_EX
  1118. X     i|=flock(oldfdlock,LOCK_UN);
  1119. X#else
  1120. X     i=1;
  1121. X#endif
  1122. X  if(MSK_lockf&dolock)
  1123. X#ifdef F_LOCK
  1124. X   { lseek(oldfdlock,oldlockoffset,SEEK_SET);
  1125. X     i|=lockf(oldfdlock,F_LOCK,(off_t)2);i|=lockf(oldfdlock,F_ULOCK,(off_t)0);
  1126. X   }
  1127. X#else
  1128. X     i=1;
  1129. X#endif
  1130. X  if(MSK_fcntl&dolock)
  1131. X#ifdef F_SETLKW
  1132. X   { flck.l_len=2;i|=fcntl(oldfdlock,F_SETLK,&flck);flck.l_type=F_UNLCK;
  1133. X     flck.l_len=0;i|=fcntl(oldfdlock,F_SETLK,&flck);
  1134. X   }
  1135. X#else
  1136. X     i=1;
  1137. X#endif
  1138. X  if(!i)
  1139. X     for(i=GOBBLE;i&&gobble[--i]==~(unsigned)0;);
  1140. X  return i;
  1141. X}
  1142. XHERE
  1143. X
  1144. Xif $MAKE _autotst >_autotst.rrr 2>&1
  1145. Xthen
  1146. X:
  1147. Xelse
  1148. X  echo 2>&1 "Whoeaaa!  There's something fishy going on here."
  1149. X  echo 2>&1 "You have a look and see if you detect anything uncanny:"
  1150. X  echo 2>&1 "*******************************************************"
  1151. X  cat 2>&1 _autotst.rrr
  1152. X  echo 2>&1 "*******************************************************"
  1153. X  echo 2>&1 "I suggest you take a look at the definition of LDFLAGS*"
  1154. X  echo 2>&1 "in the Makefile before you try make again."
  1155. X  kill -15 $$
  1156. Xfi
  1157. X
  1158. X$MV _locktst _locktst.$$ 2>$DEVNULL
  1159. X$RM _autotst.$O _autotst.rrr locktst* 2>$DEVNULL
  1160. X$MV _autotst _locktst
  1161. X
  1162. Xfor b in $TESTDIRS
  1163. Xdo
  1164. X  for a in 0 1 2 3
  1165. X  do echo dummy_file >$b/_locktst.l$a
  1166. X  done
  1167. Xdone
  1168. X
  1169. Xecho 2>&1 ""
  1170. X
  1171. X_locktst $TESTDIRS >_locktst.rrr 2>lock.log    # will finish in the background
  1172. Xecho 'Proceeding with kernel-locking-support tests in the background'
  1173. X
  1174. Xcat >_autotst.c <<HERE
  1175. X#include "$ACONF"
  1176. X#ifndef UNISTD_H_MISSING
  1177. X#include <unistd.h>        /* execvp() */
  1178. X#endif
  1179. Xmain()
  1180. X{ char r[]="",*const*p;char*q="";const char*s="";
  1181. X  static struct{const int a;int b;}c[2];
  1182. X  --(c+1)->b;                 /* AIX 3.1.5 machines can't do this */
  1183. X  p= &q;
  1184. X  execvp(q,p);      /* IRIX 4.0.1 system-include files are wrong on this point */
  1185. X  return r==s;            /* Domain/OS warns here, not about "s==r" though */
  1186. X}
  1187. XHERE
  1188. X
  1189. Xecho 'Testing for const'
  1190. Xif $MAKE _autotst.$O 2>&1 | $FGREP -v include/ >_autotst.rrr
  1191. X test -f _autotst.$O
  1192. Xthen
  1193. X  grepfor const '#define const'
  1194. Xelse
  1195. X  echo '#define const' >>$ACONF
  1196. Xfi
  1197. X$RM _autotst.$O
  1198. X
  1199. Xcat >_autotst.c <<HERE
  1200. Xmain(){volatile int i;return(i=0);}
  1201. XHERE
  1202. X
  1203. Xecho 'Testing for volatile'
  1204. Xif $MAKE _autotst.$O >$DEVNULL 2>&1 && test -f _autotst.$O
  1205. Xthen
  1206. X:
  1207. Xelse
  1208. X echo '#define volatile' >>$ACONF
  1209. Xfi
  1210. X$RM _autotst.$O
  1211. X
  1212. Xif $FGREP const $ACONF >$DEVNULL
  1213. Xthen
  1214. X  echo '#define P(args) ()' >>$ACONF
  1215. Xelse
  1216. X  cat >_autotst.c <<HERE
  1217. Xmain(const argc,const char*const argv[]){return argc;}
  1218. XHERE
  1219. X
  1220. X  echo 'Testing for prototypes'
  1221. X  if $MAKE _autotst.$O >$DEVNULL 2>&1 && test -f _autotst.$O
  1222. X  then
  1223. X  :
  1224. X  else
  1225. X     echo '#define P(args) ()' >>$ACONF
  1226. X  fi
  1227. X  $RM _autotst.$O
  1228. Xfi
  1229. X
  1230. Xecho 'Checking for POSIX and ANSI system include files'
  1231. X
  1232. Xcat >_autotst.c <<HERE
  1233. X#include "includes.h"
  1234. Xint a;
  1235. XHERE
  1236. X
  1237. Xi0="";i1="";i2="";i3="";i4="";i5="";i6="";i7="";i8="";i9="";i10="";
  1238. Xoldi=""
  1239. X
  1240. Xwhile $MAKE _autotst.$O 2>&1 | $FGREP -v include/ >_autotst.rrr
  1241. X test ! -f _autotst.$O
  1242. Xdo
  1243. X  test -z "$i0" && grepfor stddef.h "#define STDDEF_H_MISSING" && i0=I
  1244. X  test -z "$i1" && grepfor stdlib.h "#define STDLIB_H_MISSING" && i1=I
  1245. X  test -z "$i2" && grepfor dirent.h "#define DIRENT_H_MISSING" && i2=I
  1246. X  test -z "$i3" && grepfor ndir.h "#define NDIR_H_MISSING" && i3=I
  1247. X   test I = "$i3$i4" && grepfor sys/ndir.h "#define SYS_NDIR_H_MISSING" && i4=I
  1248. X    test I = "$i4$i5" && grepfor sys/dir.h "#define SYS_DIR_H_MISSING" && i5=I
  1249. X     test I = "$i5$i6" && grepfor sys/dirent.h "#define SYS_DIRENT_H_MISSING" \
  1250. X      && i6=I
  1251. X  test -z "$i7" && grepfor sys/wait.h "#define SYS_WAIT_H_MISSING" && i7=I
  1252. X  test -z "$i8" && grepfor sys/utsname.h "#define SYS_UTSNAME_H_MISSING" &&
  1253. X   i8=I
  1254. X  test -z "$i9" && grepfor string.h "#define STRING_H_MISSING" && i9=I
  1255. X  test -z "$i10" && grepfor sysexits.h "#define SYSEXITS_H_MISSING" && i10=I
  1256. X  newi="$i0$i1$i2$i3$i4$i5$i6$i7$i8$i9$i10"
  1257. X  if test a$oldi = a$newi
  1258. X  then
  1259. X     echo 2>&1 "Whoeaaa!  There's something fishy going on here."
  1260. X     echo 2>&1 "You have a look and see if you detect anything uncanny:"
  1261. X     echo 2>&1 "*******************************************************"
  1262. X     $MAKE _autotst.$O >_autotst.rrr 2>&1
  1263. X     cat 2>&1 _autotst.rrr
  1264. X     echo 2>&1 "*******************************************************"
  1265. X     echo 2>&1 "I suggest you take a look at the definition of CFLAGS*"
  1266. X     echo 2>&1 "in the Makefile before you try make again."
  1267. X     kill -15 $$
  1268. X  fi
  1269. X  oldi=$newi
  1270. X  echo \
  1271. X   "    ...missing `expr $oldi : '.*'` include files, doublechecking..."
  1272. Xdone
  1273. X
  1274. X$RM _autotst.$O
  1275. X
  1276. Xcat >_autotst.c <<HERE
  1277. X#include "includes.h"
  1278. X#include "network.h"
  1279. Xint a;
  1280. XHERE
  1281. X
  1282. Xecho 'Checking for network/comsat/biff support'
  1283. X
  1284. Xif $MAKE _autotst.$O 2>&1 | $FGREP -v include/ >_autotst.rrr
  1285. X test -f _autotst.$O
  1286. Xthen
  1287. X:
  1288. Xelse
  1289. X  echo "#define NO_COMSAT" >>$ACONF
  1290. Xfi
  1291. X
  1292. X$RM _autotst.$O
  1293. X
  1294. Xcat >_autotst.c <<HERE
  1295. X#include "includes.h"
  1296. X#ifndef NO_COMSAT
  1297. X#include "network.h"
  1298. X#endif
  1299. Xmain(){int i;
  1300. X {size_t vsize_t;i=vsize_t=1;}
  1301. X {pid_t vpid_t;i=vpid_t=1;}
  1302. X {mode_t vmode_t;i=vmode_t=1;}
  1303. X {uid_t vuid_t;i=vuid_t=1;}
  1304. X {gid_t vgid_t;i=vgid_t=1;}
  1305. X#ifndef NO_COMSAT
  1306. X {struct hostent host;i=!(host.h_addr_list=0);}
  1307. X#endif
  1308. X return !i;}
  1309. XHERE
  1310. X
  1311. Xecho 'Testing for void*,size_t,off_t,pid_t,time_t,mode_t,uid_t,gid_t'
  1312. X$MAKE _autotst.$O 2>&1 | $FGREP -v include/ >_autotst.rrr
  1313. X$RM _autotst.$O
  1314. X
  1315. Xgrepfor size_t 'typedef unsigned size_t;'
  1316. Xgrepfor pid_t 'typedef int pid_t;'
  1317. Xgrepfor mode_t 'typedef int mode_t;'
  1318. Xgrepfor uid_t 'typedef int uid_t;'
  1319. Xgrepfor gid_t 'typedef int gid_t;'
  1320. Xgrepfor h_addr_list '#define h_0addr_list h_addr' ||
  1321. X grepfor struct '#define h_0addr_list h_addr'
  1322. X
  1323. Xcat >_autotst.c <<HERE
  1324. X#include "includes.h"
  1325. Xmain(){int i;i=1;
  1326. X i+=WIFEXITED(i);
  1327. X i+=WIFSTOPPED(i);
  1328. X i+=WEXITSTATUS(i);
  1329. X return i;}
  1330. XHERE
  1331. X
  1332. Xecho 'Testing for WIFEXITED(), WIFSTOPPED() & WEXITSTATUS()'
  1333. Xif $MAKE _autotst.$O 2>&1 | $FGREP -v include/ >_autotst.rrr
  1334. Xthen
  1335. X   grepfor struct '#define WMACROS_NON_POSIX' ||
  1336. X    grepfor union '#define WMACROS_NON_POSIX'
  1337. Xelse
  1338. X   echo '#define WMACROS_NON_POSIX' >>$ACONF
  1339. Xfi
  1340. X$RM _autotst.$O
  1341. X
  1342. Xcat >_autotst.c <<HERE
  1343. X#include "includes.h"
  1344. X#ifndef NO_COMSAT
  1345. X#include "network.h"
  1346. X#endif
  1347. Xmain(){char a[2];
  1348. X endpwent();endgrent();memmove(a,"0",1);bcopy("0",a,1);strcspn(a,"0");
  1349. X strtol("0",(char**)0,10);strchr("0",'0');strpbrk(a,"0");rename(a,"0");
  1350. X setrgid(0);setregid(0,0);opendir("0");initgroups("0",0);strstr("0","0");
  1351. X mkdir("0",0);
  1352. X#ifndef NOuname
  1353. X {struct utsname b;uname(&b);}
  1354. X#endif
  1355. X#ifndef NO_COMSAT
  1356. X gethostbyname("0");getprotobyname(COMSATprotocol);endhostent();endservent();
  1357. X endprotoent();
  1358. X#endif
  1359. X return 0;}
  1360. XHERE
  1361. X
  1362. Xecho 'Testing for memmove, strchr, strpbrk, strcspn, strtol, strstr,'
  1363. Xecho '    rename, setrgid, opendir & mkdir'
  1364. Xif $MAKE _autotst.$O >_autotst.rrr 2>&1
  1365. Xthen
  1366. X:
  1367. Xelse
  1368. X  echo 2>&1 "Whoeaaa!  There's something fishy going on here."
  1369. X  echo 2>&1 "You have a look and see if you detect anything uncanny:"
  1370. X  echo 2>&1 "*******************************************************"
  1371. X  cat 2>&1 _autotst.rrr
  1372. X  echo 2>&1 "*******************************************************"
  1373. X  echo 2>&1 "Your include files seem to be beyond repair <sigh>."
  1374. X  echo 2>&1 "I give up."
  1375. X  kill -15 $$
  1376. Xfi
  1377. X$MAKE _autotst 2>&1 | $FGREP -v include/ >_autotst.rrr
  1378. X$RM _autotst _autotst.$O
  1379. X
  1380. Xgrepfor strcspn '#define NOstrcspn'
  1381. Xgrepfor strpbrk '#define NOstrpbrk'
  1382. Xgrepfor opendir "
  1383. X#define NOopendir    /* the readdir library does not seem to be available
  1384. X               this will slightly affect the way a filenumber is
  1385. X               selected in MH-folders by procmail */
  1386. X"
  1387. Xgrepfor rename '#define NOrename'
  1388. Xgrepfor setrgid '#define NOsetrgid' &&
  1389. X grepfor setregid '#define NOsetregid'
  1390. Xgrepfor mkdir '#define NOmkdir'
  1391. Xgrepfor strchr '#define strchr(s,c) index(s,c)'
  1392. Xgrepfor uname "\
  1393. X#define NOuname         \
  1394. X/* the include files define it, the libraries don't */"
  1395. Xgrepfor initgroups '#define initgroups(n,g)'
  1396. Xgrepfor endpwent '#define endpwent()'
  1397. Xgrepfor endgrent '#define endgrent()'
  1398. Xif grepfor gethostbyname '#define NO_COMSAT'
  1399. Xthen
  1400. X:
  1401. Xelse
  1402. X  grepfor getprotobyname '#define UDP_protocolno 17'
  1403. X  grepfor endhostent '#define endhostent()'
  1404. X  grepfor endservent '#define endservent()'
  1405. X  grepfor endprotoent '#define endprotoent()'
  1406. Xfi
  1407. Xgrepfor strtol '#define NOstrtol'
  1408. Xgrepfor strstr '#define NOstrstr'
  1409. Xgrepfor memmove '#define NOmemmove' &&
  1410. Xif $FGREP -e bcopy _autotst.rrr >$DEVNULL
  1411. Xthen
  1412. X echo '#define NObcopy' >>$ACONF
  1413. X
  1414. X echo 'Testing for brain damage'
  1415. X cat >_autotst.c <<HERE
  1416. X#include "includes.h"
  1417. Xstruct tests{int a,b;};
  1418. Xmain(){
  1419. X return offsetof(struct tests,b);}
  1420. XHERE
  1421. X if $MAKE _autotst.$O >$DEVNULL 2>&1
  1422. X then
  1423. X    :
  1424. X else
  1425. X    echo 'Yep, it is'            # ISC chokes on its own offsetof()
  1426. X    echo '#define oBRAIN_DAMAGE' >>$ACONF
  1427. X fi
  1428. X $RM _autotst.$O
  1429. X
  1430. Xelse
  1431. X
  1432. X cat >_autotst.c <<HERE
  1433. X#include "includes.h"
  1434. X#define M256    256
  1435. X#define F33    33
  1436. Xmain(){int j=0,i=M256-1;static char a[M256];
  1437. X  do a[i]=i;while(i--);
  1438. X  bcopy(a+F33,a,M256-F33);bcopy(a,a+F33,M256-F33);i=F33-1;
  1439. X  do j|=a[i]!=(char)(i+F33);while(i--);i=M256-1;
  1440. X  do j|=a[i]!=(char)i;while(--i!=F33-1);return!j;}
  1441. XHERE
  1442. X
  1443. X echo 'Testing for bcopy handling overlaps'
  1444. X $MAKE _autotst >$DEVNULL 2>&1
  1445. X
  1446. X if _autotst
  1447. X then
  1448. X   echo 'Sorry, incompetent bcopy'
  1449. X   echo '#define NObcopy' >>$ACONF
  1450. X fi
  1451. X $RM _autotst
  1452. Xfi
  1453. X
  1454. X$FGREP -e LD_ /bin/ld >/dev/null 2>&1 && echo "#define LD_ENV_FIX" >>$ACONF
  1455. Xtest -f /bin/test && echo "#define GOT_bin_test" >>$ACONF
  1456. X
  1457. Xcat >_autotst.c <<HERE
  1458. X#include "includes.h"
  1459. X#ifndef NO_COMSAT
  1460. X#include "network.h"                     /* also for ntohs() */
  1461. X#endif
  1462. Xmain(argc)
  1463. X{ unsigned long s=(size_t)~0;int i;
  1464. X  for(i=1;s>>=1;i++);
  1465. X  if(argc==1)
  1466. X   {
  1467. X#ifndef NO_COMSAT
  1468. X#ifndef UDP_protocolno
  1469. X     ;{ const struct protoent*p;
  1470. X    if(p=getprotobyname(COMSATprotocol))
  1471. X     { printf("#define UDP_protocolno %d\n",p->p_proto);
  1472. X#else
  1473. X     ;{ if(1)
  1474. X     {
  1475. X#endif
  1476. X       ;{ const struct servent*serv;
  1477. X          if(serv=getservbyname(COMSATservice,COMSATprotocol))
  1478. X         printf("#define BIFF_serviceport \"%d\"\n",
  1479. X          ntohs(serv->s_port));
  1480. X        }
  1481. X#ifdef AF_INET
  1482. X       ;{ const struct hostent*host;
  1483. X          if(!strcmp("localhost",COMSAThost)&&
  1484. X           (host=gethostbyname(COMSAThost))&&
  1485. X           host->h_0addr_list&&host->h_addrtype==AF_INET&&
  1486. X           host->h_length)
  1487. X           { int j=host->h_length;
  1488. X         const unsigned char*ad=(void*)host->h_0addr_list;
  1489. X         printf("#define IP_localhost {");
  1490. X         do printf("%d,",*ad++);
  1491. X         while(--j);
  1492. X         puts("}");
  1493. X           }
  1494. X        }
  1495. X#endif /* AF_INET */
  1496. X     }
  1497. X    else
  1498. X       puts("#define NO_COMSAT");
  1499. X      }
  1500. X#endif /* NO_COMSAT */
  1501. X     if(i<=16)
  1502. X      { puts("#define SMALLHEAP");return 1;
  1503. X      }
  1504. X#ifdef _GUID_T                              /* ISC cc hack */
  1505. X     ;{ struct passwd*p;
  1506. X    if(sizeof(int)>sizeof(uid_t)&&(p=getpwnam("root"))&&(*p->pw_dir!='/'||
  1507. X     (*p->pw_shell&&!(p->pw_shell)[1])))
  1508. X       puts("#define _GUID_T\ntypedef int uid_t;\ntypedef int gid_t;");
  1509. X      }
  1510. X#endif
  1511. X   }
  1512. X#ifdef SYSTEM_MBOX
  1513. X  if(argc==2)
  1514. X   { printf("#define SYSTEM_MAILBOX %s\n",SYSTEM_MBOX);return 1;
  1515. X   }
  1516. X#endif
  1517. X#ifdef DEFsendmail
  1518. X  if(argc==3)
  1519. X   { printf("#define SENDMAIL %s\n",DEFsendmail);return 1;
  1520. X   }
  1521. X#endif
  1522. X  return 0;
  1523. X}
  1524. XHERE
  1525. X
  1526. Xecho 'Determining the most applicable block size'
  1527. X
  1528. X$MAKE _autotst >$DEVNULL 2>&1
  1529. X_autotst >>$ACONF
  1530. X
  1531. Xfound=no
  1532. Xfor a in /usr/spool/mail /usr/mail /var/spool/mail /var/mail /spool/mail
  1533. Xdo
  1534. X  test -d $a -a $found != yes &&
  1535. X   echo '#define SYSTEM_MAILBOX "'$a'/$LOGNAME"' >>$ACONF && found=yes
  1536. Xdone
  1537. Xif test $found != yes && _autotst 2 >>$ACONF
  1538. Xthen
  1539. X echo '#define SYSTEM_MAILBOX "$HOME/.mail"' >>$ACONF
  1540. X echo Could not find the system-mailbox directory, supplied substitute
  1541. Xfi
  1542. X
  1543. Xcat >lookfor <<HERE
  1544. Xfor a in /usr/lib /lib /usr/etc /etc /usr/bin /bin /usr/local/bin /usr/lbin \
  1545. X /usr/local/lib /usr/local /usr/.lib /local/bin
  1546. Xdo
  1547. X if test -f "\$a/\$1"
  1548. X then
  1549. X    echo "#define SENDMAIL \"\$a/\$1\"" >>$ACONF
  1550. X    exit 0
  1551. X fi
  1552. Xdone
  1553. Xexit 1
  1554. XHERE
  1555. Xchmod 0755 lookfor
  1556. X
  1557. Xif lookfor sendmail || lookfor smail || lookfor rmail || lookfor mail
  1558. Xthen
  1559. X:
  1560. Xelif _autotst 2 3 >>$ACONF
  1561. Xthen
  1562. X echo 'Could not find any mailer.  It should be a mailer accepting at least'
  1563. X echo 'one plain destination address as its only argument (any sendmail'
  1564. X echo 'compatible mailer will do), and the mail-to-be-sent on stdin.'
  1565. X echo 'What is your mailer called?  (You can override this in config.h)'
  1566. X read a
  1567. X echo "#define SENDMAIL \"$a\"" >>$ACONF
  1568. Xfi
  1569. X
  1570. Xcat /usr/lib/sendmail.cf /etc/sendmail.cf 2>$DEVNULL |
  1571. X grep 'Mlocal.*procmail' >$DEVNULL ||
  1572. X echo '#define CF_no_procmail_yet' >>$ACONF
  1573. X
  1574. Xwhile $FGREP -e "Kernel-locking tests completed." _locktst.rrr >$DEVNULL; \
  1575. X test 0 != $?
  1576. Xdo
  1577. X  if test -z "$tailpid"
  1578. X  then
  1579. X     echo "Waiting for the kernel-locking tests to finish..."
  1580. X     exec 9>&2 2>$DEVNULL
  1581. X     tail -f lock.log &
  1582. X     tailpid=$!
  1583. X     exec 2>&9 9>&-
  1584. X  fi
  1585. X# if test ! -f _locktst.alive
  1586. X# then
  1587. X#    echo >_locktst.alive
  1588. X#    echo "Waiting for kernel-locking tests to finish..."
  1589. X# fi
  1590. X  sleep 4
  1591. Xdone
  1592. Xexec 9>&2 2>$DEVNULL
  1593. Xtest ! -z "$tailpid" && kill $tailpid && echo && echo
  1594. Xtailpid=""
  1595. Xexec 2>&9 9>&-
  1596. Xecho "Collecting results from kernel-locking tests"
  1597. Xsed -e '/^Kernel-locking tests completed./,$ d' <_locktst.rrr >>$ACONF
  1598. Xif test -f core -a $nocore = yes
  1599. Xthen
  1600. X  echo "Removing core file (probably from the locking tests)"
  1601. X  $RM core
  1602. Xfi
  1603. X
  1604. X$RM -r $OLDTESTDIRS 2>$DEVNULL
  1605. X$RM _autotst* _locktst* lookfor grepfor 2>$DEVNULL
  1606. X
  1607. Xecho =============================autoconf.h===================================
  1608. Xcat $ACONF
  1609. Xecho ==========================================================================
  1610. END_OF_FILE
  1611. if test 27101 -ne `wc -c <'procmail/src/autoconf'`; then
  1612.     echo shar: \"'procmail/src/autoconf'\" unpacked with wrong size!
  1613. fi
  1614. chmod +x 'procmail/src/autoconf'
  1615. # end of 'procmail/src/autoconf'
  1616. fi
  1617. echo shar: End of archive 11 \(of 11\).
  1618. cp /dev/null ark11isdone
  1619. MISSING=""
  1620. for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
  1621.     if test ! -f ark${I}isdone ; then
  1622.     MISSING="${MISSING} ${I}"
  1623.     fi
  1624. done
  1625. if test "${MISSING}" = "" ; then
  1626.     echo You have unpacked all 11 archives.
  1627.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1628. else
  1629.     echo You still need to unpack the following archives:
  1630.     echo "        " ${MISSING}
  1631. fi
  1632. ##  End of shell archive.
  1633. exit 0
  1634. -- 
  1635. Sincerely,                                  berg@pool.informatik.rwth-aachen.de
  1636.            Stephen R. van den Berg (AKA BuGless).    berg@physik.tu-muenchen.de
  1637.  
  1638. "Always look on the bright side of life!"
  1639.  
  1640. exit 0 # Just in case...
  1641.