home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume28 / procmail / part02 < prev    next >
Text File  |  1992-02-02  |  44KB  |  1,315 lines

  1. Newsgroups: comp.sources.misc
  2. From: berg@messua.informatik.rwth-aachen.de (Stephen R. van den Berg)
  3. Subject:  v28i002:  procmail - mail processing program v2.61, Part02/05
  4. Message-ID: <1992Feb2.030702.24017@sparky.imd.sterling.com>
  5. X-Md4-Signature: 42cb4045bef02405645fb8ef6bc0d186
  6. Date: Sun, 2 Feb 1992 03:07:02 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: berg@messua.informatik.rwth-aachen.de (Stephen R. van den Berg)
  10. Posting-number: Volume 28, Issue 2
  11. Archive-name: procmail/part02
  12. Environment: UNIX, sendmail, smail, MMDF
  13. Supersedes: procmail: Volume 25, Issue 01-04
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then unpack
  17. # it by saving it into a file and typing "sh file".  To overwrite existing
  18. # files, type "sh file -c".  You can also feed this as standard input via
  19. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  20. # will see the following message at the end:
  21. #        "End of archive 2 (of 5)."
  22. # Contents:  procmail/FAQ procmail/INSTALL procmail/Makefile
  23. #   procmail/README procmail/autoconf procmail/config.h
  24. #   procmail/man/formail.man procmail/man/manconf.c
  25. # Wrapped by berg@tabaqui on Fri Jan 31 14:16:32 1992
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f 'procmail/FAQ' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'procmail/FAQ'\"
  29. else
  30. echo shar: Extracting \"'procmail/FAQ'\" \(3880 characters\)
  31. sed "s/^X//" >'procmail/FAQ' <<'END_OF_FILE'
  32. X------------------------------------------------------------------------------
  33. X---------------------- Frequently Asked Questions ----------------------------
  34. X------------------------------------------------------------------------------
  35. X
  36. X1. How do I go about setting up a mailinglist?
  37. X
  38. X    Look in the examples/mailinglist file, it describes it in detail.
  39. X
  40. X2. I installed procmail (i.e. typed 'make install'), but how am I supposed to
  41. X   use it?  When I type procmail on the command line it simply does nothing.
  42. X
  43. X    You're not supposed to start procmail from the command line.
  44. X    Be sure to have a .forward and a .procmailrc file in your home
  45. X    directory (see the examples subdirectory or the man page).
  46. X    MMDF users should note that they need a .maildelivery file *instead*
  47. X    of a .forward file (see the man page for more detailed information).
  48. X
  49. X3. When I compile everything the compiler complains about invalid or illegal
  50. X   pointer combinations, but it produces the executables anyway.
  51. X   Should I be concerned?
  52. X
  53. X    Ignore these warnings, they simply indicate that either your compiler
  54. X    or your system include files are not ANSI/POSIX compliant.
  55. X    The compiler will produce correct code regardless of these warnings.
  56. X
  57. X4. The compiler seems to issue warnings about "loop not entered at top",
  58. X   is that a problem?
  59. X
  60. X    No, no problem at all, it just means I wrote the code :-)
  61. X    That's just about the only uncommon coding technique I use (don't
  62. X    think I don't try to avoid those jumps in loops, it's just that
  63. X    sometimes they are the best way to code it).  Use gcc if you want
  64. X    to avoid these warnings.
  65. X
  66. X5. The compiler complains about unmodifiable lvalues or assignments to const
  67. X   variables.  Now what?
  68. X
  69. X    Well, if the compiler produces the executables anyway everything
  70. X    probably is all right.    If it doesn't, you might try inserting a
  71. X    "#define const" in the autoconf.h file by hand.     However in any case,
  72. X    your compiler is broken; I would recommend submitting this as a
  73. X    compiler bug to your vendor.
  74. X
  75. X6. The compiler produces some excessive warnings about enums, is that a reason
  76. X   for concern?
  77. X
  78. X    Your compiler is not ANSI compliant;  so, in other words, ignore the
  79. X    warnings.
  80. X
  81. X7. The compiler refuses to compile regexp.c, what is the problem?
  82. X
  83. X    Try compiling that module with optimisation turned off.
  84. X
  85. X8. When I send myself a testmail, the mail bounces with the message: cannot
  86. X   execute binary file.     What am I doing wrong?
  87. X
  88. X    It is very well possible that mail is processed on a different
  89. X    machine from that where you usually read your mail.  Therefore you
  90. X    have to make sure that procmail has the right binary format to
  91. X    execute on those machines on which mail could arrive.  In order to
  92. X    get this right you might need to do some .forward file tweaking,
  93. X    look at the examples/advanced file for some suggestions.
  94. X
  95. X9. Where do I look for examples about:
  96. X    Crossmounted mailboxes?
  97. X    Procmail as an integrated local mail delivery agent?
  98. X    Security considerations (when installing procmail suid root)
  99. X    How to generate autoreplies?
  100. X    Exorbitant rcfile formats?
  101. X    The 'A' flag?
  102. X
  103. X    Well, this probably is your lucky day :-), all these topics are covered
  104. X    in the examples/advanced file.
  105. X
  106. X10. Why do I have to insert my login name after the '#' in the .forward or
  107. X    .maildelivery file?
  108. X
  109. X    Some mailers 'optimise' maildelivery and take out duplicates from
  110. X    Cc:, Bcc: and alias lists before delivery.  If two or more persons on
  111. X    such a list would have identical .forward files, then the mailer will
  112. X    eliminate all but one.    Adding a '#' with your login name following
  113. X    it will make the .forward files unique, and will ensure that the mailer
  114. X    does optimise away some addresses.
  115. X
  116. X11. None of the above topics cover my problem.    Should I panic?
  117. X
  118. X    Let me ask you a question :-), have you examined the CAVEATS, WARNINGS,
  119. X    BUGS and NOTES sections of the manual pages *closely* ?
  120. X    If you have, well, then panic.
  121. END_OF_FILE
  122. if test 3880 -ne `wc -c <'procmail/FAQ'`; then
  123.     echo shar: \"'procmail/FAQ'\" unpacked with wrong size!
  124. fi
  125. # end of 'procmail/FAQ'
  126. fi
  127. if test -f 'procmail/INSTALL' -a "${1}" != "-c" ; then 
  128.   echo shar: Will not clobber existing file \"'procmail/INSTALL'\"
  129. else
  130. echo shar: Extracting \"'procmail/INSTALL'\" \(4272 characters\)
  131. sed "s/^X//" >'procmail/INSTALL' <<'END_OF_FILE'
  132. XDiscusses:
  133. X        1. Getting the lot to compile
  134. X        2. DEBUGGING AID
  135. X        3. Setting up the environment
  136. X        4. Extra options if you are a system administrator
  137. X
  138. X                ---
  139. X
  140. X1. Getting the lot to compile
  141. X   --------------------------
  142. X
  143. XTo install procmail, lockfile and formail: edit Makefile & config.h accordingly
  144. Xand type 'make install'.
  145. XIntended configurable options in Makefile are: the install-destinations
  146. XIntended configurable options in config.h are: KERNEL_LOCKS and MMDF support.
  147. X
  148. X'make install' will:
  149. X      - execute autoconf (a shell script that repeatedly calls the C compiler
  150. X    to determine if certain features/symbols are supported), which will
  151. X    create a file named autoconf.h
  152. X      - compile the *.c files, create the three stripped binaries:
  153. X    procmail, lockfile and formail
  154. X      - copy these binaries to $(BINDIR)
  155. X      - copy the man pages to $(MANDIR)
  156. X
  157. X'make deinstall' will:
  158. X      - remove the just installed files in $(BINDIR)
  159. X      - remove the just installed files in $(MANDIR)
  160. X
  161. X
  162. XMinimal requirements:
  163. X
  164. Xprocmail must be installed.
  165. Xlockfile needs only to be installed if you plan to read several mailboxes
  166. X    with one of the standard mailers that don't support lockfiles.
  167. Xformail needs only to be installed if mail sometimes arrives in nonstandard
  168. X    mailbox format (or if you want to generate auto replies, split up
  169. X    mailboxes/digests etc., see the man page of formail for more info).
  170. X    Formail is not called by procmail unless *you* tell it to.
  171. X
  172. XIf things don't compile automagically, I suggest you take a look at:
  173. Xautoconf, autoconf.h, config.h, includes.h
  174. X
  175. XFor autoconf to work as intended, your compiler should either be fully ANSI
  176. Xcompliant, or you should NOT turn off all warnings; enabling all warnings
  177. Xshouldn't hurt.     In most cases the default options in the Makefile will do.
  178. X
  179. XThe sources are supposed to be fully ANSI, K&R and POSIX compliant.
  180. X
  181. X                ---
  182. X
  183. X2. DEBUGGING AID
  184. X   -------------
  185. X
  186. XSince procmail is intended to run completely independent of any terminals, it
  187. Xdoesn't use the stderr output to display error messages.  It is recommended,
  188. Xespecially during debugging, to specify a LOGFILE (see man page) in the
  189. Xrcfile or on the command line.    Procmail will log all serious problems it
  190. Xencounters.  Of course, instead of a regular file, one could also specify a
  191. Xterminal as the default logfile.
  192. X
  193. XAlso, procmail can be persuaded to be a lot more verbose by preceding the
  194. Xlogfile name by a colon.
  195. XTherefore a suggested command line for your first trial run would be:
  196. Xprocmail LOGFILE=:/dev/tty
  197. X(now type in a pseudo mail-message)
  198. X
  199. XIf all else fails, you can try uncommenting the "#define console" entry
  200. Xin the config.h file.  This will provide you with the most verbose procmail
  201. Xyou can make.  It is of course a good idea to comment out this line again
  202. Xafter your troubles have been solved.
  203. X
  204. XIf you run procmail by hand and pipe in some sample mail, then make
  205. Xsure that if you kill procmail, you use "kill pid" and NOT "kill -9 pid".
  206. XShould procmail seem to hang, check if the $LOCKFILE is still present.
  207. XIf you kill procmail with "kill pid" it will clean up the $LOCKFILE
  208. Xitself.
  209. X
  210. X                ---
  211. X
  212. X3. Setting up the environment
  213. X   --------------------------
  214. X
  215. XEvery user that wants to use procmail should have a .forward and a
  216. X.procmailrc file in his HOME directory.     For starters, you can look
  217. Xat the supplied example files in "examples".
  218. X(BTW, be sure to make .forward *world* readable).
  219. XMMDF users should note that they need a .maildelivery file *instead* of the
  220. X.forward file (see the man page for more information).
  221. X
  222. X                ---
  223. X
  224. X4. Extra options if you are a system administrator
  225. X   -----------------------------------------------
  226. X
  227. XIf you are a system administrator you can decide to install procmail
  228. Xglobally (i.e. as an equivalent substitute for the local-mail*delivery*-
  229. Xcapabilities of /bin/mail), this has the advantage that users do not need to
  230. Xhave a .forward file anymore that calls up procmail.  Simply having a
  231. X.procmailrc file in the $HOME directory will suffice.  Operation is transparent
  232. Xin this case (i.e. if no .procmailrc file is present in the $HOME directory,
  233. Xmail will be delivered as usual).
  234. X
  235. XFor direct examples on how to do this, look at the examples/advanced file.
  236. X
  237. X                ---
  238. X
  239. XFor more info about the program, see the man page or the FAQ list.
  240. END_OF_FILE
  241. if test 4272 -ne `wc -c <'procmail/INSTALL'`; then
  242.     echo shar: \"'procmail/INSTALL'\" unpacked with wrong size!
  243. fi
  244. # end of 'procmail/INSTALL'
  245. fi
  246. if test -f 'procmail/Makefile' -a "${1}" != "-c" ; then 
  247.   echo shar: Will not clobber existing file \"'procmail/Makefile'\"
  248. else
  249. echo shar: Extracting \"'procmail/Makefile'\" \(3967 characters\)
  250. sed "s/^X//" >'procmail/Makefile' <<'END_OF_FILE'
  251. X#$Id: Makefile,v 2.13 1992/01/31 11:32:45 berg Rel $
  252. X
  253. X# change BASENAME to your home directory if need be
  254. XBASENAME = /usr/local
  255. X
  256. X# You can predefine ARCHITECTURE to a bin directory suffix
  257. XBINDIR     = $(BASENAME)/bin$(ARCHITECTURE)
  258. XMANSUFFIX= 1
  259. XMANDIR     = $(BASENAME)/man/man$(MANSUFFIX)
  260. X
  261. X# Things that can be made are:
  262. X
  263. X# procmail formail lockfile        These are the three programs contained
  264. X#                    in this package
  265. X
  266. X# all            Makes all three binaries and the man pages
  267. X# install.man        Installs the man pages to $(MANDIR)
  268. X# install        Is a "make all" followed by copying all the binaries
  269. X#            and man pages to $(BINDIR) and $(MANDIR) respectively
  270. X# clean            Restores the package to pre-make state
  271. X# deinstall        Removes the previously installed binaries and man
  272. X#            pages by careful surgery
  273. X
  274. X########################################################################
  275. X# Only edit below this line if you *think* you know what you are doing #
  276. X########################################################################
  277. X
  278. X# Directory for the standard include files
  279. XUSRINCLUDE = /usr/include
  280. X
  281. XOCFLAGS = -O #-ansi -pedantic -Wid-clash-6
  282. XOLDFLAGS= -s
  283. X
  284. XCFLAGS    = $(OCFLAGS) -I$(USRINCLUDE) -I./include #-D_POSIX_SOURCE
  285. XLDFLAGS = $(OLDFLAGS)
  286. X
  287. XCC    = cc # gcc
  288. XMAKE    = make
  289. XSHELL    = /bin/sh
  290. XO    = o
  291. XRM    = rm -f
  292. X
  293. XBINS=procmail lockfile formail
  294. X
  295. XMANS=man/procmail.1 man/formail.1
  296. X
  297. XMANSO=procmail.$(MANSUFFIX) formail.$(MANSUFFIX) lockfile.$(MANSUFFIX)
  298. X
  299. XOBJ=nonint.$(O) goodies.$(O) regexp.$(O)
  300. X
  301. XDEP=shell.h procmail.h config.h
  302. X
  303. Xall:    autoconf.h $(BINS) $(MANS)
  304. X
  305. Xprocmail: procmail.$(O) $(OBJ) exopen.$(O) common.$(O) retint.$(O)
  306. X    $(CC) $(CFLAGS) -o procmail procmail.$(O) $(OBJ) exopen.$(O) \
  307. Xcommon.$(O) retint.$(O) $(LDFLAGS)
  308. X
  309. Xlockfile: lockfile.$(O) exopen.$(O)
  310. X    $(CC) $(CFLAGS) -o lockfile lockfile.$(O) exopen.$(O) ${LDFLAGS}
  311. X
  312. Xformail: formail.$(O) common.$(O)
  313. X    $(CC) $(CFLAGS) -o formail formail.$(O) common.$(O) ${LDFLAGS}
  314. X
  315. X_autotst: _autotst.$(O)
  316. X    $(CC) $(CFLAGS) -o _autotst _autotst.$(O) $(LDFLAGS)
  317. X
  318. Xautoconf.h: autoconf Makefile
  319. X    /bin/sh autoconf $(O) $(MAKE) autoconf.h
  320. X
  321. XMakefile:
  322. X
  323. X$(OBJ): $(DEP)
  324. X
  325. Xretint.$(O): $(DEP) exopen.h
  326. X
  327. Xprocmail.$(O): $(DEP) patchlevel.h
  328. X
  329. Xexopen.$(O): config.h includes.h exopen.h
  330. X
  331. Xformail.$(O): config.h includes.h shell.h
  332. X
  333. Xlockfile.$(O): config.h includes.h
  334. X
  335. Xcommon.$(O): includes.h shell.h
  336. X
  337. Xprocmail.h: includes.h
  338. X    touch procmail.h
  339. X
  340. Xincludes.h: autoconf.h
  341. X    touch includes.h
  342. X
  343. X.c.$(O):
  344. X    $(CC) -c $(CFLAGS) $*.c
  345. X
  346. Xman/man.sed: man/manconf.c config.h procmail.h
  347. X    $(CC) $(CFLAGS) -o man/manconf man/manconf.c ${LDFLAGS}
  348. X    man/manconf >man/man.sed
  349. X    rm -f man/manconf
  350. X
  351. Xman/procmail.1: man/man.sed man/procmail.man man/mansed
  352. X    /bin/sh man/mansed man/procmail.man man/procmail.1
  353. X
  354. Xman/formail.1: man/man.sed man/formail.man man/mansed
  355. X    /bin/sh man/mansed man/formail.man man/formail.1
  356. X
  357. Xinstall.man: $(MANS)
  358. X    chmod 0644 man/*.1
  359. X    cp man/procmail.1 $(MANDIR)/procmail.$(MANSUFFIX)
  360. X    cp man/lockfile.1 $(MANDIR)/lockfile.$(MANSUFFIX)
  361. X    cp man/formail.1 $(MANDIR)/formail.$(MANSUFFIX)
  362. X
  363. Xinstall: all install.man
  364. X    @chmod 0755 $(BINS)
  365. X    @cp $(BINS) $(BINDIR) || {( cd $(BINDIR); rm -f $(BINS); );\
  366. Xcp $(BINS) $(BINDIR); }
  367. X    @echo
  368. X    @cd $(BINDIR); echo Installed in $(BINDIR); ls -l $(BINS)
  369. X    @cd $(MANDIR); echo Installed in $(MANDIR); ls -l $(MANSO)
  370. X    @echo ----------------------------------------------------------------\
  371. X---------------
  372. X    @echo If you are a system administrator, you should consider \
  373. Xinstalling procmail
  374. X    @echo suid-root and/or integrating procmail into the mail-delivery \
  375. Xsystem -- for
  376. X    @echo advanced functionality --. " " For more information about this \
  377. Xtopic you should
  378. X    @echo look in the examples/advanced file.
  379. X    @echo ----------------------------------------------------------------\
  380. X---------------
  381. X
  382. Xdeinstall:
  383. X    cd $(BINDIR); $(RM) $(BINS); ls -l $(BINS)
  384. X    cd $(MANDIR); $(RM) $(MANSO); ls -l $(MANSO)
  385. X
  386. Xclean:
  387. X    $(RM) $(OBJ) common.$(O) lockfile.$(O) exopen.$(O) retint.$(O) \
  388. Xformail.$(O) procmail.$(O) $(BINS) autoconf.h _autotst* lookfor grepfor \
  389. X$(MANS) man/man.sed
  390. END_OF_FILE
  391. if test 3967 -ne `wc -c <'procmail/Makefile'`; then
  392.     echo shar: \"'procmail/Makefile'\" unpacked with wrong size!
  393. fi
  394. # end of 'procmail/Makefile'
  395. fi
  396. if test -f 'procmail/README' -a "${1}" != "-c" ; then 
  397.   echo shar: Will not clobber existing file \"'procmail/README'\"
  398. else
  399. echo shar: Extracting \"'procmail/README'\" \(4245 characters\)
  400. sed "s/^X//" >'procmail/README' <<'END_OF_FILE'
  401. XFor installation instructions see the INSTALL file.
  402. X----------------------
  403. XProcmail & formail mail processing package.
  404. XCopyright (c) 1990-1992, S.R. van den Berg, The Netherlands.
  405. X
  406. XSome legal stuff:
  407. X
  408. XUse this software package at your own risk.  The programmer cannot
  409. Xbe held liable for any incurred damages, directly or indirectly due to
  410. Xthe use of this software.
  411. X
  412. XYou are encouraged to distribute this package freely.  This package is
  413. Xhowever not to be sold (minor transfer costs excepted) or included in
  414. Xany commercially sold software package (if you want to do this anyway,
  415. Xcontact me (address below), and we'll work something out).
  416. X
  417. XIf you distribute it, please leave the package intact.    You are allowed to
  418. Xtake parts from this distribution and distribute these separately as long
  419. Xas you retain the copyright messages.  If you redistribute any part of this
  420. Xpackage in a modified form, be sure to mark the parts you changed.
  421. XIf you have some important changes that might be useful to the rest of the
  422. Xworld, contact me instead.
  423. X
  424. X-------------------------- SYSTEM REQUIREMENTS -------------------------------
  425. X
  426. XAny *NIX-alike system.
  427. X
  428. XSendmail, smail, MMDF or compatible mailers (in effect any mailer that can
  429. Xprocess RFC-822 compliant mails).
  430. X
  431. XThe most important system calls that need to be supported (among others):
  432. Xdup(),wait(),getpwent(),fork(),pipe()
  433. X
  434. XFor a more complete list of all library references see "includes.h"
  435. X
  436. X------------------------------ DESCRIPTION -----------------------------------
  437. X
  438. XThe procmail mail processing program. (v2.61 1991/01/31)
  439. X
  440. XCan be used to create mail-servers, mailing lists, sort your incoming mail
  441. Xinto separate folders/files (real convenient when subscribing to one or more
  442. Xmailing lists or for prioritising your mail), preprocess your mail, start
  443. Xany programs upon mail arrival (e.g. to generate different chimes on your
  444. Xworkstation for different types of mail) or selectively forward certain
  445. Xincoming mail automatically to someone.
  446. X
  447. XThe accompanying formail program enables you to generate autoreplies, split up
  448. Xdigests/mailboxes into the original messages, do some very simple
  449. Xheader-munging/extraction, or force mail into mail-format (with leading From
  450. Xline).
  451. X
  452. X----------------------
  453. X
  454. XI made the utmost effort to make procmail as robust as any program can be
  455. X(every conceivable system error is caught *and* handled).
  456. X
  457. XProcmail was designed to deliver the mail under the worst conditions
  458. X(file system full, out of swap space, process table full, file table full,
  459. Xmissing support files, unavailable executables; it all doesn't matter).
  460. XShould (in the unlikely event) procmail be unable to deliver your mail
  461. Xsomewhere, the mail will bounce back to the sender or reenter the mailqueue
  462. X(your choice).
  463. X
  464. XFor a more extensive list of features see the FEATURES file.
  465. X
  466. X----------------------
  467. X
  468. XHowever, as with any program, bugs cannot be completely ruled out.
  469. XI tested the program extensively, and believe it should be relatively
  470. Xbug free (no known bug at the time).  Should, however, anyone find any
  471. Xbugs (highly unlikely :-), I would be pleased (well, sort of :-) to hear
  472. Xabout it.  Please send me the patches or bug report.
  473. XI'll look at them and will try to fix it in a future release.
  474. X(BTW, if you should find any spelling or grammar errors in these files,
  475. Xit's not priority one, but if you were sending me mail anyway, don't hesitate
  476. Xto point them out to me; I like correct English just as much as you do).
  477. X
  478. XPlease note that this program essentially is supposed to be static, that
  479. Xmeans no extra features (honouring the VNIX spirit) are supposed to be
  480. Xadded (though any useful suggestions will be appreciated and evaluated if
  481. Xtime permits).
  482. X
  483. XCheers,
  484. X       Stephen R. van den Berg    at RWTH-Aachen, Germany.
  485. X
  486. XInternet E-mail:        berg@messua.informatik.rwth-aachen.de
  487. X                berg@physik.tu-muenchen.de
  488. X
  489. XOr:    P.O.Box 21074
  490. X    6369 ZG Simpelveld
  491. X    The Netherlands
  492. X
  493. X----------------------
  494. XA recent version can be picked up at various comp.sources.misc archives.
  495. XThe latest version can be obtained directly from the ftp-archive at:
  496. X
  497. X    amaru.informatik.rwth-aachen.de (137.226.112.31)
  498. X
  499. X    as compressed tar file:        pub/unix/procmail.tar.Z        <100KB
  500. X    or in compressed shar format:    pub/unix/procmail.0?.Z
  501. X----------------------
  502. END_OF_FILE
  503. if test 4245 -ne `wc -c <'procmail/README'`; then
  504.     echo shar: \"'procmail/README'\" unpacked with wrong size!
  505. fi
  506. # end of 'procmail/README'
  507. fi
  508. if test -f 'procmail/autoconf' -a "${1}" != "-c" ; then 
  509.   echo shar: Will not clobber existing file \"'procmail/autoconf'\"
  510. else
  511. echo shar: Extracting \"'procmail/autoconf'\" \(5805 characters\)
  512. sed "s/^X//" >'procmail/autoconf' <<'END_OF_FILE'
  513. X
  514. X#$Id: autoconf,v 2.15 92/01/31 13:01:34 berg Rel $
  515. X
  516. XSHELL=/bin/sh || exec /bin/sh autoconf $* # we're in a csh, feed myself to sh
  517. X
  518. X# All possible entries in autoconf.h:
  519. X
  520. X#    #define const
  521. X#    #define volatile
  522. X#    #define void char
  523. X#    typedef int mode_t;
  524. X#    typedef int pid_t;
  525. X#    typedef int uid_t;
  526. X#    typedef int gid_t;
  527. X#    typedef unsigned size_t;
  528. X#    typedef long time_t;
  529. X#    #define NOmemmove
  530. X#    #define NObcopy
  531. X#    #define NOstrstr
  532. X#    #define NOstrcspn
  533. X#    #define NOstrpbrk
  534. X#    #define NOrename
  535. X#    #define strchr(s,c) index(s,c)
  536. X#    #define endpwent()
  537. X#    #define strtol(str,ptr,base) ((long)atoi(str))
  538. X#    #define oBRAIN_DAMAGE
  539. X#    #define SMALLHEAP
  540. X#    #define SYSTEM_MAILBOX "/usr/spool/mail/$USER"
  541. X#    #define SENDMAIL "/usr/lib/sendmail"
  542. X
  543. X# A conforming ANSI compiler and POSIX library should only produce four
  544. X# entries in autoconf.h: endpwent(), rename(), SYSTEM_MAILBOX, SENDMAIL (and
  545. X# perhaps SMALLHEAP)
  546. X# Anything else indicates failure of your installation to comply with either
  547. X# the ANSI or POSIX standards (but procmail should be installable anyway).
  548. X
  549. XPATH=:$PATH
  550. XACONF=$3
  551. XMAKE=$2
  552. XDEVNULL=/dev/null
  553. Xexport SHELL
  554. Xif test -f $ACONF
  555. Xthen
  556. X trap "exit 1" 1 2 3 15
  557. Xelse
  558. X trap "rm -f $ACONF; exit 1" 1 2 3 15
  559. Xfi
  560. X
  561. Xcat >grepfor <<HERE
  562. Xif fgrep "\$1" _autotst.rrr >$DEVNULL
  563. Xthen
  564. X echo "\$2" >>$ACONF
  565. X exit 0
  566. Xfi
  567. Xexit 1
  568. XHERE
  569. Xchmod 0755 grepfor
  570. X
  571. Xcat >$ACONF <<HERE
  572. X/* This file was automagically generated by autoconf */
  573. X
  574. XHERE
  575. X
  576. X# WARNING: in ./include/stdlib.h the const keyword is already used!
  577. X#       hence the const test has to precede all others.
  578. X
  579. Xcat >_autotst.c <<HERE
  580. Xmain()
  581. X{ char*const*p;char*q;
  582. X  p= &q;return 0;
  583. X}
  584. XHERE
  585. X
  586. Xecho 'Testing for const'
  587. Xif ${MAKE} _autotst.$1 >_autotst.rrr 2>&1 && test -f _autotst.$1
  588. Xthen
  589. X grepfor const '#define const'
  590. Xelse
  591. X echo '#define const' >>$ACONF
  592. Xfi
  593. Xrm -f _autotst.$1
  594. X
  595. Xcat >_autotst.c <<HERE
  596. Xmain(){volatile int i;return(i=0);}
  597. XHERE
  598. X
  599. Xecho 'Testing for volatile'
  600. Xif ${MAKE} _autotst.$1 >$DEVNULL 2>&1 && test -f _autotst.$1
  601. Xthen
  602. X:
  603. Xelse
  604. X echo '#define volatile' >>$ACONF
  605. Xfi
  606. Xrm -f _autotst.$1
  607. X
  608. Xcat >_autotst.c <<HERE
  609. X#include "includes.h"
  610. Xvoid*vvoid;
  611. Xmain(){int i;char*p="t";
  612. X {size_t vsize_t;i=vsize_t=1;}
  613. X {pid_t vpid_t;i=vpid_t=1;}
  614. X {time_t vtime_t;i=vtime_t=1;}
  615. X {mode_t vmode_t;i=vmode_t=1;}
  616. X {uid_t vuid_t;i=vuid_t=1;}
  617. X {gid_t vgid_t;i=vgid_t=1;}
  618. X vvoid=p;
  619. X return !vvoid;}
  620. XHERE
  621. X
  622. Xecho 'Testing for void*,size_t,pid_t,time_t,mode_t,uid_t,gid_t'
  623. X${MAKE} _autotst.$1 >_autotst.rrr 2>&1
  624. Xrm -f _autotst.$1
  625. X
  626. Xgrepfor void '#define void char'
  627. Xgrepfor size_t 'typedef unsigned size_t;'
  628. Xgrepfor pid_t 'typedef int pid_t;'
  629. Xgrepfor time_t 'typedef long time_t;'
  630. Xgrepfor mode_t 'typedef int mode_t;'
  631. Xgrepfor uid_t 'typedef int uid_t;'
  632. Xgrepfor gid_t 'typedef int gid_t;'
  633. X
  634. Xcat >_autotst.c <<HERE
  635. X#include "includes.h"
  636. Xmain(){char a[2];
  637. X endpwent();memmove(a,"0",1);bcopy("0",a,1);strstr(a,"0");strcspn(a,"0");
  638. X strtol("0",(char**)0,10);strchr("0",'0');strpbrk(a,"0");rename(a,"0");
  639. X return 0;}
  640. XHERE
  641. X
  642. Xecho 'Testing for memmove, strstr, strchr, strcspn & strtol'
  643. X${MAKE} _autotst.$1 >$DEVNULL 2>&1
  644. X${MAKE} _autotst >_autotst.rrr 2>&1
  645. Xrm -f _autotst _autotst.$1
  646. X
  647. Xgrepfor strstr '#define NOstrstr'
  648. Xgrepfor strcspn '#define NOstrcspn'
  649. Xgrepfor strpbrk '#define NOstrpbrk'
  650. Xgrepfor rename '#define NOrename'
  651. Xgrepfor strchr '#define strchr(s,c) index(s,c)'
  652. Xgrepfor setpwent '#define setpwent()'
  653. Xgrepfor endpwent '#define endpwent()'
  654. Xgrepfor strtol '#define strtol(str,ptr,base) ((long)atoi(str))'
  655. Xgrepfor memmove '#define NOmemmove' &&
  656. Xif fgrep bcopy _autotst.rrr >$DEVNULL
  657. Xthen
  658. X echo '#define NObcopy' >>$ACONF
  659. X
  660. X echo 'Testing for brain damage'
  661. X cat >_autotst.c <<HERE
  662. X#include "includes.h"
  663. Xstruct tests{int a,b;};
  664. Xmain(){
  665. X return offsetof(struct tests,b);}
  666. XHERE
  667. X if ${MAKE} _autotst.$1 >$DEVNULL 2>&1
  668. X then
  669. X    :
  670. X else
  671. X    echo 'Yep, it is'            # ISC chokes on its own offsetof()
  672. X    echo '#define oBRAIN_DAMAGE' >>$ACONF
  673. X fi
  674. X rm -f _autotst.$1
  675. X
  676. Xelse
  677. X
  678. X cat >_autotst.c <<HERE
  679. X#include "includes.h"
  680. X#define M256    256
  681. X#define F33    33
  682. Xmain(){int j=0,i=M256-1;static char a[M256];
  683. X do a[i]=i;while(i--);
  684. X bcopy(a+F33,a,M256-F33);bcopy(a,a+F33,M256-F33);i=F33-1;
  685. X do j|=a[i]!=(char)(i+F33);while(i--);i=M256-1;
  686. X do j|=a[i]!=(char)i;while(--i!=F33-1);return!j;}
  687. XHERE
  688. X
  689. X echo 'Testing for bcopy handling overlaps'
  690. X ${MAKE} _autotst >$DEVNULL 2>&1
  691. X
  692. X if _autotst
  693. X then
  694. X   echo 'Sorry, incompetent bcopy'
  695. X   echo '#define NObcopy' >>$ACONF
  696. X fi
  697. X rm -f _autotst
  698. Xfi
  699. X
  700. Xcat >_autotst.c <<HERE
  701. X#include "includes.h"
  702. Xmain(){unsigned long s=(size_t)~0;int i;
  703. X for(i=1;s>>=1;++i);
  704. X if(i<=16)
  705. X    puts("#define SMALLHEAP");
  706. X return 0;}
  707. XHERE
  708. X
  709. Xecho 'Determining the most applicable block size'
  710. X
  711. X${MAKE} _autotst >$DEVNULL 2>&1
  712. X_autotst >>$ACONF
  713. Xrm -f _autotst
  714. X
  715. Xif test -d /usr/spool/mail
  716. Xthen
  717. X echo '#define SYSTEM_MAILBOX "/usr/spool/mail/$USER"' >>$ACONF
  718. Xelif test -d /usr/mail
  719. Xthen
  720. X echo '#define SYSTEM_MAILBOX "/usr/mail/$USER"' >>$ACONF
  721. Xelse
  722. X echo '#define SYSTEM_MAILBOX "$HOME/.mail"' >>$ACONF
  723. X echo Could not find the system-mailbox directory, supplied substitute
  724. Xfi
  725. X
  726. Xcat >lookfor <<HERE
  727. Xfor a in /usr/lib /lib /usr/etc /etc /usr/bin /bin /usr/local/bin /usr/lbin \
  728. X/usr/local/lib /usr/local
  729. Xdo
  730. X if test -f "\$a/\$1"
  731. X then
  732. X    echo "#define SENDMAIL \"\$a/\$1\"" >>$ACONF
  733. X    exit 0
  734. X fi
  735. Xdone
  736. Xexit 1
  737. XHERE
  738. Xchmod 0755 lookfor
  739. X
  740. Xif lookfor sendmail || lookfor smail
  741. Xthen
  742. X:
  743. Xelse
  744. X echo 'Could not find any mailer.  It should be a mailer accepting at least'
  745. X echo "one plain destination address as it's only argument (any sendmail"
  746. X echo 'compatible mailer will do), and the mail-to-be-sent on stdin.'
  747. X echo 'What is your mailer called?  (You can override this in config.h)'
  748. X read a
  749. X echo "#define SENDMAIL \"$a\"" >>$ACONF
  750. Xfi
  751. X
  752. Xrm -f _autotst* lookfor grepfor
  753. X
  754. Xecho -----------------------------autoconf.h-----------------------------------
  755. Xcat $ACONF >&2
  756. Xecho --------------------------------------------------------------------------
  757. END_OF_FILE
  758. if test 5805 -ne `wc -c <'procmail/autoconf'`; then
  759.     echo shar: \"'procmail/autoconf'\" unpacked with wrong size!
  760. fi
  761. # end of 'procmail/autoconf'
  762. fi
  763. if test -f 'procmail/config.h' -a "${1}" != "-c" ; then 
  764.   echo shar: Will not clobber existing file \"'procmail/config.h'\"
  765. else
  766. echo shar: Extracting \"'procmail/config.h'\" \(5949 characters\)
  767. sed "s/^X//" >'procmail/config.h' <<'END_OF_FILE'
  768. X/*$Id: config.h,v 2.13 1992/01/31 11:32:45 berg Rel $*/
  769. X
  770. X/*#define KERNEL_LOCKS    /* uncomment if you want to use kernel locks on file
  771. X               descriptors (not recommended if your system uses a
  772. X    buggy lockd across a net, or if your mailer uses tmp files in updating
  773. X    mailboxes and moves them into place); only advisable if your mailreader
  774. X    can't be convinced to use "dotfile"-locks */
  775. X
  776. X/*#define MAILBOX_SEPARATOR    "\1\1\1\1\n"    /* uncomment if your mail
  777. X                           system uses nonstandard
  778. X    mail separators (non sendmail or smail compatible mailers like MMDF),
  779. X    if yours is even different, uncomment and change the value of course */
  780. X
  781. X/*#define DONT_DISCARD_IFS    /* uncomment if you don't want procmail to
  782. X                   discard the value of the IFS environment
  783. X    variable, forget about this if you don't know what IFS is for */
  784. X
  785. X/*#define SYSTEM_MBOX    "$HOME/.mbox"    /* uncomment and/or change if the
  786. X                       preset default mailbox is *not*
  787. X    either /usr/spool/mail/$USER or /usr/mail/$USER (it will supersede
  788. X    the value of SYSTEM_MAILBOX) */
  789. X
  790. X/*#define DEFsendmail    "/bin/mail"    /* uncomment and/or change if the
  791. X                       preset default SENDMAIL is not
  792. X    suitable */
  793. X
  794. X/*#define console    ":/dev/console" /* uncomment if you want procmail to
  795. X                       use the console (or any other
  796. X    terminal) to print any error messages that could not be dumped in the
  797. X    "logfile".  (Only recommended for debugging purposes, if you have
  798. X    trouble creating a "logfile") */
  799. X
  800. X/************************************************************************
  801. X * Only edit below this line if you *think* you know what you are doing *
  802. X ************************************************************************/
  803. X
  804. X#define NOBODY_uid    0xfffe          /* default uid when no valid recipient */
  805. X#define NOBODY_gid    0xfffe          /* default gid when no valid recipient */
  806. X#define ROOT_uid    0
  807. X
  808. X#define INIT_UMASK    (S_IRWXG|S_IRWXO)               /* == 077 */
  809. X#define NORMperm    (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
  810. X         /* == 0666, normal mode bits used to create files, before umask */
  811. X#define LOCKperm    0      /* mode bits used while creating lockfiles */
  812. X#define MAX_LOCK_SIZE    0      /* lockfiles are expected not to be longer */
  813. X#ifndef SMALLHEAP
  814. X#define DEFlinebuf    2048         /* default max expanded line length */
  815. X#define BLKSIZ        16384          /* blocksize while reading/writing */
  816. X#define STDBUF        1024             /* blocksize for emulated stdio */
  817. X#else           /* and some lower defaults for the unfortunate amongst us */
  818. X#define DEFlinebuf    512
  819. X#define BLKSIZ        1024
  820. X#define STDBUF        128
  821. X#endif /* SMALLHEAP */
  822. X#define HOSTNAMElen    8      /* nr of significant chararacters for HOST */
  823. X#define BOGUSprefix    "BOGUS."         /* prepended to bogus mailboxes */
  824. X#define PROCMAILRC    ".procmailrc"
  825. X#define DEFsuspend    16         /* multi-purpose 'idle loop' period */
  826. X#define DEFlocksleep    8
  827. X#define TOkey        "^TO"
  828. X#define TOsubstitute    "^(To|Cc|Apparently-To):.*"
  829. X#define DEFshellmetas    "&|<>~;?*[]="            /* never put '$' in here */
  830. X#define DEFmaildir    "$HOME"
  831. X#define DEFdefault    "$ORGMAIL"
  832. X#define DEFdefaultlock    "LOCKFILE=$DEFAULT$LOCKEXT"
  833. X#define DEFmsgprefix    "msg."
  834. X#define DEFlockext    ".lock"
  835. X#define DEFshellflags    "-c"
  836. X#define DEFlocktimeout    3600                 /* defaults to one hour */
  837. X#define DEFtimeout    (DEFlocktimeout-60)       /* 60 seconds to clean up */
  838. X#define DEFnoresretry    4      /* default nr of retries if no resources left */
  839. X
  840. X#define BinSh        "/bin/sh"
  841. X#define Tmp        "/tmp"
  842. X#define DEBUGPREFIX    ':'             /* debug prefix for LOGFILE */
  843. X#define DevNull        "/dev/null"
  844. X#define DIRSEP        "/"         /* directory separator symbols, the */
  845. X                   /* last one should be the most common one */
  846. X
  847. X#define EOFName        " \t\n#`'\");"
  848. X
  849. X#define VERSIONOPT    'v'            /* option to display version */
  850. X#define PRESERVOPT    'p'                 /* preserve environment */
  851. X#define TEMPFAILOPT    't'              /* return EX_TEMPFAIL on error */
  852. X#define DELIVEROPT    'd'          /* deliver mail to named recipient */
  853. X#define PROCMAIL_USAGE    \
  854. X "Usage: procmail [-vpt] [-d recipient ] [ parameter=value | rcfile ] ...\n"
  855. X
  856. X#define MINlinebuf    128    /* minimal LINEBUF length (don't change this) */
  857. X#define FROM_EXPR    "\n\nFrom +[^\t\n ]+ +[^\t\n ]"
  858. X#define FROM        "From "
  859. X#define NSUBJECT    "^Subject:.*$"
  860. X#define MAXSUBJECTSHOW    78
  861. X#define FOLDER        "  Folder: "
  862. X#define LENtSTOP    9 /* tab stop at which message length will be logged */
  863. X
  864. X#define TABCHAR        "\t"
  865. X#define TABWIDTH    8
  866. X
  867. X#define RECFLAGS    "HBDAahbfcwi"
  868. X#define HEAD_GREP     0
  869. X#define BODY_GREP      1
  870. X#define DISTINGUISH_CASE   2
  871. X#define ALSO_NEXT_RECIPE    3
  872. X#define ALSO_N_IF_SUCC         4
  873. X#define PASS_HEAD          5
  874. X#define PASS_BODY           6
  875. X#define FILTER            7
  876. X#define CONTINUE         8
  877. X#define WAIT_EXIT          9
  878. X#define IGNORE_WRITERR           10
  879. X
  880. X#define UNIQ_PREFIX    '_'      /* prepended to temporary unique filenames */
  881. X#define ESCAP        '>'
  882. X
  883. X        /* some formail-specific configuration options: */
  884. X
  885. X#define UNKNOWN        "foo@bar"      /* formail default originator name */
  886. X#define OLD_PREFIX    "Old-"             /* formail field-Old-prefix */
  887. X
  888. X#define FM_SKIP        '+'              /* skip the first nnn messages */
  889. X#define FM_TOTAL    '-'        /* only spit out a total of nnn messages */
  890. X#define FM_BOGUS    'b'             /* leave bogus Froms intact */
  891. X#define FM_FORCE    'f'   /* force formail to accept an arbitrary format */
  892. X#define FM_REPLY    'r'            /* generate an auto-reply header */
  893. X#define FM_KEEPB    'k'           /* keep the header, when replying */
  894. X#define FM_TRUST    't'    /* trust the sender to supply a valid header */
  895. X#define FM_SPLIT    's'                      /* split it up */
  896. X#define FM_NOWAIT    'n'              /* don't wait for the programs */
  897. X#define FM_EVERY    'e'             /* split on every From line */
  898. X#define FM_DIGEST    'd'                 /* split up digests */
  899. X#define FM_QUIET    'q'            /* ignore write errors on stdout */
  900. X#define FM_EXTRACT    'x'               /* extract field contents */
  901. X#define FM_ADD_IFNOT    'a'         /* add a field if not already there */
  902. X#define FM_REN_INSERT    'i'            /* rename and insert a field */
  903. X#define FM_DEL_INSERT    'I'            /* delete and insert a field */
  904. X#define FM_USAGE    "Usage: \
  905. Xformail [+nnn] [-nnn] [-bfrktnedq] [-xaiI field] [-s command arg ...]\n"
  906. END_OF_FILE
  907. if test 5949 -ne `wc -c <'procmail/config.h'`; then
  908.     echo shar: \"'procmail/config.h'\" unpacked with wrong size!
  909. fi
  910. # end of 'procmail/config.h'
  911. fi
  912. if test -f 'procmail/man/formail.man' -a "${1}" != "-c" ; then 
  913.   echo shar: Will not clobber existing file \"'procmail/man/formail.man'\"
  914. else
  915. echo shar: Extracting \"'procmail/man/formail.man'\" \(5741 characters\)
  916. sed "s/^X//" >'procmail/man/formail.man' <<'END_OF_FILE'
  917. X.de Id
  918. X.ds Rv \\$3
  919. X.ds Dt \\$4
  920. X..
  921. X.Id $Id: formail.man,v 2.12 1992/01/31 12:07:40 berg Rel $
  922. X.de Sh
  923. X.br
  924. X.ne 11
  925. X.SH "\\$1"
  926. X..
  927. X.de Ss
  928. X.br
  929. X.ne 10
  930. X.SS "\\$1"
  931. X..
  932. X.de Tp
  933. X.br
  934. X.ne 9
  935. X.TP "\\$1"
  936. X..
  937. X.de Rs
  938. X.na
  939. X.nf
  940. X.RS
  941. X..
  942. X.de Re
  943. X.RE
  944. X.fi
  945. X.ad
  946. X..
  947. X.TH FORMAIL 1 \*(Dt BuGless
  948. X.SH NAME
  949. X.na
  950. Xformail \- mail (re)formatter
  951. X.SH SYNOPSIS
  952. X.B formail
  953. X[
  954. X.I "\fB\+FM_SKIP+\fPskip"
  955. X] [
  956. X.I "\fB\+FM_TOTAL+\fPtotal"
  957. X] [
  958. X.B \-+FM_BOGUS++FM_FORCE++FM_REPLY++FM_KEEPB++FM_TRUST++FM_NOWAIT++FM_EVERY++FM_DIGEST++FM_QUIET+
  959. X]
  960. X.if n .ti +0.5i
  961. X[
  962. X.B \-+FM_EXTRACT+
  963. X.I header field
  964. X] [
  965. X.B \-+FM_ADD_IFNOT+
  966. X.I header field
  967. X]
  968. X.if n .ti +0.5i
  969. X[
  970. X.B \-+FM_REN_INSERT+
  971. X.I header field
  972. X] [
  973. X.B \-+FM_DEL_INSERT+
  974. X.I header field
  975. X]
  976. X.if n .ti +0.5i
  977. X[
  978. X.B \-+FM_SPLIT+
  979. X.I command
  980. X.I arg
  981. X\&.\|.\|.
  982. X]
  983. X.ad
  984. X.Sh DESCRIPTION
  985. X.B formail
  986. Xis a filter that can be used to force mail into mailbox format, perform real
  987. Xrigorous `+FROM+' escaping, generate auto-replying headers, do simple
  988. Xheader munging/extracting or split up a
  989. Xmailbox/digest/articles file.  The mail/mailbox/article contents will be
  990. Xexpected on stdin.
  991. X.LP
  992. XIf formail is supposed to determine the sender of the mail, but is unable
  993. Xto find any, it will substitute `+UNKNOWN+'.
  994. X.LP
  995. XIf formail is started without any command line options, it will force any
  996. Xmail coming from stdin into mailbox format and will escape
  997. X.B all
  998. Xbogus `+FROM+' lines with a `+ESCAP+'.
  999. X.Sh OPTIONS
  1000. X.Tp 0.5i
  1001. X.B \-+FM_BOGUS+
  1002. XDon't escape any bogus mailbox headers (i.e. lines starting with `+FROM+').
  1003. X.Tp
  1004. X.B \-+FM_FORCE+
  1005. XForce formail to simply pass along any non-mailbox format (i.e. don't
  1006. Xgenerate a `+FROM+' line as the first line).
  1007. X.Tp
  1008. X.B \-+FM_REPLY+
  1009. XGenerate an auto-reply header.
  1010. X.Tp
  1011. X.B \-+FM_KEEPB+
  1012. XWhen generating the auto-reply header, keep the body as well.  If used
  1013. Xtogether with the
  1014. X.B \-+FM_BOGUS+
  1015. Xoption then the body will not be escaped.
  1016. X.Tp
  1017. X.B \-+FM_TRUST+
  1018. XTrust the sender to have used a valid return address in his header.  This
  1019. Xoption will be most useful when generating auto-reply headers from news
  1020. Xarticles.  If this option is not turned on, formail tries to digest the most
  1021. Xprobable valid return address itself.
  1022. X.Tp
  1023. X.B \-+FM_SPLIT+
  1024. XThe input will be split up into seperate mail messages, and piped into
  1025. Xa program one by one (a new program is started for every part).
  1026. X.B \-+FM_SPLIT+
  1027. Xhas to be the last option specified, the first argument following it
  1028. Xis expected to be the name of a program, any other arguments will be passed
  1029. Xalong to it.
  1030. X.Tp
  1031. X.B \-+FM_NOWAIT+
  1032. XTell formail not to wait for every program to finish before starting the next.
  1033. X.Tp
  1034. X.B \-+FM_EVERY+
  1035. XConsider every line starting with `+FROM+' to be the start of a new mail
  1036. Xmessage (this is normally not the case).
  1037. X.Tp
  1038. X.B \-+FM_DIGEST+
  1039. XEnables formail to split up digests/articles into their original parts.
  1040. X.Tp
  1041. X.B \-+FM_QUIET+
  1042. XTells formail to ignore any write errors on stdout.
  1043. X.Tp
  1044. X.I "\fB\-+FM_EXTRACT+\fP header field"
  1045. XExtract this
  1046. X.I header field
  1047. Xfrom the header, display it as a single line.
  1048. X.Tp
  1049. X.I "\fB\-+FM_ADD_IFNOT+\fP header field"
  1050. XAppend a custom
  1051. X.I header field
  1052. Xonto the header; but only if a similar field does not exist yet.
  1053. X.Tp
  1054. X.I "\fB\-+FM_REN_INSERT+\fP header field"
  1055. XSame as
  1056. X.BR \-+FM_ADD_IFNOT+ ,
  1057. Xexcept that any existing similar fields are renamed by prepending
  1058. Xan ``+OLD_PREFIX+'' prefix.  If
  1059. X.I header field
  1060. Xconsists only of a field-name, it will not be appended.
  1061. X.Tp
  1062. X.I "\fB\-+FM_DEL_INSERT+\fP header field"
  1063. XSame as
  1064. X.BR \-+FM_REN_INSERT+ ,
  1065. Xexcept that any existing similar fields are simply removed.
  1066. X.Tp
  1067. X.I "\fB\+FM_SKIP+\fPskip"
  1068. XSkip the first
  1069. X.I skip
  1070. Xmessages while splitting.
  1071. X.Tp
  1072. X.I "\fB\+FM_TOTAL+\fPtotal"
  1073. XOutput at most
  1074. X.I total
  1075. Xmessages while splitting.
  1076. X.Sh EXAMPLES
  1077. XTo use it as a general formatter in front of procmail include the following
  1078. Xprocmail recipe at the top of your +PROCMAILRC+ file:
  1079. X.ne 2
  1080. X.Rs
  1081. X:0 wf
  1082. X| formail
  1083. X.Re
  1084. X.LP
  1085. XTo split up a digest one usually uses:
  1086. X.Rs
  1087. Xformail +FM_SKIP+1 -+FM_DIGEST++FM_SPLIT+ cat >>the_mailbox_of_your_choice
  1088. X.Re
  1089. Xor
  1090. X.Rs
  1091. Xformail +FM_SKIP+1 -+FM_DIGEST++FM_SPLIT+ procmail
  1092. X.Re
  1093. X.LP
  1094. XTo supersede the Reply-To: field in a header you could use:
  1095. X.Rs
  1096. Xformail -+FM_REN_INSERT+ "Reply-To: foo@bar"
  1097. X.Re
  1098. X.Sh MISCELLANEOUS
  1099. XThe regular expression that is used to find `real' postmarks is:
  1100. X.Rs
  1101. X"\\n\\n+FROM++[^\\t\\n ]+ +[^\\n\\t ]"
  1102. X.Re
  1103. X.Sh "SEE ALSO"
  1104. X.na
  1105. X.BR mail (1),
  1106. X.BR binmail (1),
  1107. X.BR sendmail (8),
  1108. X.BR procmail (1),
  1109. X.BR sh (1)
  1110. X.ad
  1111. X.Sh DIAGNOSTICS
  1112. X.Tp 2.3i
  1113. XCan't fork
  1114. XToo many processes on this machine.
  1115. X.Tp
  1116. XCouldn't write to stdout
  1117. XThe program that formail was trying to pipe into didn't accept all the data
  1118. Xformail sent to it; this diagnostic can be disabled by the
  1119. X.B \-+FM_QUIET+
  1120. Xoption.
  1121. X.Tp
  1122. XFailed to execute "x"
  1123. XProgram not in path, or not executable.
  1124. X.Tp
  1125. XFile table full
  1126. XToo many open files on this machine.
  1127. X.Tp
  1128. XInvalid field-name: "x"
  1129. XThe specified field-name "x" does not contain a colon.
  1130. X.Sh WARNINGS
  1131. XYou can save yourself and others a lot of mischief if you try to avoid using
  1132. Xthis autoreply feature on mails coming through mailinglists.  Depending
  1133. Xon the format of the incoming mail (which in turn depends on both the
  1134. Xoriginal sender's mail agent and the mailinglist setup) formail could
  1135. Xdecide to generate an autoreply header that replies to the list (if
  1136. Xthe original sender was careful enough though, formail will be able to pick
  1137. Xhis/her address, instead of the list's).  Now if the list is not intelligent
  1138. Xenough (most aren't) this autoreply will be widely distributed.
  1139. X.Sh BUGS
  1140. Xformail does not do full RFC 822 parsing while generating a `+FROM+' or
  1141. Xa `To: ' line, hence it can be fooled by some real tricky escaped/quoted
  1142. Xstrings with `<', `>' or `(' characters in them.
  1143. X.Sh AUTHOR
  1144. XStephen R. van den Berg at RWTH-Aachen, Germany
  1145. X.Rs
  1146. Xberg@messua.informatik.rwth-aachen.de
  1147. Xberg@physik.tu-muenchen.de
  1148. X.Re
  1149. END_OF_FILE
  1150. if test 5741 -ne `wc -c <'procmail/man/formail.man'`; then
  1151.     echo shar: \"'procmail/man/formail.man'\" unpacked with wrong size!
  1152. fi
  1153. # end of 'procmail/man/formail.man'
  1154. fi
  1155. if test -f 'procmail/man/manconf.c' -a "${1}" != "-c" ; then 
  1156.   echo shar: Will not clobber existing file \"'procmail/man/manconf.c'\"
  1157. else
  1158. echo shar: Extracting \"'procmail/man/manconf.c'\" \(3622 characters\)
  1159. sed "s/^X//" >'procmail/man/manconf.c' <<'END_OF_FILE'
  1160. X/* A sed script generator (for transmogrifying the man pages automagically) */
  1161. X
  1162. X/*$Id: manconf.c,v 2.10 1992/01/31 12:07:40 berg Rel $*/
  1163. X
  1164. X#include "../config.h"
  1165. X#include "../procmail.h"
  1166. X
  1167. X#define pn(name,val)    pnr(name,(long)(val))
  1168. X
  1169. Xconst char devnull[]=DevNull;
  1170. X
  1171. Xmain()
  1172. X{
  1173. X#ifndef MAILBOX_SEPARATOR
  1174. X  ps("DOT_FORWARD",".forward");
  1175. X  ps("FW_content","\"|IFS=' ';exec /usr/local/bin/procmail #YOUR_LOGIN_NAME\"");
  1176. X#else
  1177. X  ps("DOT_FORWARD",".maildelivery");
  1178. X  ps("FW_content",
  1179. X   "* - | ? \"IFS=' ';exec /usr/local/bin/procmail #YOUR_LOGIN_NAME\"");
  1180. X#endif
  1181. X#ifndef DONT_DISCARD_IFS
  1182. X  ps("IFS_DISCARDING","For security reasons, procmail will unset the IFS\
  1183. X environment variable upon startup, even if the environment is supposed to\
  1184. X be preserved.");
  1185. X#else
  1186. X  ps("IFS_DISCARDING","Be sure to set the environment variable IFS to a\
  1187. X known value when using /bin/sh from within procmail.");
  1188. X#endif
  1189. X  ps("SYSTEM_MBOX",SYSTEM_MBOX);
  1190. X  ps("console",console);
  1191. X  pname("INIT_UMASK");printf("0%lo/g\n",INIT_UMASK);
  1192. X  pn("DEFlinebuf",DEFlinebuf);
  1193. X  ps("BOGUSprefix",BOGUSprefix);
  1194. X  ps("PROCMAILRC",PROCMAILRC);
  1195. X  pn("HOSTNAMElen",HOSTNAMElen);
  1196. X  pn("DEFsuspend",DEFsuspend);
  1197. X  pn("DEFlocksleep",DEFlocksleep);
  1198. X  ps("TOkey",TOkey);
  1199. X  ps("TOsubstitute",TOsubstitute);
  1200. X  ps("DEFshellmetas",DEFshellmetas);
  1201. X  ps("DEFmaildir",DEFmaildir);
  1202. X  ps("DEFdefault",DEFdefault);
  1203. X  ps("DEFdefaultlock",strchr(DEFdefaultlock,'=')+1);
  1204. X  ps("DEFmsgprefix",DEFmsgprefix);
  1205. X  ps("DEFsendmail",DEFsendmail);
  1206. X  ps("DEFlockext",DEFlockext);
  1207. X  ps("DEFshellflags",DEFshellflags);
  1208. X  pn("DEFlocktimeout",DEFlocktimeout);
  1209. X  pn("DEFtimeout",DEFtimeout);
  1210. X  ps("Tmp",Tmp);
  1211. X  pc("DEBUGPREFIX",DEBUGPREFIX);
  1212. X  pc("VERSIONOPT",VERSIONOPT);
  1213. X  pc("PRESERVOPT",PRESERVOPT);
  1214. X  pc("TEMPFAILOPT",TEMPFAILOPT);
  1215. X  pc("DELIVEROPT",DELIVEROPT);
  1216. X  pn("MINlinebuf",MINlinebuf);
  1217. X  ps("FROM",FROM);
  1218. X  pc("HEAD_GREP",RECFLAGS[HEAD_GREP]);
  1219. X  pc("BODY_GREP",RECFLAGS[BODY_GREP]);
  1220. X  pc("DISTINGUISH_CASE",RECFLAGS[DISTINGUISH_CASE]);
  1221. X  pc("ALSO_NEXT_RECIPE",RECFLAGS[ALSO_NEXT_RECIPE]);
  1222. X  pc("ALSO_N_IF_SUCC",RECFLAGS[ALSO_N_IF_SUCC]);
  1223. X  pc("PASS_HEAD",RECFLAGS[PASS_HEAD]);
  1224. X  pc("PASS_BODY",RECFLAGS[PASS_BODY]);
  1225. X  pc("FILTER",RECFLAGS[FILTER]);
  1226. X  pc("CONTINUE",RECFLAGS[CONTINUE]);
  1227. X  pc("WAIT_EXIT",RECFLAGS[WAIT_EXIT]);
  1228. X  pc("IGNORE_WRITERR",RECFLAGS[IGNORE_WRITERR]);
  1229. X  ps("FROM_EXPR",FROM_EXPR);
  1230. X  pc("UNIQ_PREFIX",UNIQ_PREFIX);
  1231. X  pc("ESCAP",ESCAP);
  1232. X  ps("UNKNOWN",UNKNOWN);
  1233. X  ps("OLD_PREFIX",OLD_PREFIX);
  1234. X  pc("FM_SKIP",FM_SKIP);
  1235. X  pc("FM_TOTAL",FM_TOTAL);
  1236. X  pc("FM_BOGUS",FM_BOGUS);
  1237. X  pc("FM_FORCE",FM_FORCE);
  1238. X  pc("FM_REPLY",FM_REPLY);
  1239. X  pc("FM_KEEPB",FM_KEEPB);
  1240. X  pc("FM_TRUST",FM_TRUST);
  1241. X  pc("FM_SPLIT",FM_SPLIT);
  1242. X  pc("FM_NOWAIT",FM_NOWAIT);
  1243. X  pc("FM_EVERY",FM_EVERY);
  1244. X  pc("FM_DIGEST",FM_DIGEST);
  1245. X  pc("FM_QUIET",FM_QUIET);
  1246. X  pc("FM_EXTRACT",FM_EXTRACT);
  1247. X  pc("FM_ADD_IFNOT",FM_ADD_IFNOT);
  1248. X  pc("FM_REN_INSERT",FM_REN_INSERT);
  1249. X  pc("FM_DEL_INSERT",FM_DEL_INSERT);
  1250. X  return EX_OK;
  1251. X}
  1252. X
  1253. Xpname(name)const char*const name;
  1254. X{ putchar('s');putchar('/');putchar('\\');putchar('+');putsesc(name);
  1255. X  putchar('\\');putchar('+');putchar('/');
  1256. X}
  1257. X
  1258. Xpnr(name,value)const char*const name;const long value;
  1259. X{ pname(name);printf("%ld/g\n",value);
  1260. X}
  1261. X
  1262. Xps(name,value)const char*const name,*const value;
  1263. X{ pname(name);putsesc(value);puts("/g");
  1264. X}
  1265. X
  1266. Xpc(name,value)const char*const name;const int value;
  1267. X{ pname(name);putcesc(value);puts("/g");
  1268. X}
  1269. X
  1270. Xputcesc(i)
  1271. X{ switch(i)
  1272. X   { case '\t':i='t';goto fin;
  1273. X     case '\n':i='n';
  1274. Xfin:    putchar('\\');
  1275. X     case '\\':putchar('\\');putchar('\\');
  1276. X     case '&':case '/':putchar('\\');
  1277. X   }
  1278. X  putchar(i);
  1279. X}
  1280. X
  1281. Xputsesc(a)const char*a;
  1282. X{ while(*a)
  1283. X     putcesc(*a++);
  1284. X}
  1285. END_OF_FILE
  1286. if test 3622 -ne `wc -c <'procmail/man/manconf.c'`; then
  1287.     echo shar: \"'procmail/man/manconf.c'\" unpacked with wrong size!
  1288. fi
  1289. # end of 'procmail/man/manconf.c'
  1290. fi
  1291. echo shar: End of archive 2 \(of 5\).
  1292. cp /dev/null ark2isdone
  1293. MISSING=""
  1294. for I in 1 2 3 4 5 ; do
  1295.     if test ! -f ark${I}isdone ; then
  1296.     MISSING="${MISSING} ${I}"
  1297.     fi
  1298. done
  1299. if test "${MISSING}" = "" ; then
  1300.     echo You have unpacked all 5 archives.
  1301.     rm -f ark[1-9]isdone
  1302. else
  1303.     echo You still need to unpack the following archives:
  1304.     echo "        " ${MISSING}
  1305. fi
  1306. ##  End of shell archive.
  1307. exit 0
  1308. -- 
  1309. Sincerely,                                berg@messua.informatik.rwth-aachen.de
  1310.            Stephen R. van den Berg (AKA BuGless).    berg@physik.tu-muenchen.de
  1311.  
  1312. He did a quarter of the work in *half* the time!
  1313.  
  1314. exit 0 # Just in case...
  1315.