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

  1. Newsgroups: comp.sources.misc
  2. From: berg@pool.informatik.rwth-aachen.de (Stephen R. van den Berg)
  3. Subject: v38i023:  procmail - mail processing package v2.90, Part04/11
  4. Message-ID: <1993Jul1.150939.20947@sparky.imd.sterling.com>
  5. X-Md4-Signature: d54deb55fa28bcb4552aecd2ff0cbd0d
  6. Sender: kent@sparky.imd.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Thu, 1 Jul 1993 15:09:39 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 23
  13. Archive-name: procmail/part04
  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 4 (of 11)."
  24. # Contents:  procmail/Makefile.1 procmail/examples/mailstat
  25. #   procmail/mailinglist/etc/rc.init procmail/man/lockfile.man
  26. #   procmail/src/Makefile.0 procmail/src/formisc.c
  27. #   procmail/src/header.h procmail/src/locking.c
  28. #   procmail/src/mailfold.h
  29. # Wrapped by berg@tubastos on Thu Jul  1 14:06:16 1993
  30. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  31. if test -f 'procmail/Makefile.1' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'procmail/Makefile.1'\"
  33. else
  34. echo shar: Extracting \"'procmail/Makefile.1'\" \(4347 characters\)
  35. sed "s/^X//" >'procmail/Makefile.1' <<'END_OF_FILE'
  36. X#$Id: Makefile.1,v 1.18 1993/06/23 12:55:29 berg Exp $
  37. X
  38. XHIDEMAKE=$(MAKE)
  39. X
  40. Xall: bins mans recommend
  41. X
  42. Xmake:
  43. X    @$(SHELL) -c "exit 0"
  44. X
  45. Xbins: config.check src/Makefile
  46. X    cd src; $(MAKE) $(NBINS)
  47. X
  48. Xmans: config.check man/Makefile
  49. X    cd man; $(MAKE) $(NMANS)
  50. X
  51. Xautoconf.h: src/Makefile src/autoconf
  52. X    cd src; $(MAKE) ../$@
  53. X
  54. Xprocmail: config.check src/Makefile man/Makefile
  55. X    cd src; $(MAKE) ../new/$@ ../new/mailstat
  56. X    cd man; $(MAKE) ../new/$@.1 ../new/$@rc.5 ../new/$@ex.5
  57. X
  58. Xmailstat: procmail
  59. X
  60. Xformail lockfile: config.check src/Makefile man/Makefile
  61. X    cd src; $(MAKE) ../new/$@
  62. X    cd man; $(MAKE) ../new/$@.1
  63. X
  64. Xmultigram: config.check src/Makefile man/Makefile
  65. X    cd src; $(MAKE) $@
  66. X
  67. Xconfig.check: config.h
  68. X    @echo Housekeeping file >$@
  69. X    @-mkdir new 2>$(DEVNULL); exit 0
  70. X    @-if $(FGREP) -n -e '`' config.h $(DEVNULL) | $(FGREP) -v EOFName ; \
  71. X     then \
  72. X     echo;echo '    ^^^^^^^^^^^^^^^^^^^^ WARNING ^^^^^^^^^^^^^^^^^^^^^';\
  73. X          echo '    * Having backquotes in there could be unhealthy! *';\
  74. X     echo;fi;exit 0
  75. X
  76. Xrecommend: src/Makefile
  77. X    @cd src; $(MAKE) $@ >$(DEVNULL)
  78. X    @echo ----------------------------------------------------------------\
  79. X---------------
  80. X    @if $(FGREP) CF_no_procmail_yet autoconf.h >$(DEVNULL); \
  81. X     then echo If you are a system administrator you should consider \
  82. Xintegrating procmail; echo into the mail-delivery system -- for advanced \
  83. Xfunctionality AND SECURITY --.; echo For more information about this topic \
  84. Xyou should look in the examples/advanced; echo file.; elif \
  85. X     cat /usr/lib/sendmail.cf /etc/sendmail.cf 2>$(DEVNULL) | \
  86. X     grep 'Mlocal.*procmail.*F=[a-zA-Z]*u' >$(DEVNULL) ; then \
  87. X     echo The recommendation for the sendmail.cf entry of procmail has \
  88. Xchanged.; echo I suggest you remove the '`u'"'"-flag 'like in:'; echo ; \
  89. X      sed -n 's/.*\(Mlocal.*procmail.*F=[a-zA-Z]*\)u/\1/p' `if test -f \
  90. X     /etc/sendmail.cf; then echo /etc/sendmail.cf; else \
  91. X     echo /usr/lib/sendmail.cf; fi`; fi
  92. X    @echo
  93. X    @echo "Also, HIGHLY RECOMMENDED (type 'make suid' to execute it):"
  94. X    @echo
  95. X    @src/$@ $(BINDIR)/procmail $(BINDIR)/lockfile >suid.sh
  96. X    @src/$@ $(BINDIR)/procmail $(BINDIR)/lockfile
  97. X    @echo ----------------------------------------------------------------\
  98. X---------------
  99. X
  100. Xsuid.sh: recommend
  101. X
  102. Xsuid: suid.sh install.bin
  103. X    @cat $@.sh
  104. X    @$(SHELL) ./$@.sh
  105. X    @cd $(BINDIR); echo Installed in $(BINDIR); ls -l $(BINSS)
  106. X
  107. X$(MANS): mans
  108. X
  109. X$(BINS): bins
  110. X
  111. Xinstall.man: $(MANS)
  112. X    @-mkdir $(MANDIR) 2>$(DEVNULL); exit 0
  113. X    @-mkdir $(MAN1DIR) 2>$(DEVNULL); exit 0
  114. X    @-mkdir $(MAN5DIR) 2>$(DEVNULL); exit 0
  115. X    @chmod 0644 $(MANS)
  116. X    @for a in $(MANS1S); \
  117. X      do $(INSTALL) new/$$a.1 $(MAN1DIR)/$$a.$(MAN1SUFFIX); done
  118. X    @for a in $(MANS5S); \
  119. X      do $(INSTALL) new/$$a.5 $(MAN5DIR)/$$a.$(MAN5SUFFIX); done
  120. X    @echo Housekeeping file >install.man
  121. X
  122. Xinstall.bin: $(BINS)
  123. X    @-mkdir $(BINDIR) 2>$(DEVNULL); exit 0
  124. X    @chmod 0755 $(BINS)
  125. X    $(INSTALL) $(BINS) $(BINDIR)
  126. X    @-dirname / >$(DEVNULL) || $(INSTALL) examples/dirname $(BINDIR)
  127. X    @echo Housekeeping file >install.bin
  128. X
  129. Xinstall: install.man install.bin
  130. X    @echo
  131. X    @cd $(BINDIR); echo Installed in $(BINDIR); ls -l $(BINSS)
  132. X    @cd $(MAN1DIR); echo Installed in $(MAN1DIR); ls -l $(MANS1)
  133. X    @cd $(MAN5DIR); echo Installed in $(MAN5DIR); ls -l $(MANS5)
  134. X    @$(MAKE) recommend
  135. X
  136. Xdeinstall:
  137. X    @echo ----------------------------- Deinstalling the procmail package.
  138. X    @$(RM) install.man install.bin
  139. X    @echo ----------------------------- Checking if everything was removed:
  140. X    @-cd $(BINDIR); $(RM) $(BINSS); ls -l $(BINSS); exit 0
  141. X    @-cd $(MAN1DIR); $(RM) $(MANS1); ls -l $(MANS1); exit 0
  142. X    @-cd $(MAN5DIR); $(RM) $(MANS5); ls -l $(MANS5); exit 0
  143. X    @echo ----------------------------- Ready.
  144. X
  145. Xclean: config.check
  146. X    -for a in $(SUBDIRS); do cd $$a; $(MAKE) $@; cd ..; done; exit 0
  147. X    cd mailinglist; $(RM) targetdir.h list.id.* id.test
  148. X    $(RM) $(MANS) $(BINS) install.man install.bin suid.sh _Makefile \
  149. X     core autoconf.h.tmp
  150. X
  151. Xrealclean: clean _init
  152. X    $(RM) config.check
  153. X    -rmdir new; exit 0
  154. X    -for a in $(SUBDIRS); do $(MV) $$a/Makefile.init $$a/Makefile; done; \
  155. X     exit 0
  156. X
  157. Xveryclean clobber: realclean
  158. X
  159. X_init:
  160. X    sed -e '/^# Makefile.1 - mark/,$$ d' <Makefile >_Makefile
  161. X    cat Makefile.0 >>_Makefile
  162. X    $(MV) _Makefile Makefile
  163. X    $(RM) Makefile.0
  164. X
  165. Xman/Makefile: man/Makefile.0
  166. X
  167. Xsrc/Makefile: src/Makefile.0
  168. X
  169. Xman/Makefile src/Makefile: Makefile
  170. X    $(MAKE) _init; $(HIDEMAKE) init
  171. X
  172. XMakefile: Makefile.1 initmake
  173. X
  174. Xinit makefiles Makefiles makefile: man/Makefile src/Makefile
  175. END_OF_FILE
  176. if test 4347 -ne `wc -c <'procmail/Makefile.1'`; then
  177.     echo shar: \"'procmail/Makefile.1'\" unpacked with wrong size!
  178. fi
  179. # end of 'procmail/Makefile.1'
  180. fi
  181. if test -f 'procmail/examples/mailstat' -a "${1}" != "-c" ; then 
  182.   echo shar: Will not clobber existing file \"'procmail/examples/mailstat'\"
  183. else
  184. echo shar: Extracting \"'procmail/examples/mailstat'\" \(5232 characters\)
  185. sed "s/^X//" >'procmail/examples/mailstat' <<'END_OF_FILE'
  186. X#! /bin/sh
  187. X: &&O= || exec /bin/sh $0 $argv:q # we're in a csh, feed myself to sh
  188. X#################################################################
  189. X#    mailstat    shows mail-arrival statistics        #
  190. X#                                #
  191. X#    Parses a procmail-generated $LOGFILE and displays    #
  192. X#    a summary about the messages delivered to all folders    #
  193. X#    (total size, average size, nr of messages).        #
  194. X#    Exit code 0 if mail arrived, 1 if no mail arrived.    #
  195. X#                                #
  196. X#    For help try, "mailstat -h"                #
  197. X#                                #
  198. X#    Customise to your heart's content, this file is only    #
  199. X#    provided as a guideline.                #
  200. X#                                #
  201. X#    Created by S.R. van den Berg, The Netherlands        #
  202. X#    This file can be freely copied for any use.        #
  203. X#################################################################
  204. X#$Id: mailstat,v 1.17 1993/06/02 15:30:38 berg Exp $
  205. X
  206. X#    This shell script expects the following programs to be in the
  207. X#    PATH (paths given here are the standard locations, your mileage
  208. X#    may vary (if the programs can not be found, extend the PATH or
  209. X#    put their absolute pathnames in here):
  210. X
  211. Xtest=test        # /bin/test
  212. Xecho=echo        # /bin/echo
  213. Xexpr=expr        # /bin/expr
  214. Xtty=tty            # /bin/tty
  215. Xsed=sed            # /bin/sed
  216. Xsort=sort        # /bin/sort
  217. Xawk=awk            # /usr/bin/awk
  218. Xcat=cat            # /bin/cat
  219. Xmv=mv            # /bin/mv
  220. Xls=ls            # /bin/ls
  221. X
  222. XPATH=/bin:/usr/bin
  223. XSHELL=/bin/sh        # just in case
  224. Xexport SHELL PATH
  225. X
  226. Xumask 077        # we don't allow everyone to read the tmpfiles
  227. XOLDSUFFIX=.old
  228. X
  229. XDEVNULL=/dev/null
  230. XEX_USAGE=64
  231. X
  232. X########
  233. X#    (Concatenated) flags parsing in pure, portable, structured (it
  234. X#    would have been more elegant if gotos were permitted) shellscript
  235. X#    language.  For added pleasure: a quick demonstration of the shell's
  236. X#    quoting capabilities :-).
  237. X########
  238. X
  239. Xwhile $test $# != 0 -a a"$1" != a-- -a \
  240. X \( 0 != `$expr "X$1" : X-.` -o $# != 1 \)
  241. Xdo
  242. X  if $expr "X$1" : X-. >$DEVNULL    # structured-programming spaghetti
  243. X  then
  244. X     flags="$1"; shift
  245. X  else
  246. X     flags=-h                # force help page
  247. X  fi
  248. X  while flags="`$expr \"X$flags\" : \"X.\(.*\)\"`"; $test ."$flags" != .
  249. X  do
  250. X     case "$flags" in
  251. X     k*) MSkeeplogfile=1;;
  252. X     l*) MSlong=1;;
  253. X     m*) MSmergerror=1;;
  254. X     o*) MSoldlog=1; MSkeeplogfile=1;;
  255. X     t*) MSterse=1;;
  256. X     s*) MSsilent=1;;
  257. X     h*|\?*) $echo 'Usage: mailstat [-klmots] [logfile]' 1>&2
  258. X        $echo '    -k    keep logfile intact' 1>&2
  259. X        $echo '    -l    long display format' 1>&2
  260. X        $echo '    -m    merge any errors into one line' 1>&2
  261. X        $echo '    -o    use the old logfile' 1>&2
  262. X        $echo '    -t    terse display format' 1>&2
  263. X        $echo '    -s    silent in case of no mail' 1>&2
  264. X        exit $EX_USAGE;;
  265. X     *) $echo 'Usage: mailstat [-klmots] [logfile]' 1>&2; exit $EX_USAGE;;
  266. X     esac
  267. X  done
  268. Xdone
  269. X
  270. X$test a"$1" = a-- && shift
  271. X
  272. XLOGFILE="$1"
  273. X
  274. Xcase "$LOGFILE" in
  275. X  *$OLDSUFFIX) MSkeeplogfile=1; OLDLOGFILE="$LOGFILE";;
  276. X  *) OLDLOGFILE="$LOGFILE$OLDSUFFIX";;
  277. Xesac
  278. X
  279. Xif test .$MSoldlog = .1
  280. Xthen
  281. X  LOGFILE="$OLDLOGFILE"
  282. Xfi
  283. X
  284. Xif $test ."$LOGFILE" != .- -a ."$LOGFILE" != .
  285. Xthen
  286. X  if $test ! -s "$LOGFILE"
  287. X  then
  288. X     if $test .$MSsilent = .
  289. X     then
  290. X    if $test -f "$LOGFILE"
  291. X    then
  292. X       $echo No mail arrived since \
  293. X        `$expr "X\`LANG= LC_TIME= $ls -l \"$OLDLOGFILE\"\`" : \
  294. X         '.*[0-9] \([A-Z][a-z][a-z] .[^ ] .....\) [^ ]'`
  295. X    else
  296. X       $echo "Can't find your LOGFILE=$LOGFILE"
  297. X    fi
  298. X     fi
  299. X     exit 1
  300. X  fi
  301. Xelse
  302. X  if $test ."$LOGFILE" != .- && $tty -s
  303. X  then
  304. X     $echo \
  305. X      "Most people don't type their own logfiles;  but, what do I care?" 1>&2
  306. X     MSterse=1
  307. X  fi
  308. X  MSkeeplogfile=1; LOGFILE=
  309. Xfi
  310. X
  311. Xif $test .$MSkeeplogfile = .
  312. Xthen $mv "$LOGFILE" "$OLDLOGFILE"; $cat $DEVNULL >>"$LOGFILE"
  313. Xelse OLDLOGFILE="$LOGFILE"
  314. Xfi
  315. X
  316. Xif $test .$MSterse = .
  317. Xthen
  318. X  if $test .$MSlong = .1
  319. X  then
  320. X     $echo ""
  321. X     $echo "  Total Average  Number Folder"
  322. X     $echo "  ----- -------  ------ ------"
  323. X  else
  324. X     $echo ""
  325. X     $echo "  Total  Number Folder"
  326. X     $echo "  -----  ------ ------"
  327. X  fi
  328. Xfi
  329. X
  330. Xif $test .$MSlong = .1
  331. Xthen MSlong='"%7d %7d %7d %s\n",total,total/messages,messages,folder'
  332. Xelse MSlong='"%7d %7d %s\n",total,messages,folder'
  333. Xfi
  334. X
  335. XTMPF=/tmp/maillog.$$
  336. X
  337. Xtrap "rm -f $TMPF; exit 2" 1 2 3 15
  338. Xtrap "rm -f $TMPF; exit 0" 0
  339. X
  340. X########
  341. X#    And now we descend into the wonderful mix if shell-quoting and
  342. X#    portable awk-programming :-)
  343. X########
  344. X
  345. X$cat >$TMPF <<HERE
  346. XBEGIN {
  347. X    FS="\\t";
  348. X  }
  349. X  { if(folder!=\$1)
  350. X     { if(folder!="")
  351. X      printf($MSlong);
  352. X       messages=0;total=0;folder=\$1;
  353. X     }
  354. X    ++messages;total+=\$2;
  355. X  }
  356. XEND {
  357. X    if(folder!="")
  358. X       printf($MSlong);
  359. X  }
  360. XHERE
  361. X
  362. X########
  363. X#    Only to end in a grand finale with your average sed script
  364. X########
  365. X
  366. Xif $test .$MSmergerror = .
  367. Xthen
  368. X  $sed    -e '/^From /d' -e '/^ [Ss][uU][bB][jJ][eE][cC][tT]:/d' \
  369. X   -e '/^  Folder/s/        */    /' \
  370. X   -e '/^  Folder/s/\/msg.[-0-9A-Za-z_][-0-9A-Za-z_]*    /\/    /' \
  371. X   -e '/^  Folder/s/\/[0-9][0-9]*    /\/.    /' \
  372. X   -e 's/^  Folder: \(.*\)/\1/' -e t -e 's/    /\\t/g' \
  373. X   -e 's/^/ ## /' $OLDLOGFILE | $sort | $awk -f $TMPF -
  374. Xelse
  375. X  $sed    -e '/^From /d' -e '/^ [Ss][uU][bB][jJ][eE][cC][tT]:/d' \
  376. X   -e '/^  Folder/s/        */    /' \
  377. X   -e '/^  Folder/s/\/msg.[-0-9A-Za-z_][-0-9A-Za-z_]*    /\/    /' \
  378. X   -e '/^  Folder/s/\/[0-9][0-9]*    /\/.    /' \
  379. X   -e 's/^  Folder: \(.*\)/\1/' -e t \
  380. X   -e 's/.*/ ## diagnostic messages ##/' $OLDLOGFILE | $sort | $awk -f $TMPF -
  381. Xfi
  382. X
  383. X########
  384. X#    Nifty little script, isn't it?
  385. X#    Now why didn't *you* come up with this truly trivial script? :-)
  386. X########
  387. END_OF_FILE
  388. if test 5232 -ne `wc -c <'procmail/examples/mailstat'`; then
  389.     echo shar: \"'procmail/examples/mailstat'\" unpacked with wrong size!
  390. fi
  391. chmod +x 'procmail/examples/mailstat'
  392. # end of 'procmail/examples/mailstat'
  393. fi
  394. if test -f 'procmail/mailinglist/etc/rc.init' -a "${1}" != "-c" ; then 
  395.   echo shar: Will not clobber existing file \"'procmail/mailinglist/etc/rc.init'\"
  396. else
  397. echo shar: Extracting \"'procmail/mailinglist/etc/rc.init'\" \(5604 characters\)
  398. sed "s/^X//" >'procmail/mailinglist/etc/rc.init' <<'END_OF_FILE'
  399. X#
  400. X# IMPORTANT variables to check/change:    PATH domain listmaster
  401. X#
  402. X
  403. X# BEFORE editing this file or any rc.* file in the .etc directory
  404. X# you should create the .etc/rc.lock file.  As long as this file
  405. X# exists, mail delivery to any list will stall (flist checks this file).
  406. X#
  407. X# Delivery can be temporarily stalled on a per list basis by creating
  408. X# the file rc.lock in the respective list's subdirectory.
  409. X
  410. X# ENVIRONMENT:
  411. X# list        contains the submitting address of the list (sans domain)
  412. X# domain    should contain the domain for the list, so that $list@$domain
  413. X#        can be used to submit to the list
  414. X# maintainer    should contain the fully qualified address of the maintainer
  415. X#        of $list;  maintainter can be left empty
  416. X# listmaster    should contain the fully qualified address of the supervising
  417. X#        list maintainer;  listmaster can be left empty
  418. X# X_ENVELOPE_TO contains the address that the incoming mail was addressed to
  419. X
  420. X# FILES:
  421. X# log        optional logfile (uncomment the LOGFILE assignment to enable
  422. X#        it)
  423. X# dist        the subscriber list, one address per line
  424. X# reject    list of people you definitely do want to subscribe
  425. X# request    all the messages to request that could not be handled
  426. X#        automatically (only if maintainer is empty)
  427. X# help.txt    file sent to help requests
  428. X# subscribe.txt file sent to new subscribers
  429. X# bounces    directory containing the bounce history files
  430. X# rc.submit    rcfile used when distributing submissions
  431. X# rc.request    rcfile used when processing requests
  432. X# rc.custom    rcfile that contains all the customisations per list
  433. X
  434. X#$Id: rc.init,v 1.17 1993/06/29 15:36:14 berg Exp $
  435. X
  436. XPATH=.:$PATH:../.bin:/bin:/usr/bin:/usr/local/bin    # setup a decent path
  437. XSHELL=/bin/sh                # to prevent surprises
  438. X
  439. Xdefaults=.etc
  440. X
  441. XLOCKTIMEOUT=3660            # set these values this high (1 hour)
  442. XTIMEOUT=3600                # to give sendmail the time to
  443. X                    # resolve big aliases
  444. X
  445. X###############################################################################
  446. X# You have to setup the following two assignments, make sure that the address
  447. X# mentioned in listmaster is *not* the address this script runs under;    if
  448. X# you would end up doing that, then assign listmaster to ""
  449. X# The same applies to the maintainer addresses used for every list, if you
  450. X# would like to alias them back to this script or to the respective -request
  451. X# addresses, then assign maintainer to "" instead.
  452. X#
  453. X# The mail-domain you have to insert below, must be the fully qualified
  454. X# mail-domain for this list;  e.g. if the preferred mail address for this
  455. X# account would be:  list@somemachine.somewhere.universe
  456. X# Then you should assign the following:
  457. X#           domain=somemachine.somewhere.universe
  458. X###############################################################################
  459. X
  460. Xdomain=INSERT.YOUR.MAIL.DOMAIN.HERE    # the common domain for all the lists
  461. Xlistmaster=
  462. X
  463. X#UMASK=077                # group can not touch the files
  464. X UMASK=027                # group can read
  465. X#UMASK=007                # group can write as well
  466. X
  467. Xdefaults=.etc                # the name of the defaults directory
  468. XLOGFILE=log
  469. XLOGABSTRACT=no
  470. X
  471. X#LOGABSTRACT=yes            # uncomment in case of emergency
  472. X#VERBOSE=yes                # uncomment in case of real emergency
  473. X#LOGFILE=../$defaults/log        # uncomment if you want centralised
  474. X                    # logging
  475. X
  476. XRC_INIT                    # clear this one from the environment
  477. X                    # so that we include this file only
  478. X                    # once
  479. X
  480. Xlistaddr=$list@$domain
  481. Xlistreq=$list-request@$domain
  482. Xlistdist=$list-dist@$domain
  483. X
  484. XsendmailOPT="-oem -odb -oi -f$listreq"
  485. XsendmailOPTp=-oep
  486. X########################
  487. X# sendmail options used:
  488. X#
  489. X# -t    scan the header of the mail for recipients
  490. X# -f    specify the sender envelope address (requires T entry in sendmail.cf)
  491. X# -oi    do not regard a single dot on an otherwise empty line as EOF
  492. X# -om    include myself in any alias expansions
  493. X# -odb    background deliverymode command returns immediately
  494. X# -oem    mail back error messages
  495. X# -oep    print error messages
  496. X########################
  497. X#
  498. X# If you only have /bin/mail and not some sendmail compatible mailer that
  499. X# understands the -t option of sendmail, then you have to uncomment the
  500. X# following line:
  501. X#
  502. X#sendmailOPT sendmailOPTp SENDMAIL=SedHomeDir/.bin/sendmails
  503. X#
  504. X########################
  505. X
  506. Xsize_limit    =    524288        # sanity cutoff value for submissions
  507. Xarchive_hist    =    2        # number of messages left archived
  508. Xarchive_log    =    $LOGFILE    # log file for archive retrievals
  509. Xmaxhist        =    8        # bounce history limit
  510. Xminbounce    =    3        # no. of bounces before removal
  511. Xcutoff_bounce    =    256        # lines to keep in bounce processing
  512. Xsubscribe_log    =    $LOGFILE    # log file for administrivia
  513. X
  514. Xmatch_threshold =    30730        # for close matches to the list
  515. Xmedium_threshold=    28672        # for not so close matches to the list
  516. Xloose_threshold =    24476        # for loosely finding your name
  517. X
  518. Xauto_off_threshold=   $medium_threshold # for auto-unsubscribing bouncers
  519. Xoff_threshold    =      $loose_threshold # for unsubscribing
  520. Xreject_threshold=      $match_threshold # for rejecting subscriptions
  521. Xsubmit_threshold=     $medium_threshold # for permitting submissions
  522. X
  523. Xforeign_submit    =    yes
  524. X#foreign_submit                # uncomment this line if you
  525. X                    # want to restrict submitting to
  526. X                    # people on the accept list
  527. Xcc_requests
  528. X#cc_requests    =    c        # uncomment if you want subscribe
  529. X                    # and help requests to be Cc'd to
  530. X                    # the maintainer
  531. Xdigest_flag    =    <0
  532. X#digest_flag    =    >0        # uncomment this if you want digests
  533. Xdigest_age    =    262144        # maximum age of a digest in seconds
  534. Xdigest_size    =    32768        # maximum size of a digest in bytes
  535. X
  536. X
  537. XX_COMMAND    =    X-Command
  538. XX_COMMAND_PASSWORD =    password    # put the global password for
  539. X                    # X-Command mails here
  540. X                # this password can of course be changed/
  541. X                # customised in the per list rc.custom file
  542. X
  543. XRC_CUSTOM=rc.custom
  544. END_OF_FILE
  545. if test 5604 -ne `wc -c <'procmail/mailinglist/etc/rc.init'`; then
  546.     echo shar: \"'procmail/mailinglist/etc/rc.init'\" unpacked with wrong size!
  547. fi
  548. # end of 'procmail/mailinglist/etc/rc.init'
  549. fi
  550. if test -f 'procmail/man/lockfile.man' -a "${1}" != "-c" ; then 
  551.   echo shar: Will not clobber existing file \"'procmail/man/lockfile.man'\"
  552. else
  553. echo shar: Extracting \"'procmail/man/lockfile.man'\" \(5174 characters\)
  554. sed "s/^X//" >'procmail/man/lockfile.man' <<'END_OF_FILE'
  555. X.Id $Id: lockfile.man,v 1.8 1993/04/27 17:33:41 berg Exp $
  556. X.TH LOCKFILE 1 \*(Dt BuGless
  557. X.na
  558. X.SH NAME
  559. Xlockfile \- conditional semaphore-file creator
  560. X.SH SYNOPSIS
  561. X.B lockfile
  562. X.I "\fB\-\fPsleeptime"
  563. X|
  564. X.I "\fB\-r \fPretries"
  565. X|
  566. X.if n .ti +0.5i
  567. X.I "\fB\-l \fPlocktimeout"
  568. X|
  569. X.I "\fB\-s \fPsuspend"
  570. X|
  571. X.B "\-!"
  572. X|
  573. X.B "\-ml"
  574. X|
  575. X.B "\-mu"
  576. X|
  577. X.I filename
  578. X\&.\|.\|.
  579. X.ad
  580. X.Sh DESCRIPTION
  581. X.B lockfile
  582. Xcan be used to create one or more
  583. X.I semaphore
  584. X.IR files .
  585. XIf lockfile can't create all the specified files (in the specified order),
  586. Xit waits
  587. X.I sleeptime
  588. X(defaults to @DEFlocksleep@) seconds and retries the last file that didn't
  589. Xsucceed.  You can specify the number of
  590. X.I retries
  591. Xto do until failure is returned.
  592. XIf the number of
  593. X.I retries
  594. Xis -1 (default, i.e.
  595. X.BR \-r\-1 )
  596. Xlockfile will retry forever.
  597. X.PP
  598. XIf the number of
  599. X.I retries
  600. Xexpires before all files have been created, lockfile returns failure and
  601. Xremoves all the files it created up till that point.
  602. X.PP
  603. XThe return value of lockfile can be easily inverted by specifying
  604. X.B \-!
  605. Xas an argument (comes in handy in shell scripts).
  606. X.PP
  607. XAll flags can be specified anywhere on the command line, they will be
  608. Xprocessed when encountered.  The command line is simply parsed from
  609. Xleft to right.
  610. X.PP
  611. XAll files created by lockfile will have access permission 0, and therefore
  612. Xwill have to be removed with
  613. X.B rm
  614. X.BR \-f .
  615. X.PP
  616. XIf you specify a
  617. X.I locktimeout
  618. Xthen a lockfile will be removed by force after locktimeout seconds have
  619. Xpassed since the lockfile was last modified/created (most probably by some
  620. Xother program that unexpectedly died a long time ago, and hence could not clean
  621. Xup any leftover lockfiles).  Lockfile is clock skew immune.  After a lockfile
  622. Xhas been removed by force, a suspension of
  623. X.I suspend
  624. Xseconds (defaults to @DEFsuspend@) is taken into account, in order to prevent
  625. Xthe inadvertent immediate removal of any newly created lockfile by another
  626. Xprogram (compare
  627. X.BR SUSPEND
  628. Xin
  629. X.BR procmail (1)).
  630. X.Ss "Mailbox locks"
  631. XIf the permissions on the system mail spool directory allow it, or if lockfile
  632. Xis suitably setgid, it will be able to lock and unlock your system mailbox by
  633. Xusing the options
  634. X.B "\-ml"
  635. Xand
  636. X.B "\-mu"
  637. Xrespectively.
  638. X.Sh EXAMPLES
  639. XSuppose you want to make sure that access to the file "important" is
  640. Xserialised, i.e. no more than one program or shell script should be allowed
  641. Xto access it.  For simplicity's sake, let's suppose that it is a shell
  642. Xscript.  In this case you could solve it like this:
  643. X.Rs
  644. X\&.\|.\|.
  645. Xlockfile important.lock
  646. X\&.\|.\|.
  647. Xaccess_"important"_to_your_hearts_content
  648. X\&.\|.\|.
  649. Xrm -f important.lock
  650. X\&.\|.\|.
  651. X.Re
  652. XNow if all the scripts that access "important" follow this guideline, you
  653. Xwill be assured that at most one script will be executing between the
  654. X`lockfile' and the `rm' commands.
  655. X.Sh ENVIRONMENT
  656. X.Tp 2.3i
  657. X.B LOGNAME
  658. Xused as a hint to determine the invoker's loginname
  659. X.Sh FILES
  660. X.Tp 2.3i
  661. X.B /etc/passwd
  662. Xto verify and/or correct the invoker's loginname (and to find out his HOME
  663. Xdirectory, if needed)
  664. X.Tp
  665. X.B @SYSTEM_MBOX@@DEFlockext@
  666. Xlockfile for the system mailbox, the environment variables present in here
  667. Xwill not be taken from the environment, but will be determined by looking
  668. Xin /etc/passwd
  669. X.Sh "SEE ALSO"
  670. X.na
  671. X.nh
  672. X.BR rm (1),
  673. X.BR mail (1),
  674. X.BR binmail (1),
  675. X.BR sendmail (8),
  676. X.BR procmail (1)
  677. X.hy
  678. X.ad
  679. X.Sh DIAGNOSTICS
  680. X.Tp 2.3i
  681. XFilename too long, .\|.\|.
  682. XUse shorter filenames.
  683. X.Tp
  684. XForced unlock denied on "x"
  685. XNo write permission in the directory where lockfile "x" resides, or more than
  686. Xone lockfile trying to force a lock at exactly the same time.
  687. X.Tp
  688. XForcing lock on "x"
  689. XLockfile "x" is going to be removed by force because of a timeout
  690. X(compare
  691. X.BR LOCKTIMEOUT
  692. Xin
  693. X.BR procmail (1)).
  694. X.Tp
  695. XOut of memory, .\|.\|.
  696. XThe system is out of swap space.
  697. X.Tp
  698. XSignal received, .\|.\|.
  699. XLockfile will remove anything it created till now and terminate.
  700. X.Tp
  701. XSorry, .\|.\|.
  702. XThe
  703. X.I retries
  704. Xlimit has been reached.
  705. X.Tp
  706. XTruncating "x" and retrying lock
  707. X"x" does not seem to be a valid filename.
  708. X.Tp
  709. XTry praying, .\|.\|.
  710. XMissing subdirectories or insufficient privileges.
  711. X.Sh BUGS
  712. XDefinitely less than one.
  713. X.Sh MISCELLANEOUS
  714. XLockfile is NFS-resistant and eight-bit clean.
  715. X.Sh NOTES
  716. XCalling up lockfile with the \-@HELPOPT1@ or \-@HELPOPT2@ options will cause
  717. Xit to display a command-line help page.
  718. X.PP
  719. XMultiple
  720. X.B \-!
  721. Xflags will toggle the return status.
  722. X.PP
  723. XSince flags can occur anywhere on the command line, any filename starting
  724. Xwith a '-' has to be preceded by './'.
  725. X.PP
  726. XThe number of
  727. X.I retries
  728. Xwill not be reset when any following file is being created (i.e. they are
  729. Xsimply used up).  It can, however, be reset by specifying
  730. X.RI \-r newretries
  731. Xafter every file on the command line.
  732. X.PP
  733. XAlthough files with any name can be used as lockfiles, it is common practice
  734. Xto use the extension `.lock' to lock mailfolders (it is appended to the
  735. Xmailfolder name).  In case one does not want to have to worry about too long
  736. Xfilenames and does not have to conform to any other lockfilename convention,
  737. Xthen an excellent way to generate a lockfilename corresponding to some already
  738. Xexisting file is by taking the prefix `lock.' and appending the i-node number
  739. Xof the file which is to be locked.
  740. END_OF_FILE
  741. if test 5174 -ne `wc -c <'procmail/man/lockfile.man'`; then
  742.     echo shar: \"'procmail/man/lockfile.man'\" unpacked with wrong size!
  743. fi
  744. # end of 'procmail/man/lockfile.man'
  745. fi
  746. if test -f 'procmail/src/Makefile.0' -a "${1}" != "-c" ; then 
  747.   echo shar: Will not clobber existing file \"'procmail/src/Makefile.0'\"
  748. else
  749. echo shar: Extracting \"'procmail/src/Makefile.0'\" \(4587 characters\)
  750. sed "s/^X//" >'procmail/src/Makefile.0' <<'END_OF_FILE'
  751. X
  752. X#$Id: Makefile.0,v 1.18 1993/06/25 11:09:33 berg Exp $
  753. X
  754. XPM_OBJ=cstdio.$(O) common.$(O) exopen.$(O) goodies.$(O) locking.$(O) \
  755. X mailfold.$(O) misc.$(O) pipes.$(O) regexp.$(O) robust.$(O) sublib.$(O)
  756. XLF_OBJ=exopen.$(O) sublib.$(O)
  757. XFM_OBJ=common.$(O) fields.$(O) formisc.$(O) sublib.$(O) ecommon.$(O)
  758. X
  759. Xall:    $(BINSS)
  760. X
  761. Xmake:
  762. X    @$(SHELL) -c "exit 0"            # fake target
  763. X
  764. Xprocmail: procmail.$(O) $(PM_OBJ)
  765. X    $(CC) $(CFLAGS) $@.$(O) $(PM_OBJ) -o $@ $(LDFLAGS)
  766. X
  767. Xlockfile: lockfile.$(O) $(LF_OBJ)
  768. X    $(CC) $(CFLAGS) $@.$(O) $(LF_OBJ) -o $@ $(LDFLAGS)
  769. X
  770. Xformail: formail.$(O) $(FM_OBJ)
  771. X    $(CC) $(CFLAGS) $@.$(O) $(FM_OBJ) -o $@ $(LDFLAGS)
  772. X
  773. Xmailstat: ../examples/mailstat
  774. X    cp ../examples/$@ .
  775. X    @chmod 0755 $@
  776. X
  777. Xmultigram: multigram.$(O) sublib.$(O) ecommon.$(O)
  778. X    $(CC) $(CFLAGS) $@.$(O) sublib.$(O) ecommon.$(O) -o $@ $(LDFLAGS)
  779. X
  780. X../config.check:
  781. X    @cd ..; $(MAKE) config.check
  782. X
  783. X_autotst: _autotst.$(O)
  784. X    $(CC) $(CFLAGS) $@.$(O) -o $@ $(LDFLAGS)
  785. X
  786. X# to fully support "make -n"
  787. XHIDEMAKE = $(MAKE)
  788. X
  789. X../autoconf.h: autoconf Makefile
  790. X    $(SHELL) ./autoconf $(SHELL) "$(RM)" "$(MV)" $(DEVNULL) \
  791. X     "$(FGREP)" "$(HIDEMAKE)" $(O) "$(LOCKINGTEST)" $@
  792. X
  793. Xautoconf.h: ../autoconf.h
  794. X
  795. Xtargetdir.h:
  796. X    echo "You only can/need to make multigram if you are installing"
  797. X    echo "the mailinglist scripts.    Read ../mailinglist/INSTALL for"
  798. X    echo "more directions."
  799. X    exit 64
  800. X
  801. Xcommon.$(O): ../autoconf.h ../config.h includes.h procmail.h sublib.h robust.h
  802. Xcommon.$(O): shell.h misc.h common.h
  803. X
  804. Xcstdio.$(O): ../autoconf.h ../config.h includes.h procmail.h robust.h cstdio.h
  805. Xcstdio.$(O):  misc.h
  806. X
  807. Xecommon.$(O): ../autoconf.h ../config.h includes.h ecommon.h
  808. X
  809. Xexopen.$(O): ../autoconf.h ../config.h includes.h procmail.h robust.h misc.h
  810. Xexopen.$(O): exopen.h
  811. X
  812. Xfields.$(O): ../autoconf.h ../config.h includes.h formail.h sublib.h shell.h
  813. Xfields.$(O): common.h fields.h ecommon.h formisc.h
  814. X
  815. Xformail.$(O): ../autoconf.h ../config.h includes.h formail.h sublib.h shell.h
  816. Xformail.$(O): common.h fields.h ecommon.h formisc.h header.h
  817. X
  818. Xformisc.$(O): ../autoconf.h ../config.h includes.h formail.h sublib.h shell.h
  819. Xformisc.$(O): common.h ecommon.h formisc.h
  820. X
  821. Xgoodies.$(O): ../autoconf.h ../config.h includes.h procmail.h sublib.h robust.h
  822. Xgoodies.$(O): shell.h misc.h pipes.h common.h cstdio.h goodies.h
  823. X
  824. Xlockfile.$(O): ../autoconf.h ../config.h includes.h sublib.h exopen.h robust.h
  825. Xlockfile.$(O): misc.h
  826. X
  827. Xlocking.$(O): ../autoconf.h ../config.h includes.h procmail.h robust.h shell.h
  828. Xlocking.$(O): misc.h exopen.h locking.h
  829. X
  830. Xmailfold.$(O): ../autoconf.h ../config.h includes.h procmail.h sublib.h
  831. Xmailfold.$(O): robust.h shell.h misc.h pipes.h common.h exopen.h goodies.h
  832. Xmailfold.$(O): locking.h mailfold.h network.h
  833. X
  834. Xmisc.$(O): ../autoconf.h ../config.h includes.h procmail.h sublib.h robust.h
  835. Xmisc.$(O): shell.h misc.h pipes.h common.h cstdio.h exopen.h regexp.h goodies.h
  836. Xmisc.$(O): locking.h mailfold.h
  837. X
  838. Xmultigram.$(O): ../autoconf.h ../config.h includes.h sublib.h shell.h ecommon.h
  839. Xmultigram.$(O): targetdir.h
  840. X
  841. Xpipes.$(O): ../autoconf.h ../config.h includes.h procmail.h robust.h shell.h
  842. Xpipes.$(O): misc.h pipes.h common.h cstdio.h goodies.h mailfold.h
  843. X
  844. Xprocmail.$(O): ../patchlevel.h ../autoconf.h ../config.h includes.h procmail.h
  845. Xprocmail.$(O): sublib.h robust.h shell.h misc.h pipes.h common.h cstdio.h
  846. Xprocmail.$(O): exopen.h goodies.h locking.h mailfold.h
  847. X
  848. Xregexp.$(O): ../autoconf.h ../config.h includes.h procmail.h robust.h shell.h
  849. Xregexp.$(O): misc.h regexp.h
  850. X
  851. Xrobust.$(O): ../autoconf.h ../config.h includes.h procmail.h robust.h shell.h
  852. Xrobust.$(O): misc.h mailfold.h shell.h
  853. X
  854. Xsublib.$(O): ../autoconf.h ../config.h includes.h sublib.h shell.h
  855. X
  856. Xrecommend.$(O): ../autoconf.h ../config.h includes.h
  857. X    @$(CC) -c $(CFLAGS) $*.c
  858. X
  859. X.c.$(O):
  860. X    $(CC) -c $(CFLAGS) $<
  861. X
  862. Xrecommend: recommend.$(O) sublib.$(O)
  863. X    @$(CC) $(CFLAGS) $@.$(O) sublib.$(O) -o $@ $(LDFLAGS)
  864. X
  865. X../man/man.sed: manconf.c ../autoconf.h ../config.h includes.h procmail.h
  866. X../man/man.sed: ../patchlevel.h
  867. X    @$(CC) $(CFLAGS) "-DBINDIR=\"$(BINDIR)\"" -o _autotst manconf.c \
  868. X     $(LDFLAGS)
  869. X    @./_autotst $@ $@.0 $@.1
  870. X    @$(RM) _autotst
  871. X
  872. Xclean:
  873. X    $(RM) -r _locktest
  874. X    $(RM) procmail.$(O) $(PM_OBJ) lockfile.$(O) $(LF_OBJ) formail.$O \
  875. X     $(FM_OBJ) multigram.$(O) $(BINSS) multigram ../autoconf.h _autotst* \
  876. X     lookfor _locktst* grepfor recommend recommend.$(O) manconf _Makefile \
  877. X     lock.log core targetdir.h
  878. X
  879. XMakefile: ../Makefile Makefile.0
  880. X    @echo "You have made changes to the master Makefile, in order for"
  881. X    @echo "these changes to show through, you will first have to do:"
  882. X    @echo "$(MAKE) makefiles"
  883. X
  884. Xmakefiles Makefiles makefile:
  885. X    cd ..; $(MAKE) makefiles
  886. X
  887. Xinit:
  888. X    cd ..; $(MAKE) $@
  889. END_OF_FILE
  890. if test 4587 -ne `wc -c <'procmail/src/Makefile.0'`; then
  891.     echo shar: \"'procmail/src/Makefile.0'\" unpacked with wrong size!
  892. fi
  893. # end of 'procmail/src/Makefile.0'
  894. fi
  895. if test -f 'procmail/src/formisc.c' -a "${1}" != "-c" ; then 
  896.   echo shar: Will not clobber existing file \"'procmail/src/formisc.c'\"
  897. else
  898. echo shar: Extracting \"'procmail/src/formisc.c'\" \(4968 characters\)
  899. sed "s/^X//" >'procmail/src/formisc.c' <<'END_OF_FILE'
  900. X/************************************************************************
  901. X *    Miscellaneous routines used by formail                *
  902. X *                                    *
  903. X *    Copyright (c) 1990-1992, S.R. van den Berg, The Netherlands    *
  904. X *    #include "README"                        *
  905. X ************************************************************************/
  906. X#ifdef RCS
  907. Xstatic /*const*/char rcsid[]=
  908. X "$Id: formisc.c,v 1.15 1993/02/04 12:44:49 berg Exp $";
  909. X#endif
  910. X#include "includes.h"
  911. X#include "formail.h"
  912. X#include "sublib.h"
  913. X#include "shell.h"
  914. X#include "common.h"
  915. X#include "ecommon.h"
  916. X#include "formisc.h"
  917. X
  918. Xstatic char*skipcomment(start)char*start;
  919. X{ for(;;)
  920. X     switch(*++start)
  921. X      { case ')':return start;
  922. X    case '\\':start++;break;
  923. X    case '(':start=skipcomment(start);
  924. X      }
  925. X}
  926. X                         /* skips an RFC 822 address */
  927. Xchar*skipwords(start)char*start;
  928. X{ int delim,hitspc,machref;char*target,*oldstart;
  929. X  hitspc=machref=0;target=oldstart=start;
  930. X  if(*start=='<')
  931. X     start++,machref=1;
  932. X  for(;;)
  933. X   { switch(*start)
  934. X      { case '<':                    /* machine reference */
  935. X       if(machref)                    /* can not be nested */
  936. X        { target=oldstart;hitspc=0;goto inc;        /* so start over */
  937. X        }
  938. X       goto ret;
  939. X    case '(':start=skipcomment(start);              /* comment */
  940. X    case ' ':case '\t':case '\n':hitspc|=1;           /* linear white space */
  941. Xinc:       start++;continue;
  942. X    case ',':case ';':          /* sendmail extended RFC-822 behaviour */
  943. X       if(machref)
  944. X        { machref=2;goto special;
  945. X        }
  946. X       goto retz;
  947. X    case '\\':*target++='\\';start++;            /* same here */
  948. X    default:
  949. X       if(!machref&&hitspc==3&&target>oldstart)
  950. X    case '\0':case '>':
  951. X        { if(machref==2)
  952. X           { *target++='>';tmemmove(oldstart+1,oldstart,target++-oldstart);
  953. X         *oldstart='<';
  954. X           }
  955. Xretz:          *target='\0';
  956. Xret:          return start;
  957. X        }
  958. X       hitspc=2;goto normal;                  /* normal word */
  959. X    case '@':case ':':case '.':
  960. Xspecial:   hitspc=0;
  961. Xnormal:       *target++= *start++;continue;
  962. X    case '[':delim=']';break;               /* domain-literal */
  963. X    case '"':*target++=delim='"';start++;
  964. X      }
  965. X     ;{ int i;
  966. X    do
  967. X       if((i= *target++= *start++)==delim)     /* corresponding delimiter? */
  968. X          break;
  969. X       else if(i=='\\'&&*start)            /* skip quoted character */
  970. X          *target++= *start++;
  971. X    while(*start);                        /* anything? */
  972. X      }
  973. X     hitspc=2;
  974. X   }
  975. X}
  976. X
  977. Xvoid loadsaved(sp)const struct saved*const sp;         /* load some saved text */
  978. X{ switch(*sp->rexp)
  979. X   { default:loadchar(' ');           /* make sure it has leading whitspace */
  980. X     case ' ':case '\t':;
  981. X   }
  982. X  loadbuf(sp->rexp,sp->rexl);
  983. X}
  984. X                                /* append to buf */
  985. Xvoid loadbuf(text,len)const char*const text;const size_t len;
  986. X{ if(buffilled+len>buflen)              /* buf can't hold the text */
  987. X     buf=realloc(buf,buflen+=BSIZE);
  988. X  tmemmove(buf+buffilled,text,len);buffilled+=len;
  989. X}
  990. X
  991. Xvoid loadchar(c)const int c;              /* append one character to buf */
  992. X{ if(buffilled==buflen)
  993. X     buf=realloc(buf,buflen+=BSIZE);
  994. X  buf[buffilled++]=c;
  995. X}
  996. X
  997. Xgetline P((void))               /* read a newline-terminated line */
  998. X{ if(buflast!=EOF)                 /* do we still have a leftover? */
  999. X     loadchar(buflast);                  /* load it into the buffer */
  1000. X  if(buflast!='\n')
  1001. X   { int ch;
  1002. X     while((ch=getchar())!=EOF&&ch!='\n')
  1003. X    loadchar(ch);                /* load the rest of the line */
  1004. X     loadchar('\n');            /* make sure (!), it ends with a newline */
  1005. X   }        /* (some code in formail.c depends on a terminating newline) */
  1006. X  return buflast=getchar();            /* look ahead, one character */
  1007. X}
  1008. X
  1009. Xvoid elog(a)const char*const a;                     /* error output */
  1010. X{ fputs(a,stderr);
  1011. X}
  1012. X
  1013. Xvoid tputssn(a,l)const char*a;size_t l;
  1014. X{ while(l--)
  1015. X     putcs(*a++);
  1016. X}
  1017. X
  1018. Xvoid ltputssn(a,l)const char*a;size_t l;
  1019. X{ if(logsummary)
  1020. X     totallen+=l;
  1021. X  else
  1022. X     putssn(a,l);
  1023. X}
  1024. X
  1025. Xvoid lputcs(i)const int i;
  1026. X{ if(logsummary)
  1027. X     totallen++;
  1028. X  else
  1029. X     putcs(i);
  1030. X}
  1031. X
  1032. Xvoid startprog(argv)const char*Const*const argv;
  1033. X{ int poutfd[2];
  1034. X  if(!nrtotal)                    /* no more mails to display? */
  1035. X     goto squelch;
  1036. X  if(nrskip)                  /* should we still skip this mail? */
  1037. X   { nrskip--;                             /* count it */
  1038. Xsquelch:
  1039. X     opensink();return;
  1040. X   }
  1041. X  if(nrtotal>0)
  1042. X     nrtotal--;                             /* count it */
  1043. X  dup(oldstdout);pipe(poutfd);
  1044. X  if(!(child=fork()))    /* DON'T fclose(stdin) here, provokes a bug on HP/UX */
  1045. X   { close(STDIN);close(oldstdout);close(PWRO);dup(PRDO);close(PRDO);
  1046. X     shexec(argv);
  1047. X   }
  1048. X  close(STDOUT);close(PRDO);
  1049. X  if(STDOUT!=dup(PWRO)||!(mystdout=Fdopen(STDOUT,"a")))
  1050. X     nofild();
  1051. X  close(PWRO);
  1052. X  if(-1==child)
  1053. X     nlog("Can't fork\n"),exit(EX_OSERR);
  1054. X}
  1055. X
  1056. Xvoid nofild P((void))
  1057. X{ nlog("File table full\n");exit(EX_OSERR);
  1058. X}
  1059. X
  1060. Xvoid waitforit P((void))
  1061. X{ int i;pid_t j;
  1062. X  while(child!=(j=wait(&i))||WIFSTOPPED(i))
  1063. X    if(-1==j)
  1064. X       return;
  1065. X}
  1066. X
  1067. Xvoid nlog(a)const char*const a;
  1068. X{ elog(NAMEPREFIX);elog(a);
  1069. X}
  1070. X
  1071. Xvoid logqnl(a)const char*const a;
  1072. X{ elog(" \"");elog(a);elog("\"\n");
  1073. X}
  1074. X
  1075. Xvoid closemine P((void))
  1076. X{ if((fclose(mystdout)==EOF||errout==EOF)&&!quiet)
  1077. X     nlog(couldntw),elog("\n"),exit(EX_IOERR);
  1078. X}
  1079. X
  1080. Xvoid opensink P((void))
  1081. X{ if(!(mystdout=fopen(DevNull,"a")))
  1082. X     nofild();
  1083. X}
  1084. END_OF_FILE
  1085. if test 4968 -ne `wc -c <'procmail/src/formisc.c'`; then
  1086.     echo shar: \"'procmail/src/formisc.c'\" unpacked with wrong size!
  1087. fi
  1088. # end of 'procmail/src/formisc.c'
  1089. fi
  1090. if test -f 'procmail/src/header.h' -a "${1}" != "-c" ; then 
  1091.   echo shar: Will not clobber existing file \"'procmail/src/header.h'\"
  1092. else
  1093. echo shar: Extracting \"'procmail/src/header.h'\" \(4793 characters\)
  1094. sed "s/^X//" >'procmail/src/header.h' <<'END_OF_FILE'
  1095. X/************************************************************************
  1096. X *                                    *
  1097. X *    Known fields when formail is splitting messages (the first    *
  1098. X *    "-m nnn" fields encountered should be among them or one of    *
  1099. X *    the special From_, Article_ or X- fields).            *
  1100. X *                                    *
  1101. X *    If you need to add one (be sure to update "cdigest" below as    *
  1102. X *    well!), drop me a mail, I might be interested in including    *
  1103. X *    it in the next release.                        *
  1104. X *                                    *
  1105. X ************************************************************************/
  1106. X/*$Id: header.h,v 1.22 1993/06/28 16:23:21 berg Exp $*/
  1107. X
  1108. Xstatic const char
  1109. X returnpath[]=        "Return-Path:",                  /* RFC 822 */
  1110. X received[]=        "Received:",                /* ditto ... */
  1111. X replyto[]=        "Reply-To:",
  1112. X Fromm[]=        "From:",
  1113. X sender[]=        "Sender:",
  1114. X res_replyto[]=        "Resent-Reply-To:",
  1115. X res_from[]=        "Resent-From:",
  1116. X res_sender[]=        "Resent-Sender:",
  1117. X date[]=        "Date:",
  1118. X res_date[]=        "Resent-Date:",
  1119. X to[]=            "To:",
  1120. X res_to[]=        "Resent-To:",
  1121. X cc[]=            "Cc:",
  1122. X res_cc[]=        "Resent-Cc:",
  1123. X bcc[]=            "Bcc:",
  1124. X res_bcc[]=        "Resent-Bcc:",
  1125. X messageid[]=        "Message-ID:",
  1126. X res_messageid[]=    "Resent-Message-ID:",
  1127. X inreplyto[]=        "In-Reply-To:",
  1128. X references[]=        "References:",
  1129. X keywords[]=        "Keywords:",
  1130. X subject[]=        "Subject:",
  1131. X scomments[]=        "Comments:",
  1132. X ncrypted[]=        "Encrypted:",
  1133. X errorsto[]=        "Errors-To:",               /* sendmail extension */
  1134. X retreceiptto[]=    "Return-Receipt-To:",            /* ditto ... */
  1135. X precedence[]=        "Precedence:",
  1136. X fullname[]=        "Full-Name:",
  1137. X postddate[]=        "Posted-Date:",
  1138. X recvddate[]=        "Received-Date:",
  1139. X mssage[]=        "Message:",
  1140. X text[]=        "Text:",
  1141. X via[]=            "Via:",
  1142. X x400received[]=    "X400-Received:",
  1143. X priority[]=        "Priority:",                /* ELM extension */
  1144. X fcc[]=            "Fcc:",                   /* Mush extension */
  1145. X resent[]=        "Resent:",                 /* MH extension */
  1146. X forwarded[]=        "Forwarded:",                /* ditto ... */
  1147. X replied[]=        "Replied:",
  1148. X article[]=        "Article:",             /* USENET extension */
  1149. X path[]=        "Path:",                /* ditto ... */
  1150. X summary[]=        "Summary:",
  1151. X organisation[]=    "Organisation:",
  1152. X aorganization[]=    "Organization:",
  1153. X newsgroups[]=        "Newsgroups:",
  1154. X followupto[]=        "Followup-To:",
  1155. X approved[]=        "Approved:",
  1156. X lines[]=        "Lines:",
  1157. X expires[]=        "Expires:",
  1158. X control[]=        "Control:",
  1159. X distribution[]=    "Distribution:",
  1160. X xref[]=        "Xref:",
  1161. X originator[]=        "Originator:",
  1162. X nntppostinghost[]=    "NNTP-Posting-Host:",
  1163. X submittedby[]=        "Submitted-by:",
  1164. X title[]=        "Title:",          /* antiquated USENET extension */
  1165. X aRticleid[]=        "Article-I.D.:",            /* ditto ... */
  1166. X posted[]=        "Posted:",
  1167. X relayversion[]=    "Relay-Version:",
  1168. X cnttype[]=        "Content-Type:",           /* Internet extension */
  1169. X encoding[]=        "Encoding:",                /* ditto ... */
  1170. X cntmd5[]=        "Content-MD5:",
  1171. X mimeversion[]=        "MIME-Version:",           /* MIME extension */
  1172. X cnttransferenc[]=    "Content-Transfer-Encoding:",        /* ditto ... */
  1173. X cntid[]=        "Content-ID:",
  1174. X cntdescription[]=    "Content-Description:",
  1175. X cntdisposition[]=    "Content-Disposition:",
  1176. X transportoptions[]=    "Transport-Options:",        /* SysV mailer extension */
  1177. X defltoptions[]=    "Default-Options:",
  1178. X cntlength[]=        "Content-Length:",
  1179. X rference[]=        "Reference:",
  1180. X msgtype[]=        "Message-Type:",
  1181. X autoforwardedfrom[]=    "Auto-Forwarded-From:",
  1182. X autofcount[]=        "Auto-Forward-Count:",
  1183. X endofheader[]=        "End-of-Header:",
  1184. X orgaforwfrom[]=    "Original-Auto-Forwarded-From:",
  1185. X orgdate[]=        "Original-Date:",
  1186. X notdeliveredto[]=    "Not-Delivered-To:",
  1187. X reportversion[]=    "Report-Version:",
  1188. X status[]=        "Status:",             /* mailer extension */
  1189. X readreceiptto[]=    "Read-Receipt-To:";      /* miscellaneous extension */
  1190. X
  1191. Xstatic const struct {const char*hedr;int lnr;}cdigest[]=
  1192. X{ bsl(returnpath),bsl(received),bsl(replyto),bsl(Fromm),bsl(sender),
  1193. X  bsl(res_replyto),bsl(res_from),bsl(res_sender),bsl(date),bsl(res_date),
  1194. X  bsl(to),bsl(res_to),bsl(cc),bsl(res_cc),bsl(bcc),bsl(res_bcc),bsl(messageid),
  1195. X  bsl(res_messageid),bsl(inreplyto),bsl(references),bsl(keywords),bsl(subject),
  1196. X  bsl(scomments),bsl(ncrypted),bsl(errorsto),bsl(retreceiptto),
  1197. X  bsl(precedence),bsl(fullname),bsl(postddate),bsl(recvddate),bsl(mssage),
  1198. X  bsl(text),bsl(via),bsl(x400received),bsl(priority),bsl(fcc),bsl(resent),
  1199. X  bsl(forwarded),bsl(replied),bsl(article),bsl(path),bsl(summary),
  1200. X  bsl(organisation),bsl(aorganization),bsl(newsgroups),bsl(followupto),
  1201. X  bsl(approved),bsl(lines),bsl(expires),bsl(control),bsl(distribution),
  1202. X  bsl(xref),bsl(originator),bsl(nntppostinghost),bsl(submittedby),bsl(title),
  1203. X  bsl(aRticleid),bsl(posted),bsl(relayversion),bsl(cnttype),bsl(encoding),
  1204. X  bsl(cntmd5),bsl(mimeversion),bsl(cnttransferenc),bsl(cntid),
  1205. X  bsl(cntdescription),bsl(cntdisposition),bsl(transportoptions),
  1206. X  bsl(defltoptions),bsl(cntlength),bsl(rference),bsl(msgtype),
  1207. X  bsl(autoforwardedfrom),bsl(autofcount),bsl(endofheader),bsl(orgaforwfrom),
  1208. X  bsl(orgdate),bsl(notdeliveredto),bsl(reportversion),bsl(status),
  1209. X  bsl(readreceiptto)
  1210. X};
  1211. END_OF_FILE
  1212. if test 4793 -ne `wc -c <'procmail/src/header.h'`; then
  1213.     echo shar: \"'procmail/src/header.h'\" unpacked with wrong size!
  1214. fi
  1215. # end of 'procmail/src/header.h'
  1216. fi
  1217. if test -f 'procmail/src/locking.c' -a "${1}" != "-c" ; then 
  1218.   echo shar: Will not clobber existing file \"'procmail/src/locking.c'\"
  1219. else
  1220. echo shar: Extracting \"'procmail/src/locking.c'\" \(7202 characters\)
  1221. sed "s/^X//" >'procmail/src/locking.c' <<'END_OF_FILE'
  1222. X/************************************************************************
  1223. X *    Whatever is needed for (un)locking files in various ways    *
  1224. X *                                    *
  1225. X *    Copyright (c) 1990-1992, S.R. van den Berg, The Netherlands    *
  1226. X *    #include "README"                        *
  1227. X ************************************************************************/
  1228. X#ifdef RCS
  1229. Xstatic /*const*/char rcsid[]=
  1230. X "$Id: locking.c,v 1.16 1993/06/21 14:24:30 berg Exp $";
  1231. X#endif
  1232. X#include "procmail.h"
  1233. X#include "robust.h"
  1234. X#include "shell.h"
  1235. X#include "misc.h"
  1236. X#include "exopen.h"
  1237. X#include "locking.h"
  1238. X
  1239. Xvoid lockit(name,lockp)char*name;char**const lockp;
  1240. X{ int permanent=nfsTRY,triedforce=0;struct stat stbuf;time_t t;
  1241. X  if(*lockp)
  1242. X   { if(!strcmp(name,*lockp))    /* compare the previous lockfile to this one */
  1243. X    return;             /* they're equal, save yourself some effort */
  1244. X     unlock(lockp);               /* unlock any previous lockfile FIRST */
  1245. X   }                  /* to prevent deadlocks (I hate deadlocks) */
  1246. X  if(!*name)
  1247. X     return;
  1248. X  if(!strcmp(name,defdeflock))           /* is it the system mailbox lockfile? */
  1249. X#ifdef fdlock
  1250. X     if(!accspooldir)
  1251. X      { yell("Bypassed locking",name);return;
  1252. X      }
  1253. X     else
  1254. X#endif
  1255. X    setgid(sgid);               /* try and get some extra permissions */
  1256. X  name=tstrdup(name); /* allocate now, so we won't hang on memory *and* lock */
  1257. X  for(lcking|=lck_LOCKFILE;;)
  1258. X   { yell("Locking",name);        /* in order to cater for clock skew: get */
  1259. X     if(!xcreat(name,LOCKperm,&t,0))           /* time t from the filesystem */
  1260. X      { *lockp=name;break;               /* lock acquired, hurray! */
  1261. X      }
  1262. X     switch(errno)
  1263. X      { case EEXIST:           /* check if it's time for a lock override */
  1264. X       if(!lstat(name,&stbuf)&&stbuf.st_size<=MAX_LOCK_SIZE&&locktimeout
  1265. X        &&!lstat(name,&stbuf)&&locktimeout<t-stbuf.st_mtime)
  1266. X         /*
  1267. X          * stat() till unlink() should be atomic, but can't guarantee that
  1268. X          */
  1269. X        { if(triedforce)            /* already tried, not trying */
  1270. X         goto faillock;                        /* again */
  1271. X          if(S_ISDIR(stbuf.st_mode)||unlink(name))
  1272. X         triedforce=1,nlog("Forced unlock denied on"),logqnl(name);
  1273. X          else
  1274. X           { nlog("Forcing lock on");logqnl(name);suspend();goto ce;
  1275. X           }
  1276. X        }
  1277. X       else
  1278. X          triedforce=0;         /* legitimate iteration, clear flag */
  1279. X       break;
  1280. X    case ENOENT:case ENOTDIR:case EIO:case EACCES:
  1281. X       if(--permanent)
  1282. X          goto ds;
  1283. X       goto faillock;
  1284. X#ifdef ENAMETOOLONG
  1285. X    case ENAMETOOLONG:     /* maybe filename too long, shorten and retry */
  1286. X     { int i;
  1287. X       if(0<(i=strlen(name)-1)&&!strchr(dirsep,name[i-1]))
  1288. X        { nlog("Truncating");logqnl(name);elog(" and retrying lock\n");
  1289. X          name[i]='\0';permanent=nfsTRY;goto ce;
  1290. X        }
  1291. X     }
  1292. X#endif
  1293. X    default:
  1294. Xfaillock:  nlog("Lock failure on");logqnl(name);goto term;
  1295. X    case ENOSPC:;
  1296. X#ifdef EDQUOT
  1297. X    case EDQUOT:;
  1298. X#endif
  1299. X      }
  1300. X     permanent=nfsTRY;
  1301. Xds:  sleep((unsigned)locksleep);
  1302. Xce:  if(nextexit)
  1303. Xterm: { free(name);break;             /* drop the preallocated buffer */
  1304. X      }
  1305. X   }
  1306. X  if(rc!=rc_INIT)                     /* we opened any rcfile */
  1307. X     setgid(gid);              /* we put back our regular permissions */
  1308. X  lcking&=~lck_LOCKFILE;
  1309. X  if(nextexit)
  1310. X   { elog(whilstwfor);elog("lockfile");logqnl(name);terminate();
  1311. X   }
  1312. X}
  1313. X
  1314. Xvoid lcllock P((void))                    /* lock a local lockfile */
  1315. X{ char*lckfile;
  1316. X  if(!strcmp(lckfile=tolock?tolock:strcat(buf2,tgetenv(lockext)),
  1317. X   tgetenv(lockfile)))
  1318. X     nlog("Deadlock attempted on"),logqnl(lckfile);
  1319. X  else
  1320. X     lockit(lckfile,&loclock);
  1321. X}
  1322. X
  1323. Xvoid unlock(lockp)char**const lockp;
  1324. X{ lcking|=lck_LOCKFILE;
  1325. X  if(*lockp)
  1326. X   { if(!strcmp(*lockp,defdeflock))    /* is it the system mailbox lockfile? */
  1327. X    if(!accspooldir)
  1328. X       goto no_lock;
  1329. X    else
  1330. X       setgid(sgid);           /* try and get some extra permissions */
  1331. X     yell("Unlocking",*lockp);
  1332. X     if(unlink(*lockp))
  1333. X    nlog("Couldn't unlock"),logqnl(*lockp);
  1334. X     if(rc!=rc_INIT)                     /* we opened any rcfile */
  1335. X    setgid(gid);              /* we put back our regular permissions */
  1336. X     if(!nextexit)               /* if not inside a signal handler */
  1337. X    free(*lockp);
  1338. X     *lockp=0;
  1339. X   }
  1340. Xno_lock:
  1341. X  lcking&=~lck_LOCKFILE;
  1342. X  if(nextexit==1)        /* make sure we are not inside terminate already */
  1343. X     elog(newline),terminate();
  1344. X}
  1345. X                    /* an NFS secure exclusive file open */
  1346. Xxcreat(name,mode,tim,chownit)const char*const name;const mode_t mode;
  1347. X time_t*const tim;const int chownit;
  1348. X{ char*p;int j= -2,i;
  1349. X  i=lastdirsep(name)-name;strncpy(p=malloc(i+UNIQnamelen),name,i);
  1350. X  if(unique(p,p+i,mode,verbose))       /* try and rename the unique filename */
  1351. X   { if(chownit&&chown(p,uid,sgid))             /* try and chown it */
  1352. X      { unlink(p);goto sorry;             /* forget it, no permission */
  1353. X      }
  1354. X     if(tim)
  1355. X      { struct stat stbuf;     /* return the filesystem time to the caller */
  1356. X    stat(p,&stbuf);*tim=stbuf.st_mtime;
  1357. X      }
  1358. X     j=myrename(p,name);
  1359. X   }
  1360. Xsorry:
  1361. X  free(p);return j;
  1362. X}
  1363. X    /* if you've ever wondered what conditional compilation was good for */
  1364. X#ifndef fdlock                        /* watch closely :-) */
  1365. X#ifdef USEflock
  1366. X#ifndef SYS_FILE_H_MISSING
  1367. X#include <sys/file.h>
  1368. X#endif
  1369. X#define REITflock    1
  1370. X#else
  1371. X#define REITflock    0
  1372. X#endif /* USEflock */
  1373. Xstatic oldfdlock= -1;                    /* the fd we locked last */
  1374. X#ifndef NOfcntl_lock
  1375. Xstatic struct flock flck;        /* why can't it be a local variable? */
  1376. X#define REITfcntl    1
  1377. X#else
  1378. X#define REITfcntl    0
  1379. X#endif /* NOfcntl_lock */
  1380. X#ifdef USElockf
  1381. Xstatic off_t oldlockoffset;
  1382. X#define REITlockf    1
  1383. X#else
  1384. X#define REITlockf    0
  1385. X#endif /* USElockf */
  1386. X
  1387. Xfdlock(fd)
  1388. X{ int ret;
  1389. X#if REITfcntl+REITflock+REITlockf>1
  1390. X  for(;;nlog("Reiterating kernel-lock\n"),sleep((unsigned)locksleep))
  1391. X#endif
  1392. X   {
  1393. X#ifndef NOfcntl_lock
  1394. X     flck.l_type=F_WRLCK;flck.l_whence=SEEK_SET;flck.l_len=0;
  1395. X     flck.l_start=tell(fd);
  1396. X#endif
  1397. X#ifdef USElockf
  1398. X     oldlockoffset=tell(fd);
  1399. X#endif
  1400. X     lcking|=lck_KERNEL;
  1401. X#ifndef NOfcntl_lock
  1402. X     ret=fcntl(fd,F_SETLKW,&flck);
  1403. X#ifdef USElockf
  1404. X     if((ret|=lockf(fd,F_TLOCK,(off_t)0))&&(errno==EAGAIN||errno==EACCES||
  1405. X      errno==EWOULDBLOCK))
  1406. Xufcntl:
  1407. X      { flck.l_type=F_UNLCK;fcntl(fd,F_SETLK,&flck);continue;
  1408. X      }
  1409. X#ifdef USEflock
  1410. X     if((ret|=flock(fd,LOCK_EX|LOCK_NB))&&(errno==EAGAIN||errno==EACCES||
  1411. X      errno==EWOULDBLOCK))
  1412. X      { lockf(fd,F_ULOCK,(off_t)0);goto ufcntl;
  1413. X      }
  1414. X#endif /* USEflock */
  1415. X#else /* USElockf */
  1416. X#ifdef USEflock
  1417. X     if((ret|=flock(fd,LOCK_EX|LOCK_NB))&&(errno==EAGAIN||errno==EACCES||
  1418. X      errno==EWOULDBLOCK))
  1419. X      { flck.l_type=F_UNLCK;fcntl(fd,F_SETLK,&flck);continue;
  1420. X      }
  1421. X#endif /* USEflock */
  1422. X#endif /* USElockf */
  1423. X#else /* NOfcntl_lock */
  1424. X#ifdef USElockf
  1425. X     ret=lockf(fd,F_LOCK,(off_t)0);
  1426. X#ifdef USEflock
  1427. X     if((ret|=flock(fd,LOCK_EX|LOCK_NB))&&(errno==EAGAIN||errno==EACCES||
  1428. X      errno==EWOULDBLOCK))
  1429. X      { lockf(fd,F_ULOCK,(off_t)0);continue;
  1430. X      }
  1431. X#endif /* USEflock */
  1432. X#else /* USElockf */
  1433. X#ifdef USEflock
  1434. X     ret=flock(fd,LOCK_EX);
  1435. X#endif /* USEflock */
  1436. X#endif /* USElockf */
  1437. X#endif /* NOfcntl_lock */
  1438. X     oldfdlock=fd;lcking&=~lck_KERNEL;return ret;
  1439. X   }
  1440. X}
  1441. X
  1442. Xfdunlock P((void))
  1443. X{ int i;
  1444. X  if(oldfdlock<0)
  1445. X     return -1;
  1446. X  i=0;
  1447. X#ifdef USEflock
  1448. X  i|=flock(oldfdlock,LOCK_UN);
  1449. X#endif
  1450. X#ifdef USElockf
  1451. X  lseek(oldfdlock,oldlockoffset,SEEK_SET);i|=lockf(oldfdlock,F_ULOCK,(off_t)0);
  1452. X#endif
  1453. X#ifndef NOfcntl_lock
  1454. X  flck.l_type=F_UNLCK;i|=fcntl(oldfdlock,F_SETLK,&flck);
  1455. X#endif
  1456. X  oldfdlock= -1;return i;
  1457. X}
  1458. X#endif /* fdlock */
  1459. END_OF_FILE
  1460. if test 7202 -ne `wc -c <'procmail/src/locking.c'`; then
  1461.     echo shar: \"'procmail/src/locking.c'\" unpacked with wrong size!
  1462. fi
  1463. # end of 'procmail/src/locking.c'
  1464. fi
  1465. if test -f 'procmail/src/mailfold.h' -a "${1}" != "-c" ; then 
  1466.   echo shar: Will not clobber existing file \"'procmail/src/mailfold.h'\"
  1467. else
  1468. echo shar: Extracting \"'procmail/src/mailfold.h'\" \(973 characters\)
  1469. sed "s/^X//" >'procmail/src/mailfold.h' <<'END_OF_FILE'
  1470. X/*$Id: mailfold.h,v 1.7 1993/05/28 14:43:40 berg Exp $*/
  1471. X
  1472. Xlong
  1473. X dump P((const s,const char*source,long len));
  1474. Xint
  1475. X deliver P((char*boxname,char*linkfolder));
  1476. Xvoid
  1477. X logabstract P((const char*const lstfolder)),
  1478. X concon P((const ch)),
  1479. X readmail P((int rhead,const long tobesent));
  1480. X
  1481. Xextern const char scomsat[];
  1482. Xextern logopened,tofile;
  1483. Xextern off_t lasttell;
  1484. X
  1485. X#define to_FILE        1          /* when we are writing a real file */
  1486. X#define to_FOLDER    2         /* when we are writing a filefolder */
  1487. X
  1488. X#ifdef sMAILBOX_SEPARATOR
  1489. X#define smboxseparator(fd)    (tofile==to_FOLDER&&\
  1490. X (part=len,rwrite(fd,sMAILBOX_SEPARATOR,STRLEN(sMAILBOX_SEPARATOR))))
  1491. X#define MAILBOX_SEPARATOR
  1492. X#else
  1493. X#define smboxseparator(fd)
  1494. X#endif /* sMAILBOX_SEPARATOR */
  1495. X#ifdef eMAILBOX_SEPARATOR
  1496. X#define emboxseparator(fd)    \
  1497. X (tofile==to_FOLDER&&rwrite(fd,eMAILBOX_SEPARATOR,STRLEN(eMAILBOX_SEPARATOR)))
  1498. X#ifndef MAILBOX_SEPARATOR
  1499. X#define MAILBOX_SEPARATOR
  1500. X#endif
  1501. X#else
  1502. X#define emboxseparator(fd)
  1503. X#endif /* eMAILBOX_SEPARATOR */
  1504. END_OF_FILE
  1505. if test 973 -ne `wc -c <'procmail/src/mailfold.h'`; then
  1506.     echo shar: \"'procmail/src/mailfold.h'\" unpacked with wrong size!
  1507. fi
  1508. # end of 'procmail/src/mailfold.h'
  1509. fi
  1510. echo shar: End of archive 4 \(of 11\).
  1511. cp /dev/null ark4isdone
  1512. MISSING=""
  1513. for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
  1514.     if test ! -f ark${I}isdone ; then
  1515.     MISSING="${MISSING} ${I}"
  1516.     fi
  1517. done
  1518. if test "${MISSING}" = "" ; then
  1519.     echo You have unpacked all 11 archives.
  1520.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1521. else
  1522.     echo You still need to unpack the following archives:
  1523.     echo "        " ${MISSING}
  1524. fi
  1525. ##  End of shell archive.
  1526. exit 0
  1527. -- 
  1528. Sincerely,                                  berg@pool.informatik.rwth-aachen.de
  1529.            Stephen R. van den Berg (AKA BuGless).    berg@physik.tu-muenchen.de
  1530.  
  1531. "Always look on the bright side of life!"
  1532.  
  1533. exit 0 # Just in case...
  1534.