home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume20 / procmail2.10 / part01 next >
Encoding:
Text File  |  1991-07-11  |  52.8 KB  |  1,704 lines

  1. Newsgroups: comp.sources.misc
  2. From: Stephen R. van den Berg <berg@messua.informatik.rwth-aachen.de>
  3. Subject:  v20i089:  procmail - mail processing program v2.10, Part01/03
  4. Message-ID: <csm-v20i089=procmail2.10.202848@sparky.imd.sterling.com>
  5. X-Md4-Signature: 18c5d251cd673f6c2ac0d0e8ada39c37
  6. Date: Wed, 10 Jul 1991 01:32:51 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Stephen R. van den Berg <berg@messua.informatik.rwth-aachen.de>
  10. Posting-number: Volume 20, Issue 89
  11. Archive-name: procmail2.10/part01
  12. Supersedes: procmail: Volume 20, Issue 49-51,68
  13. Environment: UNIX, sendmail, smail, MMDF
  14.  
  15. The procmail mail processing program. (v2.10 1991/07/08)
  16.  
  17. Can be used to create mail-servers, mailing lists, sort your incoming mail
  18. into separate folders/files (real convenient when subscribing to one or more
  19. mailing lists), preprocess your mail, or selectively forward certain incoming
  20. mail automatically to someone.  For a more extensive feature list, see below.
  21. --
  22. Sincerely,                                berg@messua.informatik.rwth-aachen.de
  23.            Stephen R. van den Berg.       berg@physik.tu-muenchen.de
  24.  ----------------------
  25. A recent version can be picked up at various comp.sources.misc archives.
  26. The latest version can be obtained directly from the ftp-archive at:
  27.  
  28.     amaru.informatik.rwth-aachen.de (137.226.112.31)
  29.  
  30.     as compressed tar file:        pub/unix/procmail.tar.Z
  31.     or in compressed shar format:    pub/unix/procmail.0?.Z
  32.  ----------------------
  33. Feature summary for procmail:
  34.     + It's small
  35.     + Very easy to install
  36.     + Simple to maintain and configure because
  37.       all you need is actually only ONE executable (procmail)
  38.       and ONE configuration file (.procmailrc)
  39.     + Uses *your* (i.e. easily configurable) favourite regular expression
  40.       syntax
  41.     + Allows for very-easy-to-use yes-no decisions on where the mail
  42.       should go
  43.     + Filters, delivers and forwards mail *reliably*
  44.     + Provides a stable and guaranteed environment for any programs or
  45.       shell scripts you may wish to start upon mail arrival
  46.     + Is designed for reliability, once procmail gets hold of your mail
  47.       you can consider it delivered
  48.     + Is event driven (i.e. gets invoked automagically when mail arrives)
  49.     + Performs heroically under even the worst conditions
  50.       (file system full, out of swap space, process table full,
  51.       file table full, missing support files, unavailable executables,
  52.       denied permissions) and tries to deliver the mail somehow anyway
  53.       (it usually succeeds were other programs would have given up)
  54.     + procmail is the closest you can get to a program that outlives
  55.       the swapper :-)
  56.     + Absolutely undeliverable mail (after trying every trick in the book)
  57.       will bounce back to the sender
  58.     + Does not use *any* temporary files
  59.     + Is explicitly designed to work under NFS as well
  60.     + Performs more reliable mailbox locking than most other mailers
  61.       (especially across NFS, DON'T use NFS mounted mailboxes WITHOUT
  62.       installing procmail, you may use valuable mail one day)
  63.     + Supports four mailfolder standards: single file folders (standard
  64.       and nonstandard VNIX format), directory folders (AMS -- Andrew Mail
  65.       System) that contain one file per message, or the similar MH
  66.       directory folders (numbered files)
  67.     + Variable assignment and substitution is a extremely complete subset
  68.       of the standard /bin/sh syntax
  69.     + Provides a mail log file, which logs all mail arrival, shows
  70.       in summary whence it came from, what it was about, where it went
  71.       (what folder) and how long (in bytes) it was
  72.     + Uses this log file to display a wide range of diagnostic and error
  73.       messages (if something went wrong)
  74.     + Processed mail can contain arbitrary 8-bit characters (including
  75.       '\0'); i.e. binary mailings can be processed if the rest of the
  76.       mailing system knew how to handle them too
  77.     + It has a man page (boy, does *it* have a man page)
  78.     + procmail can be used as a local delivery agent (substitute for
  79.       /bin/mail)
  80.     + It runs on virtually all (old and future) operating systems which
  81.       names start with a 'U' or end in an 'X' :-) (i.e. extremely portable
  82.       code)
  83.     + Works with (among others?) sendmail, smail and MMDF
  84.  
  85. Feature summary for formail:
  86.     + Can generate auto-reply headers
  87.     + Can force mail into mailbox format (so that you can process it with
  88.       standard mail programs)
  89.     + Can split up mailboxes into the individual messages
  90.     + Can split up digests into the individual messages
  91.     + Can split up saved articles into the individual articles
  92.  
  93. Feature summary for lockfile:
  94.     + Provides NFS-secure lockfiles to shell script programmers
  95.  
  96. ---- Cut Here and feed the following to sh ----
  97. #!/bin/sh
  98. # This is procmail, a shell archive (produced by shar 3.49)
  99. # To extract the files from this archive, save it to a file, remove
  100. # everything above the "!/bin/sh" line above, and type "sh file_name".
  101. #
  102. # made 07/08/1991 14:38 UTC by berg@messua.informatik.rwth-aachen.de
  103. # Source directory /tmp_mnt/tmp/.am/baghira/berg
  104. #
  105. # existing files will NOT be overwritten unless -c is specified
  106. #
  107. # This shar contains:
  108. # length  mode       name
  109. # ------ ---------- ------------------------------------------
  110. #   2178 -rw-r--r-- procmail/examples/2procmailrc
  111. #    392 -rw-r--r-- procmail/examples/2rmail
  112. #   1477 -rw-r--r-- procmail/examples/3procmailrc
  113. #    757 -rw-r--r-- procmail/examples/3rmail
  114. #   2883 -rw-r--r-- procmail/examples/advanced
  115. #     37 -rw-r--r-- procmail/examples/forward
  116. #    400 -rw-r--r-- procmail/examples/1rmail
  117. #    602 -rw-r--r-- procmail/examples/1procmailrc
  118. #     47 -rw-r--r-- procmail/include/stdlib.h
  119. #     16 -rw-r--r-- procmail/include/sys/utsname.h
  120. #    252 -rw-r--r-- procmail/include/sysexits.h
  121. #     31 -rw-r--r-- procmail/include/stddef.h
  122. #     48 -rw-r--r-- procmail/include/string.h
  123. #     31 -rw-r--r-- procmail/include/unistd.h
  124. #  20225 -rw-r--r-- procmail/man/procmail.1
  125. #   3441 -rw-r--r-- procmail/man/formail.1
  126. #   2758 -rw-r--r-- procmail/man/lockfile.1
  127. #   2029 -rw-r--r-- procmail/includes.h
  128. #   3739 -rw-r--r-- procmail/README
  129. #   1652 -rw-r--r-- procmail/STYLE
  130. #   1610 -rw-r--r-- procmail/common.c
  131. #   1788 -rw-r--r-- procmail/exopen.c
  132. #   1824 -rw-r--r-- procmail/Manifest
  133. #   2723 -rw-r--r-- procmail/lockfile.c
  134. #   7495 -rw-r--r-- procmail/goodies.c
  135. #  13100 -rw-r--r-- procmail/procmail.c
  136. #   7135 -rw-r--r-- procmail/nonint.c
  137. #   9902 -rw-r--r-- procmail/retint.c
  138. #    188 -rw-r--r-- procmail/shell.h
  139. #   3986 -rw-r--r-- procmail/INSTALL
  140. #   1939 -rw-r--r-- procmail/Makefile
  141. #   3012 -rw-r--r-- procmail/autoconf
  142. #    170 -rw-r--r-- procmail/exopen.h
  143. #   9280 -rw-r--r-- procmail/formail.c
  144. #   2781 -rw-r--r-- procmail/config.h
  145. #   1980 -rw-r--r-- procmail/procmail.h
  146. #   7939 -rw-r--r-- procmail/HISTORY
  147. #   3092 -rw-r--r-- procmail/FEATURES
  148. #
  149. # ============= procmail/examples/2procmailrc ==============
  150. if test ! -d 'procmail'; then
  151.     echo 'x - creating directory procmail'
  152.     mkdir 'procmail'
  153. fi
  154. if test ! -d 'procmail/examples'; then
  155.     echo 'x - creating directory procmail/examples'
  156.     mkdir 'procmail/examples'
  157. fi
  158. if test -f 'procmail/examples/2procmailrc' -a X"$1" != X"-c"; then
  159.     echo 'x - skipping procmail/examples/2procmailrc (File already exists)'
  160. else
  161. echo 'x - extracting procmail/examples/2procmailrc (Text)'
  162. sed 's/^X//' << 'SHAR_EOF' > 'procmail/examples/2procmailrc' &&
  163. X# Please check if all the paths in PATH are reachable, remove the ones that
  164. X# are not.
  165. X
  166. XPATH=$HOME/bin:/usr/bin:/usr/ucb:/bin:/usr/local/bin:
  167. XMAILDIR=$HOME/Mail    # You'd better make sure it exists
  168. XDEFAULT=$MAILDIR/mbox
  169. X            # We don't use a global lockfile here now.
  170. X            # Instead we use local lockfiles everywhere.
  171. X            # This allows mail to arrive in all mailboxes
  172. X            # concurrently, or allows you to read one mailbox
  173. X            # while mail arrives in another.
  174. X
  175. X# The next recipe will split up Digests into their individual messages.
  176. X# Don't do this if you use a global lockfile before this recipe (deadlock)
  177. X
  178. X:
  179. X^Subject:.*Digest
  180. X|formail +1 -d -s procmail
  181. X
  182. XLOGFILE=$MAILDIR/from        # Put it here, in order to avoid logging
  183. X                # the arrival of the digest.
  184. X
  185. X# An alternative and probably more efficient solution to splitting up a digest
  186. X# would be (only works for standard format mailbox files though):
  187. X
  188. X::
  189. X^Subject:.*Other Digest
  190. X|formail +1 -ds cat >>this_lists_mailbox
  191. X
  192. X# Notice the double : in the next recipe, this will cause a lockfile
  193. X# named "$MAILDIR/todd.lock" to be used if and only if this mail is going
  194. X# into the file "todd".
  195. X
  196. X::                # Anything from thf
  197. X^From.*thf\@somewhere.someplace
  198. Xtodd                # will go to $MAILDIR/todd
  199. X
  200. X
  201. X# The next recipe will likewise use $MAILDIR/uunetbox.lock as a lock file.
  202. X
  203. X::                # Anything from people at uunet
  204. X^From.*\@uunet
  205. Xuunetbox            # will go to $MAILDIR/uunetbox
  206. X
  207. X
  208. X# And here the lockfile will be $MAILDIR/henries.lock of course.
  209. X
  210. X::                # Anything from Henry
  211. X^From.*henry
  212. Xhenries                # will go to $MAILDIR/henries
  213. X
  214. X
  215. X# But you can specify any lockfile you want, like "myfile".  The following
  216. X# recipe will use "$MAILDIR/myfile" as the lock file.
  217. X
  218. X::myfile            # All 'questions' will go to
  219. X^Subject:.*questions
  220. Xtoread                # $MAILDIR/toread
  221. X
  222. X# Anything that has not been delivered by now will go to $DEFAULT
  223. X# BUT, since we have not specified any global lock file because we
  224. X# were working with local lock files, and since we are sending the mail to
  225. X# $DEFAULT now, we need to specify a lockfile for that too.  We use
  226. X# a global lockfile for that  (it won't be created until procmail
  227. X# has parsed (needed to parse) up till here).
  228. X
  229. XLOCKFILE=$DEFAULT.lock
  230. SHAR_EOF
  231. chmod 0644 procmail/examples/2procmailrc ||
  232. echo 'restore of procmail/examples/2procmailrc failed'
  233. Wc_c="`wc -c < 'procmail/examples/2procmailrc'`"
  234. test 2178 -eq "$Wc_c" ||
  235.     echo 'procmail/examples/2procmailrc: original size 2178, current size' "$Wc_c"
  236. fi
  237. # ============= procmail/examples/2rmail ==============
  238. if test -f 'procmail/examples/2rmail' -a X"$1" != X"-c"; then
  239.     echo 'x - skipping procmail/examples/2rmail (File already exists)'
  240. else
  241. echo 'x - extracting procmail/examples/2rmail (Text)'
  242. sed 's/^X//' << 'SHAR_EOF' > 'procmail/examples/2rmail' &&
  243. X#!/bin/sh
  244. X#
  245. X# specify the mailbox file you want to read on the command line
  246. X#
  247. XMAILDIR=$HOME/Mail
  248. Xcd $MAILDIR
  249. XLOCKFILE=$1.lock
  250. Xif lockfile -! -r1 $LOCKFILE
  251. Xthen
  252. X echo Mail is currently arriving, please wait...
  253. X while
  254. X   lockfile -! -4 -r2 $LOCKFILE
  255. X do
  256. X echo Mail is still arriving...
  257. X done
  258. Xfi
  259. Xtrap "rm -f $LOCKFILE;exit 0" 0 1 2 3 15
  260. X#
  261. X# Call you favourite mailer here.
  262. X#
  263. X/usr/ucb/mail -f $*
  264. SHAR_EOF
  265. chmod 0644 procmail/examples/2rmail ||
  266. echo 'restore of procmail/examples/2rmail failed'
  267. Wc_c="`wc -c < 'procmail/examples/2rmail'`"
  268. test 392 -eq "$Wc_c" ||
  269.     echo 'procmail/examples/2rmail: original size 392, current size' "$Wc_c"
  270. fi
  271. # ============= procmail/examples/3procmailrc ==============
  272. if test -f 'procmail/examples/3procmailrc' -a X"$1" != X"-c"; then
  273.     echo 'x - skipping procmail/examples/3procmailrc (File already exists)'
  274. else
  275. echo 'x - extracting procmail/examples/3procmailrc (Text)'
  276. sed 's/^X//' << 'SHAR_EOF' > 'procmail/examples/3procmailrc' &&
  277. X# Please check if all the paths in PATH are reachable, remove the ones that
  278. X# are not.
  279. X
  280. XPATH=$HOME/bin:/usr/bin:/global/bin:/usr/ucb:/bin:/usr/local/bin:
  281. XMAILDIR =    $HOME/Mail    # You'd better make sure it exists
  282. XDEFAULT =    $MAILDIR/mbox
  283. XLOGFILE =    $MAILDIR/from
  284. XLOCKFILE=    $HOME/.lockmail
  285. X
  286. X            # This will create a local lockfile named todd.lock
  287. X::            # *if* the condition matches
  288. X^From.*thf
  289. Xtodd
  290. X
  291. XLOCKFILE=$MAILDIR/whatever    # This will remove the global lockfile
  292. X                # $HOME/.lockmail and the new lockfile
  293. X                # will be $MAILDIR/whatever
  294. X
  295. X
  296. X                # The next recipe will
  297. X                # filter out all messages from "at"
  298. X                # jobs and will put them in a terse format
  299. X                # (only the date and the body) in
  300. X                # a file called $MAILDIR/atjunk
  301. X:2fh
  302. X^From root
  303. X^Subject: Output from "at" job
  304. X|egrep "^Date:"
  305. X                # The next recipe will only be used if
  306. X                # the previous one matched
  307. X:A
  308. Xatjunk
  309. X
  310. X
  311. X
  312. XMAILDIR=$HOME/News    # This will change the current directory
  313. X
  314. X
  315. X            # The next recipe will create a local lockfile
  316. X            # named $HOME/News/dustbin.lock (*if* the condition
  317. X            # matches), and will feed the body of the message
  318. X            # through `sort` (sorry, couldn't come up with anything
  319. X            # better :-), after which the result will be
  320. X            # appended to $HOME/News/dustbin
  321. X:b:
  322. X^Subject:.*rubbish
  323. X|sort >>dustbin
  324. X
  325. X            # The next recipe will use the play directory as a MH
  326. X            # folder (of course you need MH to read the mail then)
  327. X:
  328. X^Subject:.*games
  329. Xgames/.
  330. X
  331. X# Anything not delivered by now will go to $HOME/Mail/mbox
  332. SHAR_EOF
  333. chmod 0644 procmail/examples/3procmailrc ||
  334. echo 'restore of procmail/examples/3procmailrc failed'
  335. Wc_c="`wc -c < 'procmail/examples/3procmailrc'`"
  336. test 1477 -eq "$Wc_c" ||
  337.     echo 'procmail/examples/3procmailrc: original size 1477, current size' "$Wc_c"
  338. fi
  339. # ============= procmail/examples/3rmail ==============
  340. if test -f 'procmail/examples/3rmail' -a X"$1" != X"-c"; then
  341.     echo 'x - skipping procmail/examples/3rmail (File already exists)'
  342. else
  343. echo 'x - extracting procmail/examples/3rmail (Text)'
  344. sed 's/^X//' << 'SHAR_EOF' > 'procmail/examples/3rmail' &&
  345. X#!/bin/sh
  346. X#
  347. X# specify the mailbox file you want to read on the command line
  348. X# Use a relative path from your $HOME directory
  349. X#
  350. X# For this kind of chaotic procmailrc there is no uniform neat solution
  351. X# to determine which lockfiles to use.    I'll give just one (suboptimal)
  352. X# solution here.  Use your imagination to extend it :-).
  353. X#
  354. XMAILDIR=$HOME/Mail
  355. Xcd $HOME            # this means all paths are relative to $HOME
  356. XLOCKFILE=$HOME/.lockmail
  357. XLOCKFILE2=$HOME/Mail/whatever
  358. Xif lockfile -! -r1 $LOCKFILE $LOCKFILE2
  359. Xthen
  360. X echo Mail is currently arriving, please wait...
  361. X while
  362. X   lockfile -! -4 -r2 $LOCKFILE $LOCKFILE2
  363. X do
  364. X echo Mail is still arriving...
  365. X done
  366. Xfi
  367. Xtrap "rm -f $LOCKFILE $LOCKFILE2;exit 0" 0 1 2 3 15
  368. X#
  369. X# Call you favourite mailer here.
  370. X#
  371. X/usr/ucb/mail -f $*
  372. SHAR_EOF
  373. chmod 0644 procmail/examples/3rmail ||
  374. echo 'restore of procmail/examples/3rmail failed'
  375. Wc_c="`wc -c < 'procmail/examples/3rmail'`"
  376. test 757 -eq "$Wc_c" ||
  377.     echo 'procmail/examples/3rmail: original size 757, current size' "$Wc_c"
  378. fi
  379. # ============= procmail/examples/advanced ==============
  380. if test -f 'procmail/examples/advanced' -a X"$1" != X"-c"; then
  381.     echo 'x - skipping procmail/examples/advanced (File already exists)'
  382. else
  383. echo 'x - extracting procmail/examples/advanced (Text)'
  384. sed 's/^X//' << 'SHAR_EOF' > 'procmail/examples/advanced' &&
  385. XFor users that have crossmounted mailboxes (i.e. you can access the very
  386. Xsame mail from a whole bunch of different workstations), but on machines
  387. Xwith differing architectures (i.e. you need different executables), and they
  388. Xhave to explicitly use (i.e. the system administrator did not arrange,
  389. Xfor example, /usr/local/bin/procmail to have exactly the right contents
  390. Xdepending on from which machine it is called) two executables of procmail,
  391. XI have the following suggestion to use as a .forward file (examples are for
  392. Xsparc and sun3 architectures):
  393. X
  394. X"|IFS=' ';if /usr/bin/sparc;then exec /home/berg/bin.sun4/procmail;else exec /home/berg/bin.sun3/procmail;fi"
  395. X
  396. Xor alternatively:
  397. X
  398. X"|IFS=' ';exec /home/berg/bin.`/usr/bin/arch`/procmail"
  399. X------------------------------------------------------------------------------
  400. XTo use procmail as a local delivery agent (replacement for /bin/mail)
  401. Xuse the following lines for in sendmail.rc:
  402. Xprocmail /dev/null MAILDIR=/usr/spool/mail DEFAULT=$u ORGMAIL=$u \
  403. XLOCKFILE=$u.lock
  404. X------------------------------------------------------------------------------
  405. X# Now follows an example of what you can do in a procmailrc file
  406. XHELLO=oneword
  407. XHELLO="two words"
  408. XHELLO='two words'    HELLO  =    one\
  409. Xword
  410. XHELLO=two\ words
  411. XHELLO=two\ `echo words`
  412. XHELLO=            # empty
  413. XHELLO            # This will wipe "HELLO" from the environment
  414. XHELLO    =    "three words"\ yes
  415. XHELLO    =    "$HELLO `cat somefile`  "    # Trailing blanks
  416. XHELLO = "wheeee`date`${HELLO} this works too"    HELLO = 'But so does this!'
  417. X
  418. X# As you can see, every trick in the book of /bin/sh programming can be used
  419. X# (and more).
  420. X
  421. XLOCALLOCKFILE = llf
  422. X
  423. X::$LOCALLOCKFILE
  424. Xgrep for this
  425. X|$HELLO            # calls up a program named "But" with 3 arguments
  426. X
  427. X:
  428. Xor for this
  429. X|"$HELLO"        # tries to call up a program named "But so does this!"
  430. X
  431. X:
  432. Xand this
  433. X|$HELLO \
  434. Xthere        # lines can be continued
  435. X###############################################################################
  436. X            # The following will demonstrate advanced use of the
  437. X            # 'A' option.
  438. X:c        # Specify the 'c' otherwise we never arrive at the next recipe
  439. X^From Myfriend
  440. Xevery_message_from_my_friend        # Mailbox for everything he/she writes
  441. X
  442. X:Ac            # Note the 'c' again
  443. X! my_other_friend      # Forward everything Myfriend writes to my_other_friend
  444. X
  445. X:1Ac
  446. X^Subject:.*jokes
  447. X! my_third_friend    # Forward everything Myfriend writes about jokes
  448. X            # to my_third_friend 
  449. X
  450. X:2A
  451. X^Subject:.*parties
  452. X!beach
  453. X! my_third_friend    # Forward everything Myfriend writes about parties,
  454. X            # except beach parties, to my_third_friend
  455. X
  456. X:A            # Provide a mail sink, in order to fake procmail into
  457. X/dev/null        # believing that the mail was absorbed/delivered,
  458. X            # even if the mail was about beach parties :-).
  459. X        # This is not the best solution though, better would be to
  460. X        # rearrange these last five recipes so that the current
  461. X        # number one or two is last, the current number five can be
  462. X        # omitted then.
  463. SHAR_EOF
  464. chmod 0644 procmail/examples/advanced ||
  465. echo 'restore of procmail/examples/advanced failed'
  466. Wc_c="`wc -c < 'procmail/examples/advanced'`"
  467. test 2883 -eq "$Wc_c" ||
  468.     echo 'procmail/examples/advanced: original size 2883, current size' "$Wc_c"
  469. fi
  470. # ============= procmail/examples/forward ==============
  471. if test -f 'procmail/examples/forward' -a X"$1" != X"-c"; then
  472.     echo 'x - skipping procmail/examples/forward (File already exists)'
  473. else
  474. echo 'x - extracting procmail/examples/forward (Text)'
  475. sed 's/^X//' << 'SHAR_EOF' > 'procmail/examples/forward' &&
  476. X"|IFS=' ';exec /global/bin/procmail"
  477. SHAR_EOF
  478. chmod 0644 procmail/examples/forward ||
  479. echo 'restore of procmail/examples/forward failed'
  480. Wc_c="`wc -c < 'procmail/examples/forward'`"
  481. test 37 -eq "$Wc_c" ||
  482.     echo 'procmail/examples/forward: original size 37, current size' "$Wc_c"
  483. fi
  484. # ============= procmail/examples/1rmail ==============
  485. if test -f 'procmail/examples/1rmail' -a X"$1" != X"-c"; then
  486.     echo 'x - skipping procmail/examples/1rmail (File already exists)'
  487. else
  488. echo 'x - extracting procmail/examples/1rmail (Text)'
  489. sed 's/^X//' << 'SHAR_EOF' > 'procmail/examples/1rmail' &&
  490. X#!/bin/sh
  491. X#
  492. X# specify the mailbox file you want to read on the command line
  493. X#
  494. XMAILDIR=$HOME/Mail
  495. Xcd $MAILDIR
  496. XLOCKFILE=$HOME/.lockmail
  497. Xif lockfile -! -r1 $LOCKFILE
  498. Xthen
  499. X echo Mail is currently arriving, please wait...
  500. X while
  501. X   lockfile -! -4 -r2 $LOCKFILE
  502. X do
  503. X echo Mail is still arriving...
  504. X done
  505. Xfi
  506. Xtrap "rm -f $LOCKFILE;exit 0" 0 1 2 3 15
  507. X#
  508. X# Call you favourite mailer here.
  509. X#
  510. X/usr/ucb/mail -f $*
  511. SHAR_EOF
  512. chmod 0644 procmail/examples/1rmail ||
  513. echo 'restore of procmail/examples/1rmail failed'
  514. Wc_c="`wc -c < 'procmail/examples/1rmail'`"
  515. test 400 -eq "$Wc_c" ||
  516.     echo 'procmail/examples/1rmail: original size 400, current size' "$Wc_c"
  517. fi
  518. # ============= procmail/examples/1procmailrc ==============
  519. if test -f 'procmail/examples/1procmailrc' -a X"$1" != X"-c"; then
  520.     echo 'x - skipping procmail/examples/1procmailrc (File already exists)'
  521. else
  522. echo 'x - extracting procmail/examples/1procmailrc (Text)'
  523. sed 's/^X//' << 'SHAR_EOF' > 'procmail/examples/1procmailrc' &&
  524. X# Please check if all the paths in PATH are reachable, remove the ones that
  525. X# are not.
  526. X
  527. XPATH=$HOME/bin:/usr/bin:/usr/ucb:/bin:/usr/local/bin:
  528. XMAILDIR=$HOME/Mail    # You'd better make sure it exists
  529. XDEFAULT=$MAILDIR/mbox
  530. XLOGFILE=$MAILDIR/from
  531. XLOCKFILE=$HOME/.lockmail
  532. X
  533. X:                # Anything from thf
  534. X^From.*thf\@somewhere.someplace
  535. Xtodd                # will go to $MAILDIR/todd
  536. X
  537. X:                # Anything from people at uunet
  538. X^From.*\@uunet
  539. Xuunetbox            # will go to $MAILDIR/uunetbox
  540. X
  541. X:                # Anything from Henry
  542. X^From.*henry
  543. Xhenries                # will go to $MAILDIR/henries
  544. X
  545. X# Anything that has not been delivered by now will go to $DEFAULT
  546. SHAR_EOF
  547. chmod 0644 procmail/examples/1procmailrc ||
  548. echo 'restore of procmail/examples/1procmailrc failed'
  549. Wc_c="`wc -c < 'procmail/examples/1procmailrc'`"
  550. test 602 -eq "$Wc_c" ||
  551.     echo 'procmail/examples/1procmailrc: original size 602, current size' "$Wc_c"
  552. fi
  553. # ============= procmail/include/stdlib.h ==============
  554. if test ! -d 'procmail/include'; then
  555.     echo 'x - creating directory procmail/include'
  556.     mkdir 'procmail/include'
  557. fi
  558. if test -f 'procmail/include/stdlib.h' -a X"$1" != X"-c"; then
  559.     echo 'x - skipping procmail/include/stdlib.h (File already exists)'
  560. else
  561. echo 'x - extracting procmail/include/stdlib.h (Text)'
  562. sed 's/^X//' << 'SHAR_EOF' > 'procmail/include/stdlib.h' &&
  563. Xvoid*malloc(),*realloc();
  564. Xconst char*getenv();
  565. SHAR_EOF
  566. chmod 0644 procmail/include/stdlib.h ||
  567. echo 'restore of procmail/include/stdlib.h failed'
  568. Wc_c="`wc -c < 'procmail/include/stdlib.h'`"
  569. test 47 -eq "$Wc_c" ||
  570.     echo 'procmail/include/stdlib.h: original size 47, current size' "$Wc_c"
  571. fi
  572. # ============= procmail/include/sys/utsname.h ==============
  573. if test ! -d 'procmail/include/sys'; then
  574.     echo 'x - creating directory procmail/include/sys'
  575.     mkdir 'procmail/include/sys'
  576. fi
  577. if test -f 'procmail/include/sys/utsname.h' -a X"$1" != X"-c"; then
  578.     echo 'x - skipping procmail/include/sys/utsname.h (File already exists)'
  579. else
  580. echo 'x - extracting procmail/include/sys/utsname.h (Text)'
  581. sed 's/^X//' << 'SHAR_EOF' > 'procmail/include/sys/utsname.h' &&
  582. X#define NOuname
  583. SHAR_EOF
  584. chmod 0644 procmail/include/sys/utsname.h ||
  585. echo 'restore of procmail/include/sys/utsname.h failed'
  586. Wc_c="`wc -c < 'procmail/include/sys/utsname.h'`"
  587. test 16 -eq "$Wc_c" ||
  588.     echo 'procmail/include/sys/utsname.h: original size 16, current size' "$Wc_c"
  589. fi
  590. # ============= procmail/include/sysexits.h ==============
  591. if test -f 'procmail/include/sysexits.h' -a X"$1" != X"-c"; then
  592.     echo 'x - skipping procmail/include/sysexits.h (File already exists)'
  593. else
  594. echo 'x - extracting procmail/include/sysexits.h (Text)'
  595. sed 's/^X//' << 'SHAR_EOF' > 'procmail/include/sysexits.h' &&
  596. X        /* Standard exit codes, original list maintained
  597. X           by Eric Allman (eric@berkeley, ucbvax!eric)     */
  598. X#define EX_OK        0
  599. X#define EX_USAGE    64
  600. X#define EX_UNAVAILABLE    69
  601. X#define EX_OSERR    71
  602. X#define EX_OSFILE    72
  603. X#define EX_CANTCREAT    73
  604. X#define EX_IOERR    74
  605. SHAR_EOF
  606. chmod 0644 procmail/include/sysexits.h ||
  607. echo 'restore of procmail/include/sysexits.h failed'
  608. Wc_c="`wc -c < 'procmail/include/sysexits.h'`"
  609. test 252 -eq "$Wc_c" ||
  610.     echo 'procmail/include/sysexits.h: original size 252, current size' "$Wc_c"
  611. fi
  612. # ============= procmail/include/stddef.h ==============
  613. if test -f 'procmail/include/stddef.h' -a X"$1" != X"-c"; then
  614.     echo 'x - skipping procmail/include/stddef.h (File already exists)'
  615. else
  616. echo 'x - extracting procmail/include/stddef.h (Text)'
  617. sed 's/^X//' << 'SHAR_EOF' > 'procmail/include/stddef.h' &&
  618. X/* Intentionally left empty */
  619. SHAR_EOF
  620. chmod 0644 procmail/include/stddef.h ||
  621. echo 'restore of procmail/include/stddef.h failed'
  622. Wc_c="`wc -c < 'procmail/include/stddef.h'`"
  623. test 31 -eq "$Wc_c" ||
  624.     echo 'procmail/include/stddef.h: original size 31, current size' "$Wc_c"
  625. fi
  626. # ============= procmail/include/string.h ==============
  627. if test -f 'procmail/include/string.h' -a X"$1" != X"-c"; then
  628.     echo 'x - skipping procmail/include/string.h (File already exists)'
  629. else
  630. echo 'x - extracting procmail/include/string.h (Text)'
  631. sed 's/^X//' << 'SHAR_EOF' > 'procmail/include/string.h' &&
  632. X#include <strings.h>
  633. X
  634. Xchar*strchr(),*strpbrk();
  635. SHAR_EOF
  636. chmod 0644 procmail/include/string.h ||
  637. echo 'restore of procmail/include/string.h failed'
  638. Wc_c="`wc -c < 'procmail/include/string.h'`"
  639. test 48 -eq "$Wc_c" ||
  640.     echo 'procmail/include/string.h: original size 48, current size' "$Wc_c"
  641. fi
  642. # ============= procmail/include/unistd.h ==============
  643. if test -f 'procmail/include/unistd.h' -a X"$1" != X"-c"; then
  644.     echo 'x - skipping procmail/include/unistd.h (File already exists)'
  645. else
  646. echo 'x - extracting procmail/include/unistd.h (Text)'
  647. sed 's/^X//' << 'SHAR_EOF' > 'procmail/include/unistd.h' &&
  648. X/* Intentionally left empty */
  649. SHAR_EOF
  650. chmod 0644 procmail/include/unistd.h ||
  651. echo 'restore of procmail/include/unistd.h failed'
  652. Wc_c="`wc -c < 'procmail/include/unistd.h'`"
  653. test 31 -eq "$Wc_c" ||
  654.     echo 'procmail/include/unistd.h: original size 31, current size' "$Wc_c"
  655. fi
  656. # ============= procmail/man/procmail.1 ==============
  657. if test ! -d 'procmail/man'; then
  658.     echo 'x - creating directory procmail/man'
  659.     mkdir 'procmail/man'
  660. fi
  661. if test -f 'procmail/man/procmail.1' -a X"$1" != X"-c"; then
  662.     echo 'x - skipping procmail/man/procmail.1 (File already exists)'
  663. else
  664. echo 'x - extracting procmail/man/procmail.1 (Text)'
  665. sed 's/^X//' << 'SHAR_EOF' > 'procmail/man/procmail.1' &&
  666. X.de Id
  667. X.ds Rv \\$3
  668. X.ds Dt \\$4
  669. X..
  670. X.Id $Id: procmail.1,v 2.6 1991/07/04 17:14:45 berg Rel $
  671. X.de Sh
  672. X.br
  673. X.ne 9
  674. X.SH "\\$1"
  675. X..
  676. X.de Ss
  677. X.br
  678. X.ne 9
  679. X.SS "\\$1"
  680. X..
  681. X.de Tp
  682. X.br
  683. X.ne 9
  684. X.TP "\\$1"
  685. X..
  686. X.TH PROCMAIL 1 \*(Dt BuGless
  687. X.SH NAME
  688. Xprocmail \- autonomous mail processor
  689. X.SH SYNOPSIS
  690. X.B procmail
  691. X.RB [ " \-\fR[\fPd\fR|\fPp\fR|\fPv\fR]\fP " ]
  692. X.RI [ " parameter\fB=\fPvalue " | " rcfile " ]
  693. X\&.\|.\|.
  694. X.Sh DESCRIPTION
  695. X.LP
  696. XFor a quick start, see
  697. X.B NOTES
  698. Xat the end.
  699. X.LP
  700. X.B procmail
  701. Xshould be invoked automatically over the
  702. X.B .forward
  703. Xfile mechanism as soon as mail arrives.  When invoked, it first sets some
  704. Xenvironment variables to default values, reads the mail message from stdin
  705. Xuntil an EOF, separates the body from the header, and then, if no command
  706. Xline arguments are present, it starts to look for a file named
  707. X.B .procmailrc
  708. Xin your home directory.  According to the processing recipes in this file,
  709. Xthe mail message that just arrived gets distributed into the right folder
  710. X(and more).
  711. X.Ss Defaults
  712. X.Tp 2.2i
  713. X.B "USER, HOME and SHELL"
  714. XYour (the recipient's) defaults
  715. X.Tp
  716. X.B SHELLMETAS
  717. X"'`&#()[]*?|<>~;!\\
  718. X.Tp
  719. X.B SHELLFLAGS
  720. X-c
  721. X.Tp
  722. X.B MAILDIR
  723. X$HOME
  724. X.Tp
  725. X.BR DEFAULT
  726. X$MAILDIR/.mailbox
  727. X.Tp
  728. X.B ORGMAIL
  729. X/var/spool/mail/$USER
  730. X.Tp
  731. X.B MSGPREFIX
  732. Xmsg.
  733. X.Tp
  734. X.B GREP
  735. X/usr/bin/egrep
  736. X.Tp
  737. X.B SENDMAIL
  738. X/usr/lib/sendmail
  739. X.Tp
  740. X.B LOCKEXT
  741. X\&.lock
  742. X.Ss Environment
  743. X.LP
  744. XBefore you get lost in the multitude of environment variables, keep in mind
  745. Xthat all of them have reasonable defaults.
  746. X.Tp 1.2i
  747. X.B MAILDIR
  748. XCurrent directory while procmail is executing (that means that all paths
  749. Xare relative to $MAILDIR).
  750. X.Tp
  751. X.B DEFAULT
  752. XDefault
  753. X.B mailbox
  754. Xfile (if not told otherwise, procmail will dump mail in this mailbox).
  755. X.Tp
  756. X.B MSGPREFIX
  757. XFilename prefix that is used when delivering to a directory (not used when
  758. Xdelivering to a MH directory).
  759. X.Tp
  760. X.B LOGFILE
  761. XAll incoming messages will be logged here with their `From ' and `Subject:'
  762. Xlines in the header, and an additional line specifying what folder it
  763. Xfinally went to and how long (in bytes) the message was.  This file will
  764. Xalso contain any error or diagnostic messages from procmail
  765. X(normally none :-) or any other programs started by procmail.  If this file
  766. Xis not specified it defaults to
  767. X.BR /dev/null .
  768. X.Tp
  769. X.B LOG
  770. XAnything assigned to this variable will be echoed in $LOGFILE.
  771. X.Tp
  772. X.B ORGMAIL
  773. XUsually the system mailbox (\fBOR\fPi\fBG\fPinal \fBMAIL\fPbox).  If, for
  774. Xsome obscure reason (like `\fBfilesystem full\fP') the mail could not be
  775. Xdelivered, then this mailbox will be the last resort.  If procmail
  776. Xfails to save the mail in here (deep, deep trouble :-), then the mail
  777. Xwill bounce back to the sender.
  778. X.Tp
  779. X.B LOCKFILE
  780. XGlobal semaphore file.  If this file already exists, procmail
  781. Xwill wait until it has gone before proceeding, and will create it itself
  782. X(cleaning it up when ready, of course).  If more than one
  783. X.I lockfile
  784. Xare specified, then the previous one will be removed before trying to create
  785. Xthe new one.
  786. X.Tp
  787. X.B LOCKEXT
  788. XDefault extension that is appended to a destination file to determine
  789. Xwhat local
  790. X.I lockfile
  791. Xto use (only if turned on, on a per-recipe basis).
  792. X.Tp
  793. X.B LOCKSLEEP
  794. XNumber of seconds procmail will sleep before retrying on a
  795. X.I lockfile
  796. X(if it already existed); if not specified, it defaults to eight seconds.
  797. X.Tp
  798. X.B LOCKTIMEOUT
  799. XNumber of seconds that have to have passed since a
  800. X.I lockfile
  801. Xwas last modified/created before procmail decides that this must be an
  802. Xerroneously leftover lockfile that can be removed by force now.  If zero,
  803. Xthen no timeout will be used and procmail will wait forever until the
  804. Xlockfile is removed; if not specified, it defaults to one hour.  This variable
  805. Xis usefull to prevent indefinite hangups of
  806. X.BR sendmail /procmail.
  807. X.Tp
  808. X.B TIMEOUT
  809. XNumber of seconds that have to have passed before procmail decides that
  810. Xsome child it started must be hanging.  The offending program will receive
  811. Xa SIGTERM from procmail, and processing of the rcfile will continue. If zero,
  812. Xthen no timeout will be used and procmail will wait forever until the child
  813. Xhas terminated; if not specified, it defaults to 59 minutes.
  814. X.Tp
  815. X.B HOST
  816. XIf this is not the
  817. X.I hostname
  818. Xof the machine, processing of the current
  819. X.I rcfile
  820. Xwill immediately cease. If other rcfiles were specified on the
  821. Xcommand line, processing will continue with the next one.  If all rcfiles
  822. Xare exhausted, the program will terminate, but will not generate an error
  823. X(i.e. to the mailer it will seem that the mail has been delivered).
  824. X.Tp
  825. X.B UMASK
  826. XThe name says it all (if it doesn't, then forget about this one :-).  It
  827. Xis taken as an
  828. X.B octal
  829. Xnumber.  If not specified, it defaults to 077.
  830. X.Tp
  831. X.B GREP
  832. XThe program that gets called for parsing regular expressions.
  833. X.br
  834. XIt is called as: "$GREP" -e "$*" [-i];
  835. X.Tp
  836. X.B SHELLMETAS
  837. XIf any of the characters in SHELLMETAS appears in the line specifying
  838. Xa filter or program, the line will be fed to $SHELL
  839. Xinstead of being executed directly.
  840. X.Tp
  841. X.B SHELLFLAGS
  842. XAny invocation of $SHELL will be like:
  843. X.br
  844. X"$SHELL" "$SHELLFLAGS" "$*";
  845. X.Tp
  846. X.B SENDMAIL
  847. XIf you're not using the
  848. X.I forwarding
  849. Xfacility don't worry about this one.  It specifies the program being
  850. Xcalled to forward any mail.
  851. X.br
  852. XIt gets invoked as: "$SENDMAIL" $@;
  853. X.Tp
  854. X.B NORESRETRY
  855. XNumber of retries that are to be made if any `\fBprocess table full\fP',
  856. X`\fBfile table full\fP', `\fBout of memory\fP' or
  857. X`\fBout of swap space\fP' error should occur.  If this number is negative,
  858. Xthen procmail will retry indefinitely; if not specified, it defaults to two
  859. Xtimes.  The retries occur with a $SUSPEND second interval.  The idea behind
  860. Xthis is, that if the
  861. X.I swap
  862. X.I space
  863. Xhas been exhausted or the
  864. X.I process
  865. X.I table
  866. Xis full, usually several other programs will either detect this
  867. Xand abort or crash 8-), and thereby freeing valuable
  868. X.I resources
  869. Xfor procmail.
  870. X.Tp
  871. X.B SUSPEND
  872. XNumber of seconds that procmail will pause if it has to wait for something
  873. Xthat is currently unavailable (memory, fork, etc.); if not specified, it will
  874. Xdefault to 16 seconds.  See also:
  875. X.BR LOCKSLEEP .
  876. X.Tp
  877. X.B LINEBUF
  878. XLength of the internal line buffers, cannot be set smaller than 128.  All lines
  879. Xread from the rcfile
  880. X.RI ( not
  881. Xthe mail itself, which can have arbitrary line lengths, or could be a binary
  882. Xfile for that matter) should not exceed $LINEBUF characters before and after
  883. Xexpansion.  If not specified, it defaults to 2048.
  884. X.Sh OPTIONS
  885. X.Tp 0.5i
  886. X.B \-d
  887. XTurns on debugging mode.  procmail will log every little thing it
  888. Xdoes to $LOGFILE.  Very usefull if you wonder if procmail parses
  889. Xyour rcfile file right.
  890. X.Tp
  891. X.B \-p
  892. XPreserve any old environment.  Normally procmail clears the environment
  893. Xupon startup. However, in any case: any default values will override any
  894. Xpreexisting environment variables, i.e. procmail will not pay any attention
  895. Xto any predefined environment variables, it will happily overwrite them
  896. Xwith his own defaults.
  897. X.Tp
  898. X.B \-v
  899. Xprocmail will print its version number and exit.
  900. X.Sh ARGUMENTS
  901. X.LP
  902. XAny arguments containing an '=' are considered to be environment variable
  903. Xassignments, they will
  904. X.I all
  905. Xbe evaluated after the default values have been
  906. Xassigned and before the first rcfile is opened.
  907. X.LP
  908. XAny other arguments are presumed to be rcfile paths (absolute or relative to
  909. X$HOME); procmail will start with the first one it finds on the command line.
  910. XThe following ones will only be parsed if the preceding ones have a not
  911. Xmatching HOST-directive entry, or in case they should not exist.
  912. X.LP
  913. XIf no rcfiles are specified, it looks for
  914. X.BR $HOME/.procmailrc .
  915. XIf not even that can be found processing will continue according to
  916. Xthe default settings of the environment variables and the ones specified
  917. Xon the command line.
  918. X.Sh "RCFILE FORMAT"
  919. X.LP
  920. XEnvironment variable
  921. X.B assignments
  922. Xand
  923. X.B recipes
  924. Xcan be freely intermixed in the rcfile. If any environment variable has
  925. Xa special meaning to procmail, it will be used appropiately the moment
  926. Xit is parsed. (i.e. you can change the current directory whenever you
  927. Xwant by specifying a new
  928. X.BR MAILDIR ,
  929. Xswitch lockfiles by specifying a new
  930. X.B LOCKFILE
  931. X(usually one won't need this particular application though), change
  932. Xthe umask at any time, etc., the possibilities are endless :-).
  933. X.LP
  934. XThe assignments and substitutions of these environment variables are handled
  935. Xexactly like in
  936. X.BR sh (1)
  937. X(that includes all possible quotes and escapes),
  938. Xwith the added bonus that blanks around the '=' sign are ignored and that,
  939. Xif an environment variable appears without a trailing '=', it will be
  940. Xremoved from the environment.
  941. X.LP
  942. X.Ss Comments
  943. XA word beginning with # and all the following characters up to a NEWLINE
  944. Xare ignored.
  945. X.Ss Recipes
  946. X.LP
  947. XA line starting with ':' marks the beginning of a recipe.  It has the
  948. Xfollowing format:
  949. X.LP
  950. X:
  951. X.RI [ " number " ]
  952. X.RI [ " options " ]
  953. X.RI "[ : [" " locallockfile " "] ]"
  954. X.LP
  955. XThe
  956. X.I number
  957. Xis optional (defaults to 1) and specifies the number of conditionals
  958. Xfollowing this line.  Conditionals are complete lines that are passed on to
  959. X$GREP
  960. X.BR literally .
  961. XIf a conditional starts with an '!', the condition is inverted.  If you really
  962. Xwant the conditional to start with an '!', precede the '!' by a '\\'.
  963. XConditionals are anded; if
  964. X.I number
  965. Xis zero, then the condition is always true and no conditionals are expected
  966. Xnext.
  967. X.LP
  968. X.I Options
  969. Xcan be any of the following (don't insert spaces in between the options):
  970. X.Tp 0.5i
  971. X.B H
  972. XFeed the header to $GREP (default)
  973. X.Tp
  974. X.B B
  975. XFeed the body to $GREP
  976. X.Tp
  977. X.B D
  978. XTell $GREP to distinguish between upper and lower case (defaults to ignoring
  979. Xcase)
  980. X.Tp
  981. X.B A
  982. XThis recipe will depend on the last recipe without the 'A' option.  This
  983. Xallows you to chain actions that depend on a common condition.  The number
  984. Xof conditionals that are expected to follow default to none.
  985. X.Tp
  986. X.B h
  987. XFeed the header to the pipe (default)
  988. X.Tp
  989. X.B b
  990. XFeed the body to the pipe (default)
  991. X.Tp
  992. X.B f
  993. XConsider the pipe as a filter (ignored if a file)
  994. X.Tp
  995. X.B c
  996. XContinue processing rcfile even if this recipe matches (not needed if 'f'
  997. Xspecified)
  998. X.Tp
  999. X.B w
  1000. XWait for the filter or program to finish and check its exitcode (normally
  1001. Xignored); if the filter is unsuccessfull, then the text will
  1002. Xnot have been filtered.  This option is also recommended if you specified any
  1003. X.I locallockfile
  1004. Xon this recipe.
  1005. X.Ss "Local lockfile"
  1006. X.LP
  1007. XIf you put a second ':' on the first recipe line, then procmail will use a
  1008. X.I locallockfile
  1009. X(for this recipe only).  You optionally can specify the locallockfile
  1010. Xto use; if you don't however, procmail
  1011. Xwill use the filename specified as the destination (or the filename
  1012. Xfollowing the first '>>') and will append $LOCKEXT to it.
  1013. X.Ss "Recipe destination"
  1014. X.LP
  1015. XThe next line can start with the following characters:
  1016. X.Tp
  1017. X.B !
  1018. XForwards to all the specified mail addresses.
  1019. X.Tp
  1020. X.B |
  1021. XStarts the specified program, possibly in $SHELL if any
  1022. Xof the characters $SHELLMETAS are found (that means comments normally force
  1023. Xthis line to be processed by the shell).
  1024. X.LP
  1025. XAnything else will be taken as a mailbox name (either a filename or a
  1026. Xdirectory, absolute or relative to the current directory (see $MAILDIR)).
  1027. XIf it is a filename (or nonexistent), the mail will be appended to it.  If
  1028. Xit is a directory, the mail will be delivered to a newly created, guaranteed
  1029. Xto be unique, file named $MSGPREFIX* in the specified directory.  If the
  1030. Xdirectory name ends in "/.", then this directory is presumed to be a MH
  1031. Xfolder; i.e. procmail will use the lowest number it finds available.
  1032. X.Sh EXAMPLES
  1033. X.LP
  1034. XSome example recipes are listed below:
  1035. X.br
  1036. XSort out all mail to mailling list scuba-dive.
  1037. X.RS
  1038. X.LP
  1039. X:
  1040. X.br
  1041. X^TOscuba
  1042. X.br
  1043. Xscubafile
  1044. X.LP
  1045. X.RE
  1046. XForward all mail from peter about compilers to william (and keep a copy
  1047. Xof it here in petcompil).
  1048. X.RS
  1049. X.LP
  1050. X:2 bc
  1051. X.br
  1052. X^From.*peter
  1053. X.br
  1054. X^Subject:.*compilers
  1055. X.br
  1056. X! william@somewhere.edu
  1057. X.br
  1058. X:A
  1059. X.br
  1060. Xpetcompil
  1061. X.br
  1062. X.RE
  1063. X.LP
  1064. XAdd the headers of all messages that didn't come from the postmaster
  1065. Xto your private header collection (for
  1066. Xstatistics or mail debugging); and use the lockfile `headc.lock'.  In order
  1067. Xto make sure the lockfile is not removed until the pipe has finished,
  1068. Xyou have to specify option 'w'; otherwise the lockfile would be removed as
  1069. Xsoon as the pipe has accepted the mail.
  1070. X.RS
  1071. X.LP
  1072. X:hwc:
  1073. X.br
  1074. X!From +(postmaster|Mailer)
  1075. X.br
  1076. X| uncompress headc.Z; cat >>headc; compress headc
  1077. X.RE
  1078. X.Sh CAVEATS
  1079. X.LP
  1080. XIf you don't explicitly tell procmail to wait (recipe option 'w') for a
  1081. Xprogram to finish, it won't wait and will terminate early (not knowing if
  1082. Xthe program returns success).  That also means that any locallockfile on this
  1083. Xrecipe might get removed
  1084. X.I before
  1085. Xthe program has terminated.
  1086. X.LP
  1087. XContinued lines in a recipe that are to be executed are concatenated
  1088. X.I before
  1089. Xbeing parsed, hence
  1090. X.I any
  1091. Xbackslash-newline combinations in them are removed regardless.
  1092. X.LP
  1093. XDon't put comments on the lines in a recipe that get fed to $GREP,
  1094. Xthese lines are fed to $GREP
  1095. X.IR literally .
  1096. X(Except for any
  1097. X.I leading
  1098. X\`!' or `\\', it will be stripped.
  1099. XPrecede it by a `\\' if you want it to be taken literally too.)
  1100. X.LP
  1101. XWatch out for deadlocks when doing unhealthy things like forwarding mail
  1102. Xto your own account.  Deadlocks can be broken by proper use of
  1103. X.BR LOCKTIMEOUT .
  1104. X.LP
  1105. XAny default values that procmail has for some environment variables will
  1106. X.B always
  1107. Xoverride the ones that were already defined.  If you really want to
  1108. Xoverride the defaults, you either have to put them in the
  1109. X.B rcfile
  1110. Xor in the command line as arguments.
  1111. X.Sh FILES
  1112. X.PD 0
  1113. X.Tp 2.2i
  1114. X.B /etc/passwd
  1115. Xto get the recipients USER, HOME and SHELL variable defaults
  1116. X.Tp
  1117. X.B /usr/spool/mail/$USER
  1118. Xdefault last resort to put mail
  1119. X.Tp
  1120. X.B $HOME/.procmailrc
  1121. Xdefault rc file
  1122. X.Tp
  1123. X.B $HOME/.mailbox
  1124. Xdefault mailbox
  1125. X.Tp
  1126. X.B /usr/spool/mail/$USER.lock
  1127. Xlockfile for standard system mail directory (not used by
  1128. X.B procmail
  1129. Xunless you explicitly tell it to)
  1130. X.Tp
  1131. X.B /usr/lib/sendmail
  1132. Xdefault mail forwarder
  1133. X.Tp
  1134. X.B /usr/bin/egrep
  1135. Xdefault regular expression parser
  1136. X.PD
  1137. X.Sh "SEE ALSO"
  1138. X.LP
  1139. X.BR sh (1),
  1140. X.BR csh (1),
  1141. X.BR mail (1),
  1142. X.BR binmail (1),
  1143. X.BR uucp (1C),
  1144. X.BR aliases (5),
  1145. X.BR sendmail (8),
  1146. X.BR egrep (1V),
  1147. X.BR lockfile (1),
  1148. X.BR formail (1)
  1149. X.Sh DIAGNOSTICS
  1150. X.Tp 2.3i
  1151. XError while writing to "x"
  1152. XNonexistent subdirectory, no write permission, pipe died or disk full.
  1153. X.Tp
  1154. XSkipped: "x"
  1155. XCouldn't do anything with "x" in the rcfile (syntax error), ignoring it.
  1156. X.Tp
  1157. XFailed forking "x"
  1158. XProcess table is full (and NORESRETRY has been exhausted).
  1159. X.Tp
  1160. XProgram failure of "x"
  1161. XProgram that was started by procmail didn't return EX_OK (=0).
  1162. X.Tp
  1163. XFailed to execute "x"
  1164. XProgram not in path, or not executable.
  1165. X.Tp
  1166. XCouldn't unlock "x"
  1167. XLockfile was already gone, or write permission to the directory were the
  1168. Xlockfile is has been denied.
  1169. X.Tp
  1170. XOut of memory
  1171. XThe system is out of swap space (and NORESRETY has been exhausted).
  1172. X.Tp
  1173. XLockfailure on "x"
  1174. XCan only occur if you specify some real weird (and illegal) lockfilenames
  1175. Xor if the
  1176. X.B lockfile
  1177. Xcould not be created because of insufficient permissions or noexistent
  1178. Xsubdirectories.
  1179. X.Tp
  1180. XForcing lock on "x"
  1181. XSpecified
  1182. X.B lockfile
  1183. Xis going to be removed by force because of a timeout (see also:
  1184. X.BR LOCKTIMEOUT ).
  1185. X.Tp
  1186. XForced unlock denied on "x"
  1187. XNo write permission in the directory where
  1188. X.B lockfile
  1189. Xresides, or more than one procmail trying to force a lock at exactly the same
  1190. Xtime.
  1191. X.Tp
  1192. XTimeout, terminating "x"
  1193. XTimeout has occurred on program/filter "x".
  1194. X.Tp
  1195. XTerminating prematurely whilst waiting for .\|.\|.
  1196. XProcmail received a signal while it was waiting for .\|.\|.
  1197. X.Tp
  1198. XRescue of unfiltered data succeeded/failed
  1199. XA filter returned unsuccessfully, procmail tried to get back the original text.
  1200. X.Tp
  1201. XMail bounced
  1202. XProcmail hasn't been able to deliver the mail correctly.
  1203. X.Tp
  1204. XExceeded LINEBUF
  1205. XBuffer overflow detected, LINEBUF was too small, memory might be corrupted.
  1206. X.Tp
  1207. XBad substitution of "x"
  1208. XNot a valid environment variable name specified.
  1209. X.Tp
  1210. XUnexpected EOL
  1211. XMissing closing quote, or trying to escape EOF.
  1212. X.Sh "DIAGNOSTICS with -d option"
  1213. X.Tp 2.3i
  1214. XMatch on "x"
  1215. XConditional matched
  1216. X.Tp
  1217. XNo match on "x"
  1218. XConditional didn't match, recipe skipped
  1219. X.Tp
  1220. XAssigning "x"
  1221. XEnvironment variable assignment
  1222. X.Tp
  1223. XOpening "x"
  1224. XOpening file "x" for appending
  1225. X.Tp
  1226. XLocking "x"
  1227. XCreating lockfile "x"
  1228. X.Tp
  1229. XUnlocking "x"
  1230. XRemoving lockfile "x" again
  1231. X.Tp
  1232. XExecuting "x"
  1233. XStarting program "x"
  1234. X.Tp
  1235. XRcfile: "x"
  1236. XRcfile changed to "x"
  1237. X.Tp
  1238. XHOST mismatched "x"
  1239. XThis host was called "x", HOST contained something else
  1240. X.PD
  1241. X.Sh WARNINGS
  1242. X.LP
  1243. XYou should create a shell script that uses
  1244. X.BR lockfile (1)
  1245. Xbefore invoking your mail shell on any mailbox file other than the system
  1246. Xmailbox (unless of course, your mail shell uses the same lockfiles (local
  1247. Xor global) you specified in your rcfile).
  1248. X.LP
  1249. XIn the unlikely event that you absolutely need to kill
  1250. Xprocmail before it has finished, first try and use
  1251. Xthe regular kill command
  1252. X.RB ( SIGTERM ),
  1253. Xotherwise some
  1254. X.I lockfiles
  1255. Xmight not get removed.
  1256. X.Sh BUGS
  1257. X.LP
  1258. XThe only substitutions of environment variables that can be handled by
  1259. Xprocmail itself are of the type $name, ${name}, $$ and $-; whereas $- will
  1260. Xbe substituted by the name of the last folder delivered to.
  1261. X.LP
  1262. XAfter a lockfile is removed by force, a suspension of $SUSPEND seconds
  1263. Xis taken into account, in order to prevent the inadvertent immediate removal
  1264. Xof any newly created lockfile by another program.
  1265. X.LP
  1266. XA line buffer of length $LINEBUF is used when processing the
  1267. X.IR rcfile ,
  1268. Xany expansions
  1269. X.B have
  1270. Xto fit within this limit; if they don't, behaviour is undefined.
  1271. X.LP
  1272. Xprocmail uses the regular kill command
  1273. X.RB ( SIGTERM ),
  1274. Xto terminate any runaway filter, but it does not check if the filter responds
  1275. Xto that signal and it only sends it to the filter itself, not to any of its
  1276. Xchildren.
  1277. X.LP
  1278. XIf the global lockfile has a
  1279. X.I relative
  1280. Xpath, and the current directory
  1281. Xis not the same as when the global lockfile was created, then the global
  1282. Xlockfile will not be removed if procmail exits at that point (remedy:
  1283. Xuse
  1284. X.I absolute
  1285. Xpaths to specify global lockfiles).
  1286. X.LP
  1287. XSome braindamaged mailers want all lines that start with `From ' to be escaped,
  1288. Xprocmail only escapes those that could really be dangerous; to support those
  1289. Xother mailers you should consider using
  1290. X.BR formail (1)
  1291. Xas a filter for all your mail.
  1292. X.Sh MISCELLANEOUS
  1293. X.LP
  1294. XAny program executed from within procmail will be searched for along the PATH.
  1295. XIt is advisable however, to
  1296. Xspecify an absolute path for $GREP, because it gets executed fairly often.
  1297. X.LP
  1298. XWhitespace is ignored in the rcfile, except between the flags and on the
  1299. Xlines that are fed to $GREP; i.e. you can indent everything except the
  1300. Xcondition lines.
  1301. X.LP
  1302. XIf the regular expression starts with `\fB^TO\fP' it will be substituted by
  1303. X`\fB^(To|Cc|Apparently-To):.*\fP', which should catch all destination
  1304. Xspecifications.
  1305. X.LP
  1306. XAny lines in the body of the message that look like postmarks are prepended
  1307. Xwith '>' (disarms bogus mailheaders).  The regular expression that is used
  1308. Xto search for these postmarks is:
  1309. X.RS
  1310. X\\n\\nFrom +[^\\t\\n ]+ +[^\\n\\t]
  1311. X.RE
  1312. X.LP
  1313. XShould the uid procmail is running under, have no corresponding /etc/passwd
  1314. Xentry, then HOME will default to /tmp, USER will default to #uid.
  1315. X.LP
  1316. XWhen delivering to directories (or to MH folders) you
  1317. X.B don't
  1318. Xneed to use lockfiles to prevent several concurrently running procmail
  1319. Xprograms from messing up.
  1320. X.LP
  1321. XDelivering to MH folders is slightly more time consuming than delivering
  1322. Xto normal directories or mailboxes, because procmail has to search for
  1323. Xthe first available number (instead of having the filename immediately
  1324. Xavailable).
  1325. X.Sh NOTES
  1326. X.LP
  1327. XFor
  1328. X.I really
  1329. Xcomplicated processing you can even consider calling
  1330. X.B procmail
  1331. Xrecursively.
  1332. X.br
  1333. X.ne 20
  1334. X.LP
  1335. XYour $HOME/.forward (beware, it
  1336. X.B has
  1337. Xto be world readable) file should contain (include the single and double
  1338. Xquotes,
  1339. X.I must
  1340. Xbe an
  1341. X.I absolute
  1342. Xpath):
  1343. X.LP
  1344. X"|IFS=' ';exec /usr/local/bin/procmail"
  1345. X.br
  1346. X.Ss "A sample small .procmailrc:"
  1347. X.br
  1348. XPATH=/bin:/usr/bin:/usr/local/bin
  1349. X.br
  1350. XMAILDIR=$HOME/Mail      #you'd better make sure it exists
  1351. X.br
  1352. XDEFAULT=$MAILDIR/mbox
  1353. X.br
  1354. XLOGFILE=$MAILDIR/from
  1355. X.br
  1356. XLOCKFILE=$HOME/.lockmail
  1357. X.br
  1358. X:
  1359. X.br
  1360. X^From.*berg
  1361. X.br
  1362. Xfrom_me
  1363. X.br
  1364. X:
  1365. X.br
  1366. X^Subject:.*Flame
  1367. X.br
  1368. X/dev/null
  1369. X.LP
  1370. Xprocmail performs the locking in an NFS-secure way.
  1371. X.Sh AUTHOR
  1372. X.LP
  1373. XStephen R. van den Berg at RWTH-Aachen, Germany
  1374. X.RS
  1375. Xberg@messua.informatik.rwth-aachen.de
  1376. X.br
  1377. Xberg@physik.tu-muenchen.de
  1378. X.RE
  1379. SHAR_EOF
  1380. chmod 0644 procmail/man/procmail.1 ||
  1381. echo 'restore of procmail/man/procmail.1 failed'
  1382. Wc_c="`wc -c < 'procmail/man/procmail.1'`"
  1383. test 20225 -eq "$Wc_c" ||
  1384.     echo 'procmail/man/procmail.1: original size 20225, current size' "$Wc_c"
  1385. fi
  1386. # ============= procmail/man/formail.1 ==============
  1387. if test -f 'procmail/man/formail.1' -a X"$1" != X"-c"; then
  1388.     echo 'x - skipping procmail/man/formail.1 (File already exists)'
  1389. else
  1390. echo 'x - extracting procmail/man/formail.1 (Text)'
  1391. sed 's/^X//' << 'SHAR_EOF' > 'procmail/man/formail.1' &&
  1392. X.de Id
  1393. X.ds Rv \\$3
  1394. X.ds Dt \\$4
  1395. X..
  1396. X.Id $Id: formail.1,v 2.3 1991/07/03 13:54:04 berg Rel $
  1397. X.de Sh
  1398. X.br
  1399. X.ne 9
  1400. X.SH "\\$1"
  1401. X..
  1402. X.de Ss
  1403. X.br
  1404. X.ne 9
  1405. X.SS "\\$1"
  1406. X..
  1407. X.de Tp
  1408. X.br
  1409. X.ne 9
  1410. X.TP "\\$1"
  1411. X..
  1412. X.TH FORMAIL 1 \*(Dt BuGless
  1413. X.SH NAME
  1414. Xformail \- mail (re)formatter
  1415. X.SH SYNOPSIS
  1416. X.B formail
  1417. X[
  1418. X.I "\fB\+\fPskip"
  1419. X] [
  1420. X.I "\fB\-\fPtotal"
  1421. X] [
  1422. X.B \-bfnrted
  1423. X]
  1424. X.if n .ti +0.5i
  1425. X[
  1426. X.B \-s
  1427. X.I command
  1428. X.I argument
  1429. X\&.\|.\|.
  1430. X]
  1431. X.Sh DESCRIPTION
  1432. X.LP
  1433. X.B formail
  1434. Xis a filter that can be used to force mail into mailbox format, perform real
  1435. Xrigorous `From ' escaping, generate auto-replying headers or split up a
  1436. Xmailbox/digest/articles file.  The mail/mailbox/article contents will be
  1437. Xexpected on stdin.
  1438. X.LP
  1439. XIf formail is supposed to determine the sender of the mail, but is unable
  1440. Xto find any, it will substitute `foo@bar'.
  1441. X.LP
  1442. XIf formail is started without any command line options, it will force any
  1443. Xmail coming from stdin into mailbox format and will escape
  1444. X.B all
  1445. Xbogus `From ' lines.
  1446. X.Sh OPTIONS
  1447. X.Tp 0.5i
  1448. X.B \-b
  1449. XDon't escape any bogus mailbox headers (i.e. lines starting with `From ').
  1450. X.Tp
  1451. X.B \-f
  1452. XForce formail to simply pass along any non-mailbox format (i.e. don't
  1453. Xgenerate a `From ' line as the first line).
  1454. X.Tp
  1455. X.B \-r
  1456. XGenerate an auto-reply header.
  1457. X.Tp
  1458. X.B \-t
  1459. XTrust the sender to have used a valid return address in his header.  This
  1460. Xoption will be most usefull when generating auto-reply headers from news
  1461. Xarticles.  If this option is not turned on, formail tries to digest the most
  1462. Xprobable valid return address itself.
  1463. X.Tp
  1464. X.B \-s
  1465. XThe input will be split up into seperate mail messages, and piped into
  1466. Xa program one by one (a new program is started for every part).
  1467. X.B \-s
  1468. Xhas to be the last option specified, the first argument following it
  1469. Xis expected to be the name of a program, any other arguments will be passed
  1470. Xalong to it.
  1471. X.Tp
  1472. X.B \-n
  1473. XTell formail not to wait for every program to finish before starting the next.
  1474. X.Tp
  1475. X.B \-e
  1476. XConsider every line starting with `From ' to be the start of a new mail
  1477. Xmessage (this is normally not the case).
  1478. X.Tp
  1479. X.B \-d
  1480. XEnables formail to split up digests/articles into their original parts.
  1481. X.Tp
  1482. X.I "\fB\+\fPskip"
  1483. XSkip the first
  1484. X.I skip
  1485. Xmessages while splitting.
  1486. X.Tp
  1487. X.I "\fB\-\fPtotal"
  1488. XOutput at most
  1489. X.I total
  1490. Xmessages while splitting.
  1491. X.Sh EXAMPLES
  1492. X.LP
  1493. XTo use it as a general formatter in front of procmail include the following
  1494. Xprocmail recipe at the top of your .procmailrc file:
  1495. X.RS
  1496. X:0
  1497. X.br
  1498. Xformail
  1499. X.RE
  1500. X.LP
  1501. XTo split up a digest one usually uses:
  1502. X.RS
  1503. Xformail +1 -ds cat >>the_mailbox_of_your_choice
  1504. X.RE
  1505. Xor
  1506. X.RS
  1507. Xformail +1 -ds procmail
  1508. X.RE
  1509. X.Sh MISCELLANEOUS
  1510. X.LP
  1511. XThe regular expression that is used to find `real' postmarks is:
  1512. X.RS
  1513. X\\n\\nFrom +[^\\t\\n ]+ +[^\\n\\t]
  1514. X.RE
  1515. X.Sh "SEE ALSO"
  1516. X.BR mail (1),
  1517. X.BR binmail (1),
  1518. X.BR sendmail (8),
  1519. X.BR procmail (1),
  1520. X.BR sh (1)
  1521. X.Sh DIAGNOSTICS
  1522. X.Tp 2.3i
  1523. XCouldn't write to stdout
  1524. XThe program that formail was trying to pipe into didn't accept all the data
  1525. Xformail sent to it.
  1526. X.Tp
  1527. XFile table full
  1528. XToo many open files on this machine.
  1529. X.Tp
  1530. XCan't fork
  1531. XToo many processes on this machine.
  1532. X.Tp
  1533. XFailed to execute "x"
  1534. XProgram not in path, or not executable.
  1535. X.Sh BUGS
  1536. X.LP
  1537. Xformail does not do full RFC 822 parsing while generating a `From ' or
  1538. Xa `To: ' line, hence it can be fooled by some real tricky escaped/quoted
  1539. Xstrings with `<', `>' or `(' characters in them.
  1540. X.Sh AUTHOR
  1541. X.LP
  1542. XStephen R. van den Berg at RWTH-Aachen, Germany
  1543. X.RS
  1544. Xberg@messua.informatik.rwth-aachen.de
  1545. X.br
  1546. Xberg@physik.tu-muenchen.de
  1547. X.RE
  1548. SHAR_EOF
  1549. chmod 0644 procmail/man/formail.1 ||
  1550. echo 'restore of procmail/man/formail.1 failed'
  1551. Wc_c="`wc -c < 'procmail/man/formail.1'`"
  1552. test 3441 -eq "$Wc_c" ||
  1553.     echo 'procmail/man/formail.1: original size 3441, current size' "$Wc_c"
  1554. fi
  1555. # ============= procmail/man/lockfile.1 ==============
  1556. if test -f 'procmail/man/lockfile.1' -a X"$1" != X"-c"; then
  1557.     echo 'x - skipping procmail/man/lockfile.1 (File already exists)'
  1558. else
  1559. echo 'x - extracting procmail/man/lockfile.1 (Text)'
  1560. sed 's/^X//' << 'SHAR_EOF' > 'procmail/man/lockfile.1' &&
  1561. X.de Id
  1562. X.ds Rv \\$3
  1563. X.ds Dt \\$4
  1564. X..
  1565. X.Id $Id: lockfile.1,v 2.2 1991/07/03 13:54:04 berg Rel $
  1566. X.de Sh
  1567. X.br
  1568. X.ne 9
  1569. X.SH "\\$1"
  1570. X..
  1571. X.de Ss
  1572. X.br
  1573. X.ne 9
  1574. X.SS "\\$1"
  1575. X..
  1576. X.de Tp
  1577. X.br
  1578. X.ne 9
  1579. X.TP "\\$1"
  1580. X..
  1581. X.TH LOCKFILE 1 \*(Dt BuGless
  1582. X.SH NAME
  1583. Xlockfile \- conditional semaphore-file creator
  1584. X.SH SYNOPSIS
  1585. X.B lockfile
  1586. X.I "\fB\-\fPsleeptime"
  1587. X|
  1588. X.I "\fB\-r\fPretries"
  1589. X|
  1590. X.B "\-!"
  1591. X|
  1592. X.if n .ti +0.5i
  1593. X.I "\fB\-l\fPlocktimeout"
  1594. X|
  1595. X.I "\fB\-s\fPsuspend"
  1596. X|
  1597. X.I filename
  1598. X\&.\|.\|.
  1599. X.Sh DESCRIPTION
  1600. X.B lockfile
  1601. Xcan be used to create one or more
  1602. X.I semaphore
  1603. X.IR files .
  1604. XIf lockfile can't create all the specified files (in the specified order),
  1605. Xit waits
  1606. X.I sleeptime
  1607. X(defaults to 8) seconds and retries the last file that didn't succeed.
  1608. XYou can specify the number of
  1609. X.I retries
  1610. Xto do until failure is returned.
  1611. XIf the number of
  1612. X.I retries
  1613. Xis 0 (default) lockfile will retry forever.
  1614. X.LP
  1615. XIf the number of
  1616. X.I retries
  1617. Xexpires before all files have been created, lockfile returns failure and
  1618. Xremoves all the files it created up till that point.
  1619. X.LP
  1620. XThe return value of lockfile can be easily inverted by specifying
  1621. X.B \-!
  1622. Xas an argument (comes in handy in shell scripts).
  1623. X.LP
  1624. XAll flags can be specified anywhere on the command line, they will be
  1625. Xprocessed when encountered.  The command line is simply parsed from
  1626. Xleft to right.
  1627. X.LP
  1628. XAll files created by lockfile will have access permission 0, and therefore
  1629. Xwill have to be removed with
  1630. X.B rm
  1631. X.BR \-f .
  1632. X.LP
  1633. XIf you specify a
  1634. X.I locktimeout
  1635. Xthen a lockfile will be removed by force after locktimeout seconds have
  1636. Xpassed since the lockfile was last modified/created.  After a lockfile is
  1637. Xremoved by  force, a suspension of
  1638. X.I suspend
  1639. Xseconds (defaults to 16) is taken into account, in order to prevent the
  1640. Xinadvertent immediate removal of any newly created lockfile by another program
  1641. X(compare
  1642. X.BR SUSPEND
  1643. Xin
  1644. X.BR procmail (1)).
  1645. X.Sh "SEE ALSO"
  1646. X.LP
  1647. X.BR rm (1),
  1648. X.BR mail (1),
  1649. X.BR binmail (1),
  1650. X.BR sendmail (8),
  1651. X.BR procmail (1)
  1652. X.Sh DIAGNOSTICS
  1653. X.Tp 2.3i
  1654. XForcing lock on "x"
  1655. XSpecified lockfile is going to be removed by force because of a timeout
  1656. X(compare
  1657. X.BR LOCKTIMEOUT
  1658. Xin
  1659. X.BR procmail (1)).
  1660. X.Sh BUGS
  1661. X.LP
  1662. Xlockfile is only a simple program and can't process concatenated options.
  1663. X.Sh NOTES
  1664. X.LP
  1665. XMultiple
  1666. X.B \-!
  1667. Xflags will toggle the return status.
  1668. X.LP
  1669. XSince flags can occur anywhere on the command line, any filename starting
  1670. Xwith a '-' has to be preceded by './'.
  1671. X.LP
  1672. XThe number of
  1673. X.I retries
  1674. Xis global.  That is, it is not reset when a new file is being created.
  1675. XIt can, however, be reset by specifying
  1676. X.RI \-r newretries
  1677. Xafter every file on the command line.
  1678. X.LP
  1679. Xlockfile performs the locking in an NFS-secure way.
  1680. X.Sh AUTHOR
  1681. X.LP
  1682. XStephen R. van den Berg at RWTH-Aachen, Germany
  1683. X.RS
  1684. Xberg@messua.informatik.rwth-aachen.de
  1685. X.br
  1686. Xberg@physik.tu-muenchen.de
  1687. X.RE
  1688. SHAR_EOF
  1689. chmod 0644 procmail/man/lockfile.1 ||
  1690. echo 'restore of procmail/man/lockfile.1 failed'
  1691. Wc_c="`wc -c < 'procmail/man/lockfile.1'`"
  1692. test 2758 -eq "$Wc_c" ||
  1693.     echo 'procmail/man/lockfile.1: original size 2758, current size' "$Wc_c"
  1694. fi
  1695. true || echo 'restore of procmail/includes.h failed'
  1696. echo End of part 1, continue with part 2
  1697. exit 0
  1698. exit 0 # Just in case...
  1699. -- 
  1700. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1701. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1702. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1703. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1704.