home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume22 / elm2.3 / part08 < prev    next >
Text File  |  1990-06-07  |  51KB  |  1,610 lines

  1. Subject:  v22i067:  ELM mail syste, release 2.3, Part08/26
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4. X-Checksum-Snefru: 935d0014 c0e6160b afdee82d abbae06c
  5.  
  6. Submitted-by: Syd Weinstein <syd@dsinc.dsi.com>
  7. Posting-number: Volume 22, Issue 67
  8. Archive-name: elm2.3/part08
  9.  
  10. ---- Cut Here and unpack ----
  11. #!/bin/sh
  12. # this is part 8 of a multipart archive
  13. # do not concatenate these parts, unpack them in order with /bin/sh
  14. # file doc/newmail.1 continued
  15. #
  16. CurArch=8
  17. if test ! -r s2_seq_.tmp
  18. then echo "Please unpack part 1 first!"
  19.      exit 1; fi
  20. ( read Scheck
  21.   if test "$Scheck" != $CurArch
  22.   then echo "Please unpack part $Scheck next!"
  23.        exit 1;
  24.   else exit 0; fi
  25. ) < s2_seq_.tmp || exit 1
  26. echo "x - Continuing file doc/newmail.1"
  27. sed 's/^X//' << 'SHAR_EOF' >> doc/newmail.1
  28. Xit, and can internally reset 
  29. Xitself if any of the folders shrink in size and 
  30. Xthen grow again.
  31. X.P
  32. XThe default folder to monitor is always your incoming mailbox.
  33. X.SH EXAMPLES
  34. XSome example invocations:
  35. X.nf
  36. X
  37. X    $ \fBnewmail\fR
  38. X
  39. X.fi
  40. Xwill check your imcoming mailbox every 60 seconds.
  41. X.nf
  42. X
  43. X    $ \fBnewmail  -i  15  joe  root\fR
  44. X
  45. X.fi
  46. Xwill monitor the incoming mailboxes for ``joe'' and ``root'',
  47. Xchecking every 15 seconds for new mail.
  48. X.nf
  49. X
  50. X    $ \fBnewmail  "mary=Mary"  +postmaster=POBOX\fR
  51. X
  52. X.fi
  53. Xwill monitor the incoming mailbox for user ``mary'', prefixing
  54. Xall messages with the string ``Mary'', and the folder in 
  55. Xthe users \fImaildir\fR directory called ``postmaster'', 
  56. Xprefixing all of those messages with ``POBOX''.
  57. X.P
  58. XYou can also have more complex monitoring too, for example:
  59. X.nf
  60. X
  61. X    $ \fBnewmail  -i  30  $LOGNAME=me  ${LOGNAME}su=myroot   /tmp/mbox\fR
  62. X
  63. X.fi
  64. Xwill check every 30 seconds for the users mailbox, a mailbox that
  65. Xis the users login-name with ``su'' appended (e.g. ``joe'' would
  66. Xbecome ``joesu'') and the file /tmp/mbox, prefixing new mail
  67. Xfor each with ``me'', ``myroot'' and ``mbox'' respectively.
  68. X.SH AUTHOR
  69. XDave Taylor, Hewlett-Packard Laboratories.
  70. X.SH SEE ALSO
  71. Xnotify in sh(1) or csh(1)
  72. X.SH BUG REPORTS TO
  73. XSyd Weinstein    elm@DSI.COM    (dsinc!elm)
  74. X.SH COPYRIGHTS
  75. X.ps 18
  76. X\fB\(co\fR\s12 Copyright 1986, 1987 by Dave Taylor
  77. X.br
  78. X.ps 18
  79. X\fB\(co\fR\s12 Copyright 1988, 1989, 1990 by The USENET Community Trust
  80. SHAR_EOF
  81. echo "File doc/newmail.1 is complete"
  82. chmod 0444 doc/newmail.1 || echo "restore of doc/newmail.1 fails"
  83. echo "x - extracting doc/printmail.1 (Text)"
  84. sed 's/^X//' << 'SHAR_EOF' > doc/printmail.1 &&
  85. X.TH PRINTMAIL 1L "Elm Version 2.3" "USENET Community Trust"
  86. X.SH NAME
  87. Xprintmail - format mail in a readable fashion for printing
  88. X.SH SYNOPSIS
  89. X.B printmail
  90. X{-p}
  91. X{filename}
  92. X.SH DESCRIPTION
  93. X.I Printmail
  94. Xcopies all messages from either the file specified or the
  95. Xdefault user mailbox with each message separated by a line of dashes.
  96. XWith the
  97. X.B \-p
  98. Xoption, the messages are separated by a formfeed instead.
  99. X.sp
  100. XIn fact, this command is actually just a slightly differently
  101. Xformatted call to \fIreadmsg\fR:
  102. X.nf
  103. X    readmsg {-p} {-f \fIfilename\fR} *
  104. X.fi
  105. Xwhich does all the work here.
  106. X.SH EXAMPLE
  107. XA typical usage of this command is;
  108. X.nf
  109. X
  110. X    printmail | lpr 
  111. X
  112. X.fi
  113. X.SH AUTHOR
  114. XDave Taylor, Hewlett-Packard Laboratories.
  115. X.SH SEE\ ALSO
  116. Xreadmsg(1L)
  117. X.SH BUG REPORTS TO
  118. XSyd Weinstein    elm@DSI.COM    (dsinc!elm)
  119. X.SH COPYRIGHTS
  120. X.ps 18
  121. X\fB\(co\fR\s12 Copyright 1986, 1987 by Dave Taylor
  122. X.br
  123. X.ps 18
  124. X\fB\(co\fR\s12 Copyright 1988, 1989, 1990 by The USENET Community Trust
  125. SHAR_EOF
  126. chmod 0444 doc/printmail.1 || echo "restore of doc/printmail.1 fails"
  127. echo "x - extracting doc/readmsg.1 (Text)"
  128. sed 's/^X//' << 'SHAR_EOF' > doc/readmsg.1 &&
  129. X.TH READMSG 1L "Elm Version 2.3" "USENET Community Trust"
  130. X.SH NAME
  131. Xreadmsg - read messages from incoming mail
  132. X.SH SYNOPSIS
  133. X.B readmsg 
  134. X[\fB-p\fR]
  135. X[\fB-n\fR]
  136. X[\fB-f filename\fR]
  137. X[\fB-h\fR]
  138. X.br
  139. X.B readmsg
  140. X[\fB-p\fR]
  141. X[\fB-n\fR]
  142. X[\fB-f filename\fR]
  143. X[\fB-h\fR]
  144. Xnumber [number ...]
  145. X.br
  146. X.B readmsg 
  147. X[\fB-p\fR]
  148. X[\fB-n\fR]
  149. X[\fB-f filename\fR]
  150. X[\fB-h\fR]
  151. Xpattern
  152. X.br
  153. X.SH DESCRIPTION
  154. X.I Readmsg
  155. Xis a program that gives the \fIelm\fR user the functionality of
  156. Xthe mailx "~r" command from the editor of their choice.  There
  157. Xare three different ways of using the program;
  158. X.P
  159. XFirst off, if you're actually creating a reply to a message
  160. Xfrom within the \fIelm\fR system then \fIreadmsg\fR without any
  161. Xarguments will include a summary of the headers and the body 
  162. Xof the message being replied
  163. Xto.  If you aren't currently editing a message the program will
  164. Xreturn an error.
  165. X.P
  166. XSecondly, if you want to include certain messages, you can
  167. Xspecify them by listing their ordinal locations in the 
  168. Xmail file (that is, their "message numbers")
  169. Xup to 25 at a time.  The \fImeta-\fRnumber '$' is understood to mean
  170. Xthe last message in the mailfile.  Similarly, '*' is understood to
  171. Xrepresent every message in the file (that is, 1-$)
  172. X.P
  173. XFinally, you can also specify a pattern that occurs in one of
  174. Xthe messages as a way of including it.  This pattern can be
  175. Xtyped in directly (no quotes) if the words are separated by a 
  176. Xsingle space in the actual message.  The pattern matching is case
  177. Xsensitive, so "Hello" and "hello" are NOT the same thing!!
  178. X.sp
  179. X.P
  180. XThe \fB-f\fR flag indicates that you'd rather use the file specified
  181. Xfor the operations specified rather than the default mailbox.
  182. X.P
  183. XThe \fB-h\fR flag instructs the program to include the entire header
  184. Xof the matched message or messages when displaying their
  185. Xtext.  (default is to display the From: Date: and Subject: lines
  186. Xonly)
  187. X.P
  188. XThe \fB-n\fR flag instructs the program to exclude \fIall\fR
  189. Xheaders.  This is used mostly for extracting files mailed and
  190. Xsuch.
  191. X.P
  192. XFinally, the \fB-p\fR flag indicates that the program should
  193. Xput form-feeds (control-L) between message headers.
  194. X.sp
  195. X.SH "EXAMPLES"
  196. XFirst off, to use this from within \fBvi\fR to include the text of the 
  197. Xcurrent message at the end of the current message, you could
  198. Xuse the command;
  199. X.nf
  200. X
  201. X    !!readmsg
  202. X
  203. X.fi
  204. X(as you hit the 'G' the editor will put you at the bottom of the screen
  205. Xwith the '!' prompt).
  206. X.sp 2
  207. XLet's look at something more interesting, however;
  208. X.sp
  209. XSuppose you have the mailfile;
  210. X.nf
  211. X
  212. X   From joe Jun 3 1986 4:45:30 MST
  213. X   Subject: hello
  214. X   
  215. X   Hey Guy!  Wanta go out and have a milk this evening?
  216. X   
  217. X   Joe
  218. X   
  219. X   From john Jun 3 1986 4:48:20 MST
  220. X   Subject: Dinner at Eight
  221. X   From: John Dinley <xyz!john>
  222. X
  223. X   Remember you should show up about eight, okay?
  224. X
  225. X           - John D -
  226. X
  227. X   From xxzyz!cron Jun 3 1986 5:02:43 MST
  228. X
  229. X   Cannot connect to server: blob
  230. X   Job 43243 deleted from queue.
  231. X   
  232. X.fi
  233. XThe following commands will result in;
  234. X.nf
  235. X
  236. X  $ readmsg 2        
  237. X  [ display the second message, from John ]
  238. X
  239. X  $ readmsg         
  240. X  [ an error, unless we're calling from \fIelm\fR ]
  241. X
  242. X  $ readmsg BLOB    
  243. X  [ no match - case sensitive! ]
  244. X
  245. X  $ readmsg -h connect to server 
  246. X  [ displays third message, including headers ]
  247. X
  248. X.fi
  249. X.SH FILES
  250. X/usr/mail/<username>           The incoming mail
  251. X.br
  252. X$HOME/.readmsg            The temp file from \fIelm\fR
  253. X.SH AUTHOR
  254. XDave Taylor, Hewlett-Packard Laboratories
  255. X.SH SEE\ ALSO
  256. Xnewmail(1L), elm(1L)
  257. X.SH BUGS
  258. XThe '*' metacharacter doesn't always work as expected!
  259. X.br
  260. XPerhaps the pattern matching should be case insensitive?
  261. X.SH BUG REPORTS TO
  262. XSyd Weinstein    elm@DSI.COM    (dsinc!elm)
  263. X.SH COPYRIGHTS
  264. X.ps 18
  265. X\fB\(co\fR\s12 Copyright 1986, 1987 by Dave Taylor
  266. X.br
  267. X.ps 18
  268. X\fB\(co\fR\s12 Copyright 1988, 1989, 1990 by The USENET Community Trust
  269. SHAR_EOF
  270. chmod 0444 doc/readmsg.1 || echo "restore of doc/readmsg.1 fails"
  271. echo "x - extracting doc/tmac.n (Text)"
  272. sed 's/^X//' << 'SHAR_EOF' > doc/tmac.n &&
  273. X.\" @(#)$Id: tmac.n,v 4.1 90/04/28 22:41:47 syd Exp $
  274. X.\" The News macro package
  275. X.\"
  276. X.\" This  is  the macro package that is used to format news documents.  It
  277. X.\" was written because many sites do not have one of the -mm or -ms pack-
  278. X.\" ages that the documents use.   This is NOT compatible with EITHER, but
  279. X.\" (I hope) will become the standard for all news  documents  (man  pages
  280. X.\" excepted, since everyone seems to have -man.)
  281. X.\"
  282. X.\" This package was written using  only  the  "NROFF/TROFF Users' Guide",
  283. X.\" and  therefore  if  you  can run NROFF/TROFF, you can legitimately use
  284. X.\" this package.  However, because NROFF/TROFF are proprietary  programs,
  285. X.\" I  cannot  place  this  package in the public domain.  This should not
  286. X.\" matter, because if you legitimately have  NROFF/TROFF,  you  have  the
  287. X.\" documentation; if not, you can't run off the documentation anyway.
  288. X.\"
  289. X.\" This  package may be circulated freely with the news documentation; it
  290. X.\" may not be sold, but is to be distributed with  the  unformatted  news
  291. X.\" documents.  However,  the name of the author and the place at which it
  292. X.\" was written (in the author's own  time,  of  course)  are  not  to  be
  293. X.\" removed  from the package regardless of how it is modified or altered.
  294. X.\" Further, please do not distribute this package if you make any changes
  295. X.\" because  I  don't want to get bug reports of macros I haven't written;
  296. X.\" if you have a goodie you want me to add, send it to me and we'll talk.
  297. X.\" (I really do like feedback!)  I'd really appreciate your cooperation.
  298. X.\"
  299. X.\" Author:    Matt Bishop
  300. X.\"        Research Institute for Advanced Computer Science
  301. X.\"        Mail Stop 230-5
  302. X.\"         NASA Ames Research Center
  303. X.\"        Moffett Field, CA  94035
  304. X.\"
  305. X.\" version 1.0        September 28, 1985    mab@riacs.arpa
  306. X.\"     initial version
  307. X.\" version 1.1        October 25, 1985    mab@riacs.arpa
  308. X.\"    fixed an incredibly obscure footnote bug (that occurred twice in
  309. X.\"    the news documentation!) which put footnoted words on  one  page
  310. X.\"    and the footnote on the next if the word was in the next-to-last
  311. X.\"    or last line; commented it, and generally cleaned up
  312. X.\" Version 1.2        October 27, 1985    mab@riacs.arpa
  313. X.\"    Added a few more comments and a check to keep footnotes lined up
  314. X.\"    with the bottom margin.
  315. X.\" Version 1.3        February 12, 1986    mab@riacs.arpa
  316. X.\"    Added an error check to catch unmatched ef's and ed's
  317. X.\" Version 1.4        December 29, 1986    mab@riacs.edu
  318. X.\"    Changed footnote for ux, pd, and vx macros and  added  a  string
  319. X.\"    for rg ("Registered Trademark")
  320. X.\" Version 1.5        January 2, 1989        Matt.Bishop@dartmouth.edu
  321. X.\"    Minor modifications for nroff compatibility
  322. X.\" Version 1.6        March 15, 1989        Matt.Bishop@dartmouth.edu
  323. X.\"                        ..!bear.dartmouth.edu!bishop
  324. X.\"    Fixed a bug in footnote handling (again, sigh ...)  This one
  325. X.\"    occurred when the the "fo" trap position was reset just beneath
  326. X.\"    the current line; the footnote overflow trap would kick in and
  327. X.\"    never be closed.
  328. X.\"
  329. X.\"
  330. X.\" **********
  331. X.\" these preserve and restore various things
  332. X.\" they are used to shorten other macros
  333. X.de yf                    \" restore fonts
  334. X.ft \\n(f2                \" previous font
  335. X.ft \\n(f1                \" current font
  336. X..
  337. X.de yi                    \" restore indents
  338. X'in \\n(i2u                \" previous indent
  339. X'in \\n(i1u                \" current indent
  340. X..
  341. X.de ys                    \" restore point sizes
  342. X.ps \\n(s2                \" previous point size
  343. X.ps \\n(s1                \" current point size
  344. X..
  345. X.de yv                    \" restore vertical spacings
  346. X.vs \\n(v2u                \" previous vertical spacing
  347. X.vs \\n(v1u                \" current vertical spacing
  348. X..
  349. X.de ya                    \" restore everything
  350. X.yf                    \" restore fonts
  351. X.yi                    \" restore indents
  352. X.ys                    \" restore point sizes
  353. X.yv                    \" restore vertical spacing
  354. X.if \\n(f1==0 .ft CW            \" unknown font, set to CW
  355. X..
  356. X.de zf                    \" preserve fonts
  357. X.nr f1 \\n(.f                \" current font
  358. X.ft                    \" switch to previous font
  359. X.nr f2 \\n(.f                \" previous font
  360. X.ft                    \" back to current font
  361. X..
  362. X.de zi                    \" preserve indents
  363. X.nr i1 \\n(.iu                \" current indent
  364. X'in                    \" switch to previous indent
  365. X.nr i2 \\n(.iu                \" previous indent
  366. X'in                    \" back to current indent
  367. X..
  368. X.de zs                    \" preserve point sizes
  369. X.nr s1 \\n(.su                \" current point size
  370. X.ps                    \" switch to previous point size
  371. X.nr s2 \\n(.su                \" previous point size
  372. X.ps                    \" back to current point size
  373. X..
  374. X.de zv                    \" preserve vertical spacings
  375. X.nr v1 \\n(.vu                \" current vertical spacing
  376. X.vs                    \" switch to previous vertical spacing
  377. X.nr v2 \\n(.vu                \" previous vertical spacing
  378. X.vs                    \" back to current vertical spacing
  379. X..
  380. X.de za                    \" save everything
  381. X.zf                    \" save fonts
  382. X.zi                    \" save indents
  383. X.zs                    \" save point sizes
  384. X.zv                    \" save vertical spacings
  385. X..
  386. X.\" **********
  387. X.\" these actually print the header and footer titles
  388. X.\" they are defined separately from the "hd" and "fo" macros
  389. X.\" to make user redefinition easy
  390. X.de pt                    \" print header title
  391. X.                    \" omit header on first page
  392. X.if \\n%>1 \{\
  393. X'    sp |\\$1u            \" move to proper position
  394. X.    ft 1                \" change to default font
  395. X.    ps \\n(ps            \" change to default point size
  396. X.    vs \\n(vs            \" change to default spacing
  397. X.    tl '\\*(h0'\\*(h1'\\*(h2'    \" center title
  398. X.    vs                \" restore current vertical spacing
  399. X.    ps                \" restore current point size
  400. X.    ft                \" restore current font
  401. X.\}
  402. X..
  403. X.de pf                    \" print footer title
  404. X.ft 1                    \" change to default font
  405. X.ps \\n(ps                \" change to default point size
  406. X.vs \\n(vs                \" change to default spacing
  407. X.ie \\n%=1 .tl '\\*(h0'\\*(h1'\\*(h2'    \" on first page, print the header here
  408. X.el        .tl '\\*(f0'\\*(f1'\\*(f2'    \" on other pages, print the footer
  409. X.vs                    \" restore current vertical spacing
  410. X.ps                    \" restore current point size
  411. X.ft                    \" restore current font
  412. X..
  413. X.\" **********
  414. X.\" these are the top of page (header) and bottom of page (footer) macros
  415. X.\" they don't actually print anything, just call the right macros
  416. X.de hd                    \" header -- do top of page processing
  417. X.if t .if \\n(cm .tl '\(rn'''        \" drop cut mark if needed
  418. X.pt \\n(ttu                \" print header
  419. X.nr fc 0 1                \" init footnote count
  420. X.nr fs \\n(.pu-\\n(bmu-1u        \" if any footnotes, start print here
  421. X.nr fp 0-\\n(bmu            \" reset current footer place
  422. X.ch fo -\\n(bmu                \" reset footer trap
  423. X.if \\n(dn .fz                \" put leftover footnotes st bottom
  424. X.ya                    \" restore font, etc.
  425. X'sp |\\n(tmu                \" move to top of body
  426. X.ns                    \" don't allow any more space
  427. X..
  428. X.de fo                    \" footer -- do bottom of page processing
  429. X.za                    \" save font, etc.
  430. X.rs                    \" you want motions here
  431. X.nr dn 0                \" clobber diversion size register
  432. X.if \\n(fc .fd                \" now print the footnotes, if any
  433. X'bp                    \" force out page
  434. X..
  435. X.\" **********
  436. X.\" these are the footnote macros
  437. X.\" here's an overview:
  438. X.\"    Footnotes are processed in environment #1, which is  initialized
  439. X.\"    at the bottom of this package.  When "fn" is called, nroff/troff
  440. X.\"    switches to this environment.  The body of the footnote is saved
  441. X.\"    in  the  diversion  "tf" (for "temporary footnote"), so you will
  442. X.\"    NEVER spring a trap during the first reading of a footnote. When
  443. X.\"    "ef" ("end footnote") is called,  the diversion  is  closed.  If
  444. X.\"    this  is the first footnote on the page (ie, the number register
  445. X.\"    "fc" is 1), and the footnote height (plus the height of 1  line)
  446. X.\"    crosses  the  bottom  margin,  you get the footnoted word on one
  447. X.\"    page and the footnote on the other.  In this case we  just  call
  448. X.\"    "fo"  manually  (taking case it cannot be re-invoked on the same
  449. X.\"    page!)  If this situation does not occur,  we  just  adjust  the
  450. X.\"    footer  trap's  position upwards (we'll get to how far in a min-
  451. X.\"    ute); if this puts the trap above the current line,  we  reposi-
  452. X.\"    tion  the trap just beneath the current line to be sure of trig-
  453. X.\"    triggering it once the current line is forced out.
  454. X.\"     To reposition the footer trap, we proceed as  follows.  Because
  455. X.\"    the  trap  may be sprung in the middle of a line, it is possible
  456. X.\"    that the footnote will not fit on the page (regardless of  where
  457. X.\"    on the page the footnoted word occurs -- really!) if we move the
  458. X.\"    trap up by the size of  the  footnote  diversion  "tf".  So,  we
  459. X.\"    fudge things a little bit -- for the first footnote on each page
  460. X.\"    we move the footer trap up 1 extra line ("line" being 1v in env-
  461. X.\"    ironment  #0).   Unless  the point size and vertical spacing are
  462. X.\"    increased between the first footnote and the footer trap's being
  463. X.\"    sprung,  this  will  keep  the footnotes on the same page as the
  464. X.\"    footnoted word.  But as there may be now as much as 1v of  space
  465. X.\"    between the footnote and the bottom margin, which looks HIDEOUS,
  466. X.\"    we use the number register "fs" to mark where  the  footer  trap
  467. X.\"    would  REALLY go, and just space to it when it comes time to put
  468. X.\"    out the footnotes.
  469. X.de fd                    \" dump footnotes
  470. X.nr gs 1v                \" get a measure of 1 line in env #0
  471. X.ev 1                    \" switch to footnote environment
  472. X.nr gs +2v                \" min of 2 lines of footnotes
  473. X.                    \" if the number register ns > 0,
  474. X.                    \" the last text line may contain a
  475. X.                    \" footnote that is too big to fit;
  476. X.                    \" this checks for such a note and
  477. X.                    \" if so, forces the footnote into
  478. X.                    \" the "fy" diversion that carries
  479. X.                    \" it onto the next text page
  480. X.ie (\\n(nsu>0)&(\\n(gsu>=\\n(.tu) 'sp \\n(gsu    \" be sure you can get it down
  481. X.el .if \\n(fsu>\\n(nlu 'sp \\n(fsu-\\n(nlu    \" move to footnote start position
  482. X'nf                    \" don't reprocess footnotes
  483. X'in 0                    \" don't indent them any more either
  484. X.tf                    \" drop text of footnotes
  485. X.rm tf
  486. X.if '\\n(.z'fy' .di            \" end overflow diversion, if any
  487. X.nr fc 0                \" re-init footnote count
  488. X.ev                    \" return to usual environment
  489. X..
  490. X.de fn                    \" start footnote
  491. X.                    \" look for nested footnotes -- ILLEGAL
  492. X.ie \\n(if>0 .er "footnote within footnote"
  493. X.el .da tf                \" append footnote to footnote diversion
  494. X.nr if +1                \" increment level of footnoting
  495. X.nr fc +1                \" one more footnote on this page
  496. X.if \\n(fc=1 .nr fp -1v            \" The reason for this "fudge factor"
  497. X.                    \" is that there is no way to force
  498. X.                    \" NROFF/TROFF to invoke a macro at
  499. X.                    \" the end of each line.  At times,
  500. X.                    \" the trap boundary will not match up
  501. X.                    \" with the bottom of a line, so the
  502. X.                    \" "fo" trap which is set at 2320 may
  503. X.                    \" not be triggered until 2340 -- and
  504. X.                    \" then the footnote won't fit.  This
  505. X.                    \" gives some slack so the footnote is
  506. X.                    \" more likely to fit. *sigh*
  507. X.ev 1                    \" enter footnote environment
  508. X.if \\n(fc=1 .fs            \" drop separator if first footnote
  509. X.br                    \" flush out any previous line in footnote
  510. X.fi                    \" process footnote in fill mode
  511. X..
  512. X.de ef                    \" end footnote
  513. X.br                    \" flush out the line in footnote
  514. X.ie \\n(if<=0 .er "end footnote has no corresponding begin footnote"
  515. X.el \{\
  516. X.    nr if -1            \" decrement level of footnoting
  517. X.    nr fg 2v            \" remember this for repositioning fo
  518. X.    ev                \" back to usual environment
  519. X.    if \\n(if=0 \{\
  520. X.        di            \" end of footnote proper
  521. X.        nr fp -\\n(dnu        \" "fo" will be moved at least up this far
  522. X.        nr fs -\\n(dnu        \" increase size of footnote
  523. X.        ch fo \\n(fpu        \" reposition "fo" trap (first guess)
  524. X.                    \" the first part of the "ie" clause
  525. X.                    \" is taken in the special case
  526. X.                    \" described above
  527. X.        ie (\\n(fc=1)&((\\n(nlu+1v+\\n(fgu)>=(\\n(.pu-\\n(bmu)) \{\
  528. X.            nr ns \\n(dnu    \" suppress footnote separator
  529. X.                    \" since this footnote contains it
  530. X.                    \" keep "fo" from being invoked twice
  531. X.            ch fo \\n(.pu+1i
  532. X.            fo        \" force the page out AT ONCE
  533. X.            nr ns 0        \" re-enable footnote separator
  534. X.        \}
  535. X.                    \" footnote won't fit completely
  536. X.                    \" invoke the footer trap but
  537. X.                    \" don't worry about the footnote
  538. X.                    \" separator (it's already there)
  539. X.        el .if (\\n(nlu+1v)>=(\\n(.pu+\\n(fpu) \{\
  540. X.                    \" as before we must reposition the
  541. X.                    \" "fo" trap to prevent "fo" from
  542. X.                    \" being invoked twice
  543. X.            ch fo \\n(.pu+1i
  544. X.            fo        \" force the page out AT ONCE
  545. X.        \}
  546. X.    \}
  547. X.\}
  548. X..
  549. X.de fs                    \" drop footnote separator
  550. X.                    \" only if not already dropped
  551. X.if \\n(ns=0 \l'1i'
  552. X.nr ns 0                \" in case footnotes are over 1 page long
  553. X..
  554. X.de fx                    \" process footnote overflow
  555. X.if \\n(fc .di fy            \" stuff them in the right place
  556. X..
  557. X.de fz                    \" deposit footnote overflow
  558. X.fn                    \" treat it as a footnote
  559. X.nf                    \" it's already been processed
  560. X.in 0                    \"   and indented
  561. X.fy                    \" "fx" put it here
  562. X.ef                    \" end the footnote
  563. X..
  564. X.\" **********
  565. X.\" the ones after here are user-invoked (like "fn" and "ef" above)
  566. X.\" title, author, etc.
  567. X.de mt                    \" main title
  568. X\&
  569. X.sp |\\n(mtu                \" space
  570. X.ft 3                    \" in bold
  571. X.ps \\n(ps+2p                \" large point size and
  572. X.vs \\n(vs+2p                \" vertical spacing
  573. X.ce 1000                \" center the title
  574. X.nr t2 1                \" space it
  575. X..
  576. X.de au                    \" author
  577. X.nr t2 0                \" spacing here
  578. X.sp 2v                    \" space
  579. X.ft 2                    \" in italics
  580. X.ps \\n(ps                \" usual point size and
  581. X.vs \\n(vs                \" vertical spacing
  582. X.ce 1000                \" center the name(s)
  583. X..
  584. X.de ai                    \" author's institution
  585. X.if \\n(t2 .sp 2v            \" space after a title
  586. X.nr t2 0                \" institution
  587. X.ft 2                    \" in italics
  588. X.ps \\n(ps                \" usual point size and
  589. X.vs \\n(vs                \" vertical spacing
  590. X.ce 1000                \" center the name(s)
  591. X..
  592. X.de bt                    \" begin text macro
  593. X.nr t2 0                \" hold it here
  594. X.nr it +1                \" mark as called
  595. X.ce 0                    \" end any centering
  596. X.sn 3v                    \" a little bit of space
  597. X..
  598. X.\" paragraph
  599. X.de si                    \" start indented section
  600. X.nr lo \\n(lm                \" remember the current level
  601. X.nr lm +1                \" go to the next level
  602. X.ie '\\$1'' .nr l\\n(lm \\n(l\\n(lo+5n    \" if no arg, indent 5n
  603. X.el         .nr l\\n(lm \\$1n        \" otherwise, indent that much
  604. X..
  605. X.de ei                    \" end indent
  606. X.nr lm -1                \" down one level
  607. X.if \\n(lm<0 .nr lm 0            \" make sure you don't go too far
  608. X..
  609. X.de pg                    \" plain old paragraph
  610. X.if !\\n(it .bt                \" end the title and such
  611. X.sn \\n(pdu                \" inter-paragraph spacing
  612. X.ft 1                    \" reset a few things (paranoia)
  613. X.                    \" these ONLY if not in footnote
  614. X.ie \\n(if=0 \{\
  615. X.    ps \\n(ps            \" reset point size
  616. X.    vs \\n(vs            \" reset vertical spacing
  617. X.    ne 1v+\\n(.Vu            \" slightly more than 1 line
  618. X.\}
  619. X.el \{\
  620. X.    ps \\n(ps-2p            \" reset point size
  621. X.    vs \\n(vs-2p            \" reset vertical spacing
  622. X.\}
  623. X.in \\n(l\\n(lmu            \" stop any indenting
  624. X.ce 0                    \" stop any centering
  625. X.if !'\\$1'L' .if !'\\$1'l' .ti +\\n(piu    \" indent the sucker
  626. X..
  627. X.de lp                    \" labelled paragraph
  628. X.pg l                    \" reset paragraph
  629. X.if \\n(.$>1 .nr li \\$2n        \" if indent given use it
  630. X.in +\\n(liu                \" indent for paragraph
  631. X.ti -\\n(liu                \" force first line NOT to indent
  632. X.ta +\\n(liu                \" for the label
  633. X\&\\$1\t\c
  634. X.if \\w'\\$1'u>=(\\n(l\\n(lmu+\\n(liu) .br    \" don't overwrite
  635. X..
  636. X.\" The following two macros (hu & hn) have been modified for ELM usage.
  637. X.\" If the macros have text as part of the macro call, the text will be
  638. X.\" increased in size by two points.  After printing the text, the font
  639. X.\" will be returned to normal, otherwise the font will be left bold.
  640. X.\"
  641. X.\" section
  642. X.de hu                    \" header, unnumbered
  643. X.                    \" format: .hu [text]
  644. X.if !\\n(it .bt                \" end the title and such
  645. X.br                    \" force out previous line
  646. X.b
  647. X.ie \\n(hP .ps \\n(hP
  648. X.el        .ps \\n(ps
  649. X.ie \\n(hv .vs \\n(hv
  650. X.el        .vs \\n(vs
  651. X.in \\n(l\\n(lmu            \" stop any indenting
  652. X.sn \\n(hsu                \" inter-section spacing
  653. X.ne 3v+\\n(.Vu                \" slightly more than 3 lines
  654. X.fi                    \" process the text, too
  655. X.if \\n(.$>=1 \{\
  656. X.ps +2
  657. X\\$1
  658. X.\}
  659. X.if \\n(.$>=2 \\$2
  660. X.if \\n(.$>=3 \\$3
  661. X.if \\n(.$>=4 \\$4
  662. X.if \\n(.$>=5 \\$5
  663. X.if \\n(.$>=6 \\$6
  664. X.if \\n(.$>=7 \\$7
  665. X.if \\n(.$>=8 \\$8
  666. X.if \\n(.$=9 \\$9
  667. X.if \\n(.$>=1 \{\
  668. X.ps -2
  669. X.br
  670. X.ft 1
  671. X.\}
  672. X..
  673. X.de hn                    \" header, numbered
  674. X.                    \" format: .hn [level] [text]
  675. X.if !\\n(it .bt                \" end the title and such
  676. X.br                    \" force out previous line
  677. X.b
  678. X.ie \\n(hP .ps \\n(hP
  679. X.el        .ps \\n(ps
  680. X.ie \\n(hv .vs \\n(hv
  681. X.el        .vs \\n(vs
  682. X.in \\n(l\\n(lmu            \" stop any indenting
  683. X.sn \\n(hsu                \" inter-section spacing
  684. X.ne 3v+\\n(.Vu                \" slightly more than 3 lines
  685. X.fi                    \" process the text, too
  686. X.ie !'\\$1'' .nr hn \\$1
  687. X.el          .nr hn 1
  688. X.ie \\n(hn>0 .nr hn -1
  689. X.el          .nr hn 0
  690. X.ie \\n(hn=0 \{\
  691. X.    nr h0 +1            \" add 1 to main section header
  692. X.    nr h1 0                \" zap remaining section numbers
  693. X.    nr h2 0                \" zap remaining section numbers
  694. X.    nr h3 0                \" zap remaining section numbers
  695. X.ie \\n(.$>=2 \{\
  696. X.ps +2
  697. X\\n(h0.
  698. X.ps -2
  699. X.\}
  700. X.el \\n(h0.
  701. X.\}
  702. X.el .ie \\n(hn=1 \{\
  703. X.    nr h1 +1            \" add 1 to the section header
  704. X.    nr h2 0                \" zap remaining section numbers
  705. X.    nr h3 0                \" zap remaining section numbers
  706. X.ie \\n(.$>=2 \{\
  707. X.ps +2
  708. X\\n(h0.\\n(h1.
  709. X.ps -2
  710. X.\}
  711. X.el \\n(h0.\\n(h1.
  712. X.\}
  713. X.el .ie \\n(hn=2 \{\
  714. X.    nr h2 +1            \" add 1 to the section header
  715. X.    nr h3 0                \" zap remaining section numbers
  716. X.ie \\n(.$>=2 \{\
  717. X.ps +2
  718. X\\n(h0.\\n(h1.\\n(h2.
  719. X.ps -2
  720. X.\}
  721. X.el \\n(h0.\\n(h1.\\n(h2.
  722. X.\}
  723. X.el \{\
  724. X.    nr h3 +1            \" add 1 to the section number
  725. X.ie \\n(.$>=2 \{\
  726. X.ps +2
  727. X\\n(h0.\\n(h1.\\n(h2.\\n(h3.
  728. X.ps -2
  729. X.\}
  730. X.el \\n(h0.\\n(h1.\\n(h2.\\n(h3.
  731. X.\}
  732. X.if \\n(.$>=2 \{\
  733. X.ps +2
  734. X\\$2
  735. X.\}
  736. X.if \\n(.$>=3 \\$3
  737. X.if \\n(.$>=4 \\$4
  738. X.if \\n(.$>=5 \\$5
  739. X.if \\n(.$>=6 \\$6
  740. X.if \\n(.$>=7 \\$7
  741. X.if \\n(.$>=8 \\$8
  742. X.if \\n(.$>=9 \\$9
  743. X.if \\n(.$>=2 \{\
  744. X.br
  745. X.ft 1
  746. X.ps -2
  747. X.\}
  748. X..
  749. X.\" displays (no floats, thank God!)
  750. X.de sd                    \" start display
  751. X.                    \" look for nested displays -- ILLEGAL
  752. X.ie \\n(id>0 .er "display within display"
  753. X.el \{\
  754. X.    ie '\\$1'c' .nr sf 1        \" center the sucker
  755. X.    el          .nr sf 0        \" don't center it
  756. X.\}
  757. X.sn \\n(pdu                \" a little bit of space
  758. X.ev 2                    \" switch to display environment
  759. X.nf                    \" what you type is what you get
  760. X.if \\n(id=0 .di dd            \" start saving text
  761. X.rs                    \" don't eat leading space
  762. X.nr id +1                \" increment level of display
  763. X..
  764. X.de ed                    \" end display
  765. X.br                    \" flush line
  766. X.ie \\n(id<=0 .er "end display has no corresponding begin display"
  767. X.el \{\
  768. X.    nr id -1            \" decrement level of display
  769. X.    if \\n(id=0 \{\
  770. X.        di            \" end diversion
  771. X.        fi            \" resume filling
  772. X.        in -\\n(piu        \" dedent
  773. X.        ev            \" pop environment
  774. X.        ne \\n(dnu        \" be sure you have room
  775. X.        nf            \" don't reprocess display
  776. X.        rs            \" don't eat leading space
  777. X.        zi            \" save indents
  778. X.        ie \\n(sf .in (\\n(llu-\\n(dlu)/2u    \" center on the line length
  779. X.        el .in +\\n(piu        \" indent the sucker
  780. X.        dd            \" drop display
  781. X.        yi            \" restore indents
  782. X.    \}
  783. X.\}
  784. X.fi                    \" resume filling
  785. X.sn \\n(pdu                \" a little bit of space
  786. X..
  787. X.\" **********
  788. X.\" fonts -- if argument(s), apply only to first
  789. X.de b                    \" bold (font 3)
  790. X.ie \\n(.$>0 \\&\\$3\\f3\\$1\\fP\\$2
  791. X.el .ft 3
  792. X..
  793. X.de i                    \" italics (font 2)
  794. X.ie \\n(.$>0 \\&\\$3\\f2\\$1\\fP\\$2
  795. X.el .ft 2
  796. X..
  797. X.de r                    \" roman (font 1)
  798. X.ft 1                    \" just restore it
  799. X..
  800. X.de bi                    \" bold italics (embolden font 2)
  801. X\\&\\$3\c
  802. X\\kb\\f2\\$1\\fP\\h'|\\nbu+2u'\\f2\\$1\\fP\\$2
  803. X..
  804. X.\" **********
  805. X.\" point sizes -- if argument(s), apply only to first
  806. X.de sm                    \" reduce point size by 2
  807. X.ie \\n(.$>0 \\&\\$3\\s-2\\$1\\s0\\$2
  808. X.el .ps -2
  809. X..
  810. X.de is                    \" increase point size by 2
  811. X.ie \\n(.$>0 \\&\\$3\\s+2\\$1\\s0\\$2
  812. X.el .ps +2
  813. X..
  814. X.de nl                    \" return to normal size
  815. X.ps \\n(ps                \" just reset the point size
  816. X..
  817. X.\" **********
  818. X.\" handy force space/inhibit more space macros
  819. X.de sn                    \" space, then turn on nospace mode
  820. X.sp \\$1                \" space
  821. X.ns                    \" ignore any more space requests
  822. X..
  823. X.de sr                    \" force out space
  824. X.rs                    \" turn on spacing mode
  825. X.sp \\$1                \" space
  826. X..
  827. X.\" **********
  828. X.\" end of text and error macros
  829. X.de et                    \" end of text macro
  830. X.                    \" this: (1) flushes rest of line
  831. X.                    \" (2) trips the footer, taking
  832. X.                    \" care of footnotes
  833. X.sp \\n(.pu
  834. X.                    \" check for open displays or footnotes
  835. X.if \\n(id>0 .er "unfinished display"
  836. X.if \\n(if>0 .er "unfinished footnote"
  837. X.                    \" this one means an -mn bug (*sigh*)
  838. X.if !'\\n(.z'' .er "diversion \\n(.z not closed"
  839. X..
  840. X.de er                    \" print error message
  841. X.                    \" flag it as an error
  842. X.ds ws "** ERROR **
  843. X.                    \" if you have it, give the file name
  844. X.if !'\\*(.f'' .as ws " file \\*(.f,
  845. X.                    \" put out the line number
  846. X.as ws " line \\n(.c
  847. X.                    \" and finally the error message
  848. X.tm \\*(ws: \\$1
  849. X..
  850. X.\" **********
  851. X.\" macros in this section are VERY specific to the news documentation
  852. X.de pa                    \" protocol appellation (darn names!)
  853. X\\&\\$3\\f2\\$1\\fP\\$2
  854. X..
  855. X.de ng                    \" news group name
  856. X\\&\\$3\\f3\\$1\\fP\\$2
  857. X..
  858. X.de cn                    \" computer name
  859. X\\&\\$3\\f2\\$1\\fP\\$2
  860. X..
  861. X.de hf                    \" header field
  862. X\\&\\$3\\*(lq\\$1\\*(rq\\$2
  863. X..
  864. X.de cf                    \" contents of field
  865. X\\&\\$3\\*(lq\\$1\\*(rq\\$2
  866. X..
  867. X.de qc                    \" quote control char (command)
  868. X\\&\\$3\\f3<\\s-2\\$1\\s0>\\fP\\$2
  869. X..
  870. X.de qp                    \" quote printing char (command)
  871. X\\&\\$3\\f3\\$1\\fP\\$2
  872. X..
  873. X.de op                    \" option
  874. X\\&\\$3\\f3\\$1\\fP\\$2
  875. X..
  876. X.\" **********
  877. X.\" trademarked names
  878. X.de pd                    \" print "PDP-11"
  879. X.ie \\n(p1 \\&\\$2\\s-1PDP\\s0-11\\$1
  880. X.el \{\
  881. X.    nr p1 +1            \" mark footnote as dropped
  882. X\\&\\$2\\s-1PDP\\s0-11\\*(rg\\$1
  883. X.    fn                \" put out the footnote
  884. X\\&\\*(rgPDP-11 is a registered trademark of Digital Equipment Corporation.
  885. X.    ef                \" short and sweet ...
  886. X.\}
  887. X..
  888. X.de ux                    \" print "UNIX"
  889. X.ie \\n(ux \\&\\$2\\s-1UNIX\\s0\\$1
  890. X.el \{\
  891. X.    nr ux +1            \" mark footnote as dropped
  892. X\\&\\$2\\s-1UNIX\\s0\\*(rg\\$1
  893. X.    fn                \" put out the footnote
  894. X\\&\\*(rgUNIX is a registered trademark of AT&T.
  895. X.    ef                \" short and sweet ...
  896. X.\}
  897. X..
  898. X.de vx                    \" print "VAX"
  899. X.ie \\n(vx \\&\\$2\\s-1VAX\\s0\\$1
  900. X.el \{\
  901. X.    nr vx +1            \" mark footnote as dropped
  902. X\\&\\$2\\s-1VAX\\s0\\*(rg\\$1
  903. X.    fn                \" put out the footnote
  904. X\\&\\*(rgVAX is a trademark of Digital Equipment Corporation.
  905. X.    ef                \" short and sweet ...
  906. X.\}
  907. X..
  908. X.\" **********
  909. X.\" set up string and number registers
  910. X.                    \" set up for the date
  911. X.if \n(mo=1  .ds mo January
  912. X.if \n(mo=2  .ds mo February
  913. X.if \n(mo=3  .ds mo March
  914. X.if \n(mo=4  .ds mo April
  915. X.if \n(mo=5  .ds mo May
  916. X.if \n(mo=6  .ds mo June
  917. X.if \n(mo=7  .ds mo July
  918. X.if \n(mo=8  .ds mo August
  919. X.if \n(mo=9  .ds mo September
  920. X.if \n(mo=10 .ds mo October
  921. X.if \n(mo=11 .ds mo November
  922. X.if \n(mo=12 .ds mo December
  923. X.ds dy "\*(mo \n(dy, 19\n(yr
  924. X.if \n(dw=1  .ds dw Sunday
  925. X.if \n(dw=2  .ds dw Monday
  926. X.if \n(dw=3  .ds dw Tuesday
  927. X.if \n(dw=4  .ds dw Wednesday
  928. X.if \n(dw=5  .ds dw Thursday
  929. X.if \n(dw=6  .ds dw Friday
  930. X.if \n(dw=7  .ds dw Saturday
  931. X.                    \" NROFF dependencies
  932. X.if n \{\
  933. X.                    \" string registers
  934. X.    ds rg (R)
  935. X.    ds lq ""
  936. X.    ds rq ""
  937. X.    ds f1 "\*(dy
  938. X.                    \" number registers
  939. X.    nr hs 1v            \" space before section header
  940. X.    nr pd 1v            \" inter-paragraph spacing
  941. X.    nr bm 1.0i            \" height of bottom margin
  942. X.\}
  943. X.                    \" NROFF dependencies
  944. X.if t \{\
  945. X.                    \" string registers
  946. X.    ds rg \\u\\s-2\\(rg\\s0\\d
  947. X.    ds lq ``
  948. X.    ds rq ''
  949. X.                    \" number registers
  950. X.    nr hs 1v            \" space before section header
  951. X.    nr pd 0.3v            \" inter-paragraph spacing
  952. X.    nr bm 1.0i+1v            \" height of bottom margin (wacky laser)
  953. X.\}
  954. X.                    \" these are the same for [NT]ROFF
  955. X.ds dg \(dg
  956. X.ds vr "News Version B2.11
  957. X.ds pv "News macros 1.5
  958. X.ds h1 - % -
  959. X.nr bt 0.5i+1v                \" bottom of page to footer
  960. X.nr cm 0                \" no cut marks
  961. X.nr fc 0 1                \" init footnote count
  962. X.nr fl 5.5i                \" footnote line length
  963. X.nr fp 0-\n(bmu                \" fo macro trap location
  964. X.nr h0 0                \" init section header level 0
  965. X.nr h1 0                \" init section header level 1
  966. X.nr h2 0                \" init section header level 2
  967. X.nr h3 0                \" init section header level 3
  968. X.nr id 0                \" 1 in display
  969. X.nr if 0                \" 1 in keep
  970. X.nr it 0                \" 1 when beyond title, etc.
  971. X.nr li 5n                \" indent for labelled paragraph
  972. X.nr ll 6.5i                \" line length
  973. X.nr lm 0                \" left margin
  974. X.nr l0 0                \" first indent level
  975. X.nr mt 1.5i+1v                \" title goes down this far
  976. X.nr pi 5n                \" regular paragraph indent
  977. X.nr po 1.0i                \" page offset
  978. X.nr ps 10                \" point size
  979. X.nr tm 1.0i                \" height of top margin
  980. X.nr tt 0.5i-0.5v            \" top of page to header
  981. X.nr p1 0                \" no PDP-TM message yet
  982. X.nr ux 0                \" no UNIX-TM message yet
  983. X.nr vx 0                \" no VAX-TM message yet
  984. X.nr vs 12                \" vertical spacing
  985. X.\" set things up
  986. X.\" DSINC changes for XROFF
  987. X.nr f1 1
  988. X.nr f2 1
  989. X.nr s1 10
  990. X.nr s2 10
  991. X.nr v1 12
  992. X.nr v2 12
  993. X.ps 10
  994. X.vs 12
  995. X.\" DSINC end changes for XROFF
  996. X.po \n(pou                \" set page offset
  997. X.ps \n(ps                \" set previous, current
  998. X.ps \n(ps                \"   point sizes
  999. X.vs \n(vs                \" set previous, current
  1000. X.vs \n(vs                \"   vertical spacings
  1001. X.ll \n(llu                \" set line length
  1002. X.lt \n(llu                \" set title line length
  1003. X.ev 1                    \" *** footnote environment
  1004. X.ps \n(ps-2p                \" set previous, current
  1005. X.ps \n(ps-2p                \"   point sizes
  1006. X.vs \n(vs-2p                \" set previous, current
  1007. X.vs \n(vs-2p                \"   vertical spacings
  1008. X.ll \n(flu                \" set line length
  1009. X.lt \n(flu                \" set title line length
  1010. X.ev                    \" *** pop environment
  1011. X.ev 2                    \" *** footnote environment
  1012. X.ps \n(ps                \" set previous, current
  1013. X.ps \n(ps                \"   point sizes
  1014. X.vs \n(vs                \" set previous, current
  1015. X.vs \n(vs                \"   vertical spacings
  1016. X.ll \n(llu                \" set line length
  1017. X.lt \n(llu                \" set title line length
  1018. X.ev                    \" *** pop environment
  1019. X.\" now set internal registers (for the first header section)
  1020. X.nr f1 \n(.f                \" saved font #1
  1021. X.nr f2 \n(.f                \" saved font #2
  1022. X.nr s1 \n(.s                \" saved point size #1
  1023. X.nr s2 \n(.s                \" saved point size #2
  1024. X.nr v1 \n(.v                \" saved vertical spacing #1
  1025. X.nr v2 \n(.v                \" saved vertical spacing #2
  1026. X.\" install traps
  1027. X.wh 0i hd                \" position header trap
  1028. X.wh -\n(bmu fo                \" position footer trap
  1029. X.wh \n(.pu+1i fx            \" put footnote overflow trap here
  1030. X.ch fx -\n(bmu                \" move it over fo
  1031. X.wh -\n(btu pf                \" print the bottom margin here
  1032. X.em et                    \" at end of file, call et
  1033. X.\" couple of miscellaneous requests
  1034. X.bd S 3 3                \" embolden special font chars if B
  1035. X.hy 2                    \" don't hyphenate last lines
  1036. SHAR_EOF
  1037. chmod 0444 doc/tmac.n || echo "restore of doc/tmac.n fails"
  1038. echo "x - extracting doc/wnewmail.1 (Text)"
  1039. sed 's/^X//' << 'SHAR_EOF' > doc/wnewmail.1 &&
  1040. X.TH WNEWMAIL 1L "Elm Version 2.3" "USENET Community Trust"
  1041. X.SH NAME
  1042. Xwnewmail - daemon to asynchronously notify of new mail
  1043. X.SH SYNOPSIS
  1044. X.B wnewmail
  1045. X.br
  1046. X.B wnewmail
  1047. Xfilename
  1048. X.PP
  1049. X.SH DESCRIPTION
  1050. X.I Wnewmail\^
  1051. Xis a daemon designed to run in \fBa window\fR on a windowing
  1052. Xsystem (such as an HP or Sun system) and check every 10 seconds
  1053. Xto see if there is any new mail for the user that
  1054. Xstarted it up.
  1055. X.P
  1056. XIf there is new mail, the program will "beep", and write to
  1057. Xthe window for each of the new messages;
  1058. X.nf
  1059. X
  1060. X   Mail from <name> -- <subject>
  1061. X
  1062. X.fi
  1063. Xwhere <name> is either the name of the person sending it,
  1064. Xif available (the ARPA 'From:' line) or machine!login where
  1065. Xmachine is the machine the mail was sent from.  If there
  1066. Xis no subject, the message "<no subject>" will appear on
  1067. Xthe screen.
  1068. X.P
  1069. XIf the message is a \fIpriority\fR message (that is, the
  1070. Xheader contains a line "Priority:"), then the line output
  1071. Xwill be "PRIORITY mail from ..." rather than just "Mail from".
  1072. X.P
  1073. XThis program will run forever, and can internally reset 
  1074. Xitself if mail is deleted from the incoming mailbox while
  1075. Xtrying to monitor it.
  1076. X.P
  1077. XIf \fBwnewmail\fR is started up with a filename, it will
  1078. Xperform exactly the same, but with the specified file as
  1079. Xthe one to check rather than the default users mailbox.
  1080. X.SH AUTHOR
  1081. XDave Taylor, Hewlett-Packard Laboratories.
  1082. X.SH SEE ALSO
  1083. Xnotify in sh(1) or csh(1), newmail(1L)
  1084. X.SH NOTE
  1085. XThis is almost identical to the program \fBnewmail\fR...
  1086. X.SH BUG REPORTS TO
  1087. XSyd Weinstein    elm@DSI.COM    (dsinc!elm)
  1088. X.SH COPYRIGHTS
  1089. X.ps 18
  1090. X\fB\(co\fR\s12 Copyright 1986, 1987 by Dave Taylor
  1091. X.br
  1092. X.ps 18
  1093. X\fB\(co\fR\s12 Copyright 1988, 1989, 1990 by The USENET Community Trust
  1094. SHAR_EOF
  1095. chmod 0444 doc/wnewmail.1 || echo "restore of doc/wnewmail.1 fails"
  1096. echo "x - extracting filter/Makefile.SH (Text)"
  1097. sed 's/^X//' << 'SHAR_EOF' > filter/Makefile.SH &&
  1098. Xcase $CONFIG in
  1099. X'')
  1100. X    if test ! -f config.sh; then
  1101. X    ln ../config.sh . || \
  1102. X    ln ../../config.sh . || \
  1103. X    ln ../../../config.sh . || \
  1104. X    (echo "Can't find config.sh."; exit 1)
  1105. X    fi
  1106. X    . ./config.sh
  1107. X    ;;
  1108. Xesac
  1109. Xcase "$0" in
  1110. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  1111. Xesac
  1112. X
  1113. Xecho "Extracting filter/Makefile (with variable substitutions)"
  1114. Xcat >Makefile <<!GROK!THIS!
  1115. X#
  1116. X# @(#)$Id: Makefile.SH,v 4.1 90/04/28 22:41:51 syd Exp $
  1117. X#  Makefile for the Elm system filter program
  1118. X#
  1119. X#    Copyright (c) 1986, 1987 Dave Taylor
  1120. X#    Copyright (c) 1988, 1989, 1990 USENET Community Trust
  1121. X#
  1122. X# Bug reports, patches, comments, suggestions should be sent to:
  1123. X#
  1124. X#    Syd Weinstein - elm@DSI.COM
  1125. X#            dsinc!elm
  1126. X#
  1127. X#  $Log:    Makefile.SH,v $
  1128. X# Revision 4.1  90/04/28  22:41:51  syd
  1129. X# checkin of Elm 2.3 as of Release PL0
  1130. X# 
  1131. X#
  1132. X# Variables
  1133. X#    Variables established by Configure
  1134. XCC        =    $cc
  1135. XCCFLAGS        =    $ccflags $xencf
  1136. XCHGRP        =    $chgrp
  1137. XCHMOD        =    $chmod
  1138. XCP        =    $cp
  1139. XDEST        =    $bin
  1140. XECHO        =    $echo
  1141. XLFLAGS        =    $ldflags $xenlf
  1142. XLIB        =    $lib
  1143. XLIB2        =     $libs
  1144. XLIBS        =    $termlib $dbm
  1145. XLINT        =    $lint
  1146. XMAILGRP        =    $mailgrp
  1147. XMAILERMODE    =    $mailermode
  1148. XMAKE        =    $make
  1149. XMV        =    $mv
  1150. XOPTIMIZE    =    $optimize
  1151. XRM        =     $rm -f
  1152. XTOUCH        =    $touch
  1153. X
  1154. X!GROK!THIS!
  1155. X
  1156. Xcat >>Makefile <<'!NO!SUBS!'
  1157. X#    Variables you may want to manually edit
  1158. X#        If you want debug logging then you'll
  1159. X#        want to uncomment the following.
  1160. X#DEBUG        =    -DDEBUG
  1161. X
  1162. X#    Other variables
  1163. XBIN        =    ../bin
  1164. XINCLDIR        =    ../hdrs
  1165. XCFLAGS        =    $(CCFLAGS) $(OPTIMIZE) -I$(INCLDIR) $(DEBUG) $(DACSNET) 
  1166. XLINTFLAGS    =    -I$(INCLDIR)
  1167. XSHELL        =    /bin/sh
  1168. X
  1169. X# Definitions of variables
  1170. XFILTER_SRC    =    actions.c    \
  1171. X            buffer.c    \
  1172. X            filter.c    \
  1173. X            lock.c        \
  1174. X            parse.c        \
  1175. X            rules.c        \
  1176. X            summarize.c    \
  1177. X            utils.c        \
  1178. X            ../src/opt_utils.c
  1179. X
  1180. XFILTER_OBJ    =    actions.o    \
  1181. X            buffer.o    \
  1182. X            filter.o    \
  1183. X            lock.o        \
  1184. X            parse.o        \
  1185. X            rules.o        \
  1186. X            summarize.o    \
  1187. X            utils.o        \
  1188. X            ../src/opt_utils.o
  1189. X
  1190. X# Standard targets
  1191. Xall:        $(BIN)/filter
  1192. X        
  1193. Xinstall:    $(DEST)/filter
  1194. X
  1195. Xuninstall:    
  1196. X        $(RM) $(DEST)/filter
  1197. X
  1198. X#    This is the only target that gets installed even if not out-of-date
  1199. X#    with respect the files from which it is installed.
  1200. Xrmt-install:    rmt-defined
  1201. X        -$(MV) $(DEST)/filter $(DEST)/filter.old
  1202. X        -$(RM) $(DEST)/filter.old
  1203. X        $(CP) $(REMOTE)$(DEST)/filter $(DEST)/filter
  1204. X        $(CHGRP) $(MAILGRP) $(DEST)/filter
  1205. X        $(CHMOD) $(MAILERMODE) $(DEST)/filter
  1206. X
  1207. Xrmt-defined:
  1208. X    @(if [ "$(REMOTE)" = "" ];\
  1209. X      then\
  1210. X        $(ECHO) "You need to define 'REMOTE' as the remote file system";\
  1211. X        $(ECHO) "for this particular command. The easiest way to do this";\
  1212. X        $(ECHO) "to type:";\
  1213. X        $(ECHO) "        make REMOTE=<remote file system> rmt-install";\
  1214. X        exit 1;\
  1215. X      fi);
  1216. X
  1217. Xlint:        
  1218. X        $(LINT) $(LINTFLAGS) $(FILTER_SRC) > LINT.OUT
  1219. X
  1220. Xclean:        
  1221. X        $(RM) $(FILTER_OBJ) $(BIN)/filter
  1222. X
  1223. X# Dependencies and rules
  1224. X#    Dependencies of header files upon other header files they include
  1225. X.PRECIOUS:        $(INCLDIR)/defs.h $(INCLDIR)/elm.h $(INCLDIR)/headers.h
  1226. X
  1227. X$(INCLDIR)/defs.h:    $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
  1228. X            $(CHMOD) u+w $@
  1229. X            $(TOUCH) $@
  1230. X
  1231. X$(INCLDIR)/elm.h:    $(INCLDIR)/curses.h $(INCLDIR)/defs.h
  1232. X            $(CHMOD) u+w $@
  1233. X            $(TOUCH) $@
  1234. X
  1235. X$(INCLDIR)/headers.h:    $(INCLDIR)/curses.h $(INCLDIR)/defs.h
  1236. X            $(CHMOD) u+w $@
  1237. X            $(TOUCH) $@
  1238. X
  1239. X#    Dependencies and rules for C object files
  1240. Xactions.o:        $(INCLDIR)/defs.h $(INCLDIR)/filter.h
  1241. Xfilter.o:        $(INCLDIR)/defs.h $(INCLDIR)/filter.h
  1242. Xlock.o:            $(INCLDIR)/defs.h $(INCLDIR)/filter.h
  1243. Xparse.o:        $(INCLDIR)/defs.h $(INCLDIR)/filter.h
  1244. Xrules.o:        $(INCLDIR)/defs.h $(INCLDIR)/filter.h
  1245. Xsummarize.o:        $(INCLDIR)/defs.h $(INCLDIR)/filter.h
  1246. Xutils.o:        $(INCLDIR)/defs.h $(INCLDIR)/filter.h
  1247. X../src/opt_utils.o:
  1248. X            cd ../src; $(MAKE) -$(MAKEFLAGS) $(@F)
  1249. X
  1250. X#    Dependencies and rules for compiling programs
  1251. X$(BIN)/filter:    $& $(FILTER_OBJ)
  1252. X        $(CC) $(LFLAGS) -o $@ $(FILTER_OBJ) $(LIB2)
  1253. X
  1254. X#    Dependencies and rules for installing programs from bin directory
  1255. X$(DEST)/filter:        $(BIN)/filter
  1256. X            -$(MV) $(DEST)/filter $(DEST)/filter.old
  1257. X            -$(RM) $(DEST)/filter.old
  1258. X            $(CP) $? $@
  1259. X            $(CHGRP) $(MAILGRP) $@
  1260. X            $(CHMOD) $(MAILERMODE) $@
  1261. X!NO!SUBS!
  1262. SHAR_EOF
  1263. chmod 0444 filter/Makefile.SH || echo "restore of filter/Makefile.SH fails"
  1264. echo "x - extracting filter/actions.c (Text)"
  1265. sed 's/^X//' << 'SHAR_EOF' > filter/actions.c &&
  1266. X
  1267. Xstatic char rcsid[] ="@(#)$Id: actions.c,v 4.1 90/04/28 22:41:53 syd Exp $";
  1268. X
  1269. X/*******************************************************************************
  1270. X *  The Elm Mail System  -  $Revision: 4.1 $   $State: Exp $
  1271. X *
  1272. X *             Copyright (c) 1986, 1987 Dave Taylor
  1273. X *             Copyright (c) 1988, 1989, 1990 USENET Community Trust
  1274. X *******************************************************************************
  1275. X * Bug reports, patches, comments, suggestions should be sent to:
  1276. X *
  1277. X *    Syd Weinstein - elm@DSI.COM
  1278. X *            dsinc!elm
  1279. X *
  1280. X *******************************************************************************
  1281. X * $Log:    actions.c,v $
  1282. X * Revision 4.1  90/04/28  22:41:53  syd
  1283. X * checkin of Elm 2.3 as of Release PL0
  1284. X * 
  1285. X *
  1286. X ******************************************************************************/
  1287. X
  1288. X
  1289. X/** RESULT oriented routines *chuckle*.  These routines implement the
  1290. X    actions that result from either a specified rule being true or from
  1291. X    the default action being taken.
  1292. X**/
  1293. X
  1294. X#include <stdio.h>
  1295. X#include <pwd.h>
  1296. X#include <ctype.h>
  1297. X#include <fcntl.h>
  1298. X
  1299. X#include "defs.h"
  1300. X#include "filter.h"
  1301. X
  1302. XFILE *emergency_local_delivery();
  1303. X
  1304. Xmail_message(address)
  1305. Xchar *address;
  1306. X{
  1307. X    /** Called with an address to send mail to.   For various reasons
  1308. X        that are too disgusting to go into herein, we're going to actually
  1309. X        open the users mailbox and by hand add this message.  Yech.
  1310. X        NOTE, of course, that if we're going to MAIL the message to someone
  1311. X        else, that we'll try to do nice things with it on the fly...
  1312. X    **/
  1313. X
  1314. X    FILE *pipefd, *tempfd, *mailfd;
  1315. X    int  in_header = TRUE, line_count = 0, mailunit;
  1316. X    char tempfile[SLEN], mailbox[SLEN], lockfile[SLEN],
  1317. X         buffer[VERY_LONG_STRING];
  1318. X
  1319. X    if (verbose && ! log_actions_only && outfd != NULL)
  1320. X      fprintf(outfd, "filter (%s): Mailing message to %s\n", 
  1321. X           username, address);
  1322. X
  1323. X    if (! show_only) {
  1324. X      sprintf(tempfile, "%s.%d", filter_temp, getpid());
  1325. X
  1326. X      if ((tempfd = fopen(tempfile, "r")) == NULL) {
  1327. X        if (outfd != NULL)
  1328. X          fprintf(outfd, "filter (%s): Can't open temp file %s!!\n", 
  1329. X            username, tempfile);
  1330. X        if (outfd != NULL) fclose(outfd);
  1331. X        exit(1);
  1332. X      }
  1333. X         
  1334. X      if (strcmp(address, username) != 0) {    /* mailing to someone else */
  1335. X        
  1336. X        if (already_been_forwarded) {    /* potential looping! */
  1337. X          if (contains(from, username)) {
  1338. X        if (outfd != NULL)
  1339. X              fprintf(outfd, 
  1340. X    "filter (%s): Filter loop detected!  Message left in file %s.%d\n", 
  1341. X            username, filter_temp, getpid());
  1342. X            if (outfd != NULL) fclose(outfd);
  1343. X            exit(0);
  1344. X          }
  1345. X        }
  1346. X
  1347. X        if (strcmp(sendmail, mailer) == 0)
  1348. X          sprintf(buffer, "%s %s %s", sendmail, smflags, address);
  1349. X        else
  1350. X          sprintf(buffer, "%s %s", mailer, address);
  1351. X
  1352. X        if ((pipefd = popen(buffer, "w")) == NULL) {
  1353. X          if (outfd != NULL)
  1354. X            fprintf(outfd, "filter (%s): popen %s failed!\n", username, buffer);
  1355. X          sprintf(buffer, "((%s %s %s ; %s %s) & ) < %s &",
  1356. X              sendmail , smflags, address, remove_cmd, tempfile, tempfile);
  1357. X          system(buffer);
  1358. X          return;
  1359. X        }
  1360. X
  1361. X        fprintf(pipefd, "Subject: \"%s\"\n", subject);
  1362. X        fprintf(pipefd, "From: The Filter of %s@%s <%s>\n", 
  1363. X            username, hostname, username);
  1364. X        fprintf(pipefd, "To: %s\n", address);
  1365. X        fprintf(pipefd, "X-Filtered-By: filter, version %s\n\n", VERSION);
  1366. X
  1367. X        fprintf(pipefd, "-- Begin filtered message --\n\n");
  1368. X    
  1369. X        while (fgets(buffer, SLEN, tempfd) != NULL)
  1370. X          if (already_been_forwarded && in_header)
  1371. X            in_header = (strlen(buffer) == 1? 0 : in_header);
  1372. X          else
  1373. X            fprintf(pipefd," %s", buffer);
  1374. X
  1375. X        fprintf(pipefd, "\n-- End of filtered message --\n");
  1376. X        fclose(pipefd);
  1377. X        fclose(tempfd);
  1378. X    
  1379. X        return;        /* YEAH!  Wot a slick program, eh? */
  1380. X      
  1381. X      }
  1382. X      
  1383. X      /** OTHERWISE it is to the current user... **/
  1384. X
  1385. X      sprintf(mailbox,  "%s%s", mailhome, username);
  1386. X      
  1387. X      if (! lock()) {
  1388. X        if (outfd != NULL) {
  1389. X          fprintf(outfd, "filter (%s): Couldn't create lockfile %s\n",
  1390. X            username, lockfile);
  1391. X          fprintf(outfd, "filter (%s): Can't open mailbox %s!\n",
  1392. X            username, mailbox);
  1393. X        }
  1394. X        if ((mailfd = emergency_local_delivery()) == NULL)
  1395. X          exit(1);
  1396. X      }
  1397. X      else if ((mailunit = open(mailbox, O_APPEND | O_WRONLY | O_CREAT, 0600)) >= 0)
  1398. X        mailfd = fdopen(mailunit, "a");
  1399. X      else if ((mailfd = emergency_local_delivery()) == NULL)
  1400. X        exit(1);
  1401. X
  1402. X      while (fgets(buffer, sizeof(buffer), tempfd) != NULL) {
  1403. X        line_count++;
  1404. X        if (the_same(buffer, "From ") && line_count > 1)
  1405. X          fprintf(mailfd, ">%s", buffer);
  1406. X        else
  1407. X          fputs(buffer, mailfd);
  1408. X      }
  1409. X
  1410. X      fputs("\n", mailfd);
  1411. X
  1412. X      fclose(mailfd);
  1413. X      unlock();        /* blamo or not?  Let it decide! */
  1414. X      fclose(tempfd);
  1415. X    } /* end if show only */
  1416. X}
  1417. X
  1418. Xsave_message(foldername)
  1419. Xchar *foldername;
  1420. X{
  1421. X    /** Save the message in a folder.  Use full file buffering to
  1422. X        make this work without contention problems **/
  1423. X
  1424. X    FILE  *fd, *tempfd;
  1425. X    char  filename[SLEN], buffer[SLEN];
  1426. X    int   fdunit;
  1427. X
  1428. X    if (verbose && outfd != NULL)
  1429. X      fprintf(outfd, "filter (%s): Message saved in folder %s\n", 
  1430. X          username, foldername);
  1431. X    
  1432. X    if (!show_only) {
  1433. X      sprintf(filename, "%s.%d", filter_temp, getpid());
  1434. X
  1435. X      if ((fdunit = open(foldername, O_APPEND | O_WRONLY | O_CREAT, 0600)) < 0) {
  1436. X        if (outfd != NULL)
  1437. X          fprintf(outfd, 
  1438. X         "filter (%s): can't save message to requested folder %s!\n",
  1439. X            username, foldername);
  1440. X        return(1);
  1441. X      }
  1442. X      fd = fdopen(fdunit,"a");
  1443. X
  1444. X      if ((tempfd = fopen(filename, "r")) == NULL) {
  1445. X        if (outfd != NULL)
  1446. X          fprintf(outfd, 
  1447. X             "filter (%s): can't open temp file for reading!\n",
  1448. X             username);
  1449. X         return(1);
  1450. X      }
  1451. X
  1452. X      while (fgets(buffer, sizeof(buffer), tempfd) != NULL)
  1453. X        fputs(buffer, fd);
  1454. X    
  1455. X      fclose(fd);
  1456. X      fclose(tempfd);
  1457. X    }
  1458. X
  1459. X     return(0);
  1460. X}
  1461. X
  1462. Xexecute(command)
  1463. Xchar *command;
  1464. X{
  1465. X    /** execute the indicated command, feeding as standard input the
  1466. X        message we have.
  1467. X    **/
  1468. X
  1469. X    char buffer[SLEN];
  1470. X
  1471. X    if (verbose && outfd != NULL)
  1472. X      fprintf(outfd, "filter (%s): Executing %s\n", username, command);
  1473. X
  1474. X    if (! show_only) {
  1475. X      sprintf(buffer, "%s %s.%d | %s", cat, filter_temp, getpid(), command);
  1476. X      system(buffer);
  1477. X    }
  1478. X}
  1479. X
  1480. XFILE *
  1481. Xemergency_local_delivery()
  1482. X{
  1483. X    /** This is called when we can't deliver the mail to the usual
  1484. X        mailbox in the usual way ...
  1485. X    **/
  1486. X
  1487. X    FILE *tempfd;
  1488. X    char  mailbox[SLEN];
  1489. X    int   mailunit;
  1490. X
  1491. X    sprintf(mailbox, "%s/%s", home, EMERGENCY_MAILBOX);
  1492. X
  1493. X    if ((mailunit = open(mailbox, O_APPEND | O_WRONLY | O_CREAT, 0600)) >= 0) {
  1494. X      if (outfd != NULL)
  1495. X        fprintf(outfd, "filter (%s): Can't open %s either!!\n",
  1496. X            username, mailbox);
  1497. X
  1498. X      sprintf(mailbox,"%s/%s", home, EMERG_MBOX); 
  1499. X
  1500. X      if ((mailunit = open(mailbox, O_APPEND | O_WRONLY | O_CREAT, 0600)) >= 0) {
  1501. X
  1502. X        if (outfd != NULL) {
  1503. X          fprintf(outfd,"filter (%s): Can't open %s either!!!!\n",
  1504. X              username, mailbox);
  1505. X          fprintf(outfd, 
  1506. X              "filter (%s): I can't open ANY mailboxes!  Augh!!\n",
  1507. X               username);
  1508. X         }
  1509. X
  1510. X         leave("Cannot open any mailbox");        /* DIE DIE DIE DIE!! */
  1511. X       }
  1512. X       else
  1513. X         if (outfd != NULL)
  1514. X           fprintf(outfd, "filter (%s): Using %s as emergency mailbox\n",
  1515. X               username, mailbox);
  1516. X      }
  1517. X      else
  1518. X        if (outfd != NULL)
  1519. X          fprintf(outfd, "filter (%s): Using %s as emergency mailbox\n",
  1520. X              username, mailbox);
  1521. X
  1522. X    tempfd = fdopen(mailunit, "a");
  1523. X    return((FILE *) tempfd);
  1524. X}
  1525. SHAR_EOF
  1526. chmod 0444 filter/actions.c || echo "restore of filter/actions.c fails"
  1527. echo "x - extracting filter/buffer.c (Text)"
  1528. sed 's/^X//' << 'SHAR_EOF' > filter/buffer.c &&
  1529. X
  1530. Xstatic char rcsid[] ="@(#)$Id: buffer.c,v 4.1 90/04/28 22:41:54 syd Exp $";
  1531. X
  1532. X/*******************************************************************************
  1533. X *  The Elm Mail System  -  $Revision: 4.1 $   $State: Exp $
  1534. X *
  1535. X *             Copyright (c) 1986, 1987 Dave Taylor
  1536. X *             Copyright (c) 1988, 1989, 1990 USENET Community Trust
  1537. X *******************************************************************************
  1538. X * Bug reports, patches, comments, suggestions should be sent to:
  1539. X *
  1540. X *    Syd Weinstein - elm@DSI.COM
  1541. X *            dsinc!elm
  1542. X *
  1543. X *******************************************************************************
  1544. X * $Log:    buffer.c,v $
  1545. X * Revision 4.1  90/04/28  22:41:54  syd
  1546. X * checkin of Elm 2.3 as of Release PL0
  1547. X * 
  1548. X *
  1549. X ******************************************************************************/
  1550. X
  1551. X#include <stdio.h>
  1552. X
  1553. Xchar  _vbuf[5*BUFSIZ];        /* space for file buffering */
  1554. SHAR_EOF
  1555. chmod 0444 filter/buffer.c || echo "restore of filter/buffer.c fails"
  1556. echo "x - extracting filter/filter.c (Text)"
  1557. sed 's/^X//' << 'SHAR_EOF' > filter/filter.c &&
  1558. X
  1559. Xstatic char rcsid[] ="@(#)$Id: filter.c,v 4.1 90/04/28 22:41:55 syd Exp $";
  1560. X
  1561. X/*******************************************************************************
  1562. X *  The Elm Mail System  -  $Revision: 4.1 $   $State: Exp $
  1563. X *
  1564. X *             Copyright (c) 1986, 1987 Dave Taylor
  1565. X *             Copyright (c) 1988, 1989, 1990 USENET Community Trust
  1566. X *******************************************************************************
  1567. X * Bug reports, patches, comments, suggestions should be sent to:
  1568. X *
  1569. X *    Syd Weinstein - elm@DSI.COM
  1570. X *            dsinc!elm
  1571. X *
  1572. X *******************************************************************************
  1573. X * $Log:    filter.c,v $
  1574. X * Revision 4.1  90/04/28  22:41:55  syd
  1575. X * checkin of Elm 2.3 as of Release PL0
  1576. X * 
  1577. X *
  1578. X ******************************************************************************/
  1579. X
  1580. X
  1581. X/** This program is used as a filter within the users ``.forward'' file
  1582. X    and allows intelligent preprocessing of mail at the point between
  1583. X    when it shows up on the machine and when it is actually put in the
  1584. X    mailbox.
  1585. X
  1586. X    The program allows selection based on who the message is FROM, TO, or
  1587. X    what the subject is.  Acceptable actions are for the program to DELETE_MSG
  1588. X    the message, SAVE the message in a specified folder, FORWARD the message
  1589. X    to a specified user, SAVE the message in a folder, but add a copy to the
  1590. X    users mailbox anyway, or simply add the message to the incoming mail.
  1591. X
  1592. X    Filter also keeps a log of what it does as it goes along, and at the
  1593. X    end of each `quantum' mails a summary of actions, if any, to the user.
  1594. X
  1595. X    Uses the files: $HOME/.filter for instructions to this program, and
  1596. X    $HOME/.filterlog for a list of what has been done since last summary.
  1597. X
  1598. X**/
  1599. X
  1600. X#include <stdio.h>
  1601. X#include <pwd.h>
  1602. X#include <ctype.h>
  1603. SHAR_EOF
  1604. echo "End of part 8"
  1605. echo "File filter/filter.c is continued in part 9"
  1606. echo "9" > s2_seq_.tmp
  1607. exit 0
  1608.  
  1609. exit 0 # Just in case...
  1610.