Added all of the MH sources, including RCS files, in
[mmh] / docs / historical / mh-6.8.5 / conf / doc / RCS / slocal.rf,v
1 head    1.15;
2 access;
3 symbols;
4 locks; strict;
5 comment @# @;
6
7
8 1.15
9 date    92.10.28.16.53.03;      author jromine; state Exp;
10 branches;
11 next    1.14;
12
13 1.14
14 date    92.10.27.20.21.36;      author jromine; state Exp;
15 branches;
16 next    1.13;
17
18 1.13
19 date    92.10.26.16.36.30;      author jromine; state Exp;
20 branches;
21 next    1.12;
22
23 1.12
24 date    92.07.02.15.51.22;      author jromine; state Exp;
25 branches;
26 next    1.11;
27
28 1.11
29 date    92.02.15.00.08.56;      author jromine; state Exp;
30 branches;
31 next    1.10;
32
33 1.10
34 date    92.02.12.19.10.01;      author jromine; state Exp;
35 branches;
36 next    1.9;
37
38 1.9
39 date    92.02.12.19.08.15;      author jromine; state Exp;
40 branches;
41 next    1.8;
42
43 1.8
44 date    92.02.12.05.59.38;      author jromine; state Exp;
45 branches;
46 next    1.7;
47
48 1.7
49 date    92.02.12.04.24.50;      author jromine; state Exp;
50 branches;
51 next    1.6;
52
53 1.6
54 date    92.02.12.02.49.43;      author jromine; state Exp;
55 branches;
56 next    1.5;
57
58 1.5
59 date    92.02.12.02.31.09;      author jromine; state Exp;
60 branches;
61 next    1.4;
62
63 1.4
64 date    92.02.12.00.23.07;      author jromine; state Exp;
65 branches;
66 next    1.3;
67
68 1.3
69 date    92.02.11.23.48.28;      author jromine; state Exp;
70 branches;
71 next    1.2;
72
73 1.2
74 date    92.02.11.23.15.24;      author jromine; state Exp;
75 branches;
76 next    1.1;
77
78 1.1
79 date    92.02.11.21.45.43;      author jromine; state Exp;
80 branches;
81 next    ;
82
83
84 desc
85 @@
86
87
88 1.15
89 log
90 @move slocal to (1)
91 @
92 text
93 @.\"    @@(MHWARNING)
94 .\" @@(#)$Id: slocal.rf,v 1.14 1992/10/27 20:21:36 jromine Exp jromine $
95 .SC SLOCAL 1
96 .NA
97 slocal \- special local mail delivery
98 .SY
99 @@(MHETCPATH)/slocal \%[address\ info\ sender]
100 .na
101 .br
102 \%[\-addr\ address]
103 \%[\-info\ data]
104 \%[\-sender\ sender]
105 .br
106 \%[\-user\ username]
107 \%[\-mailbox\ mbox]
108 \%[\-file\ file]
109 .\" \%[\-home\ homedir]
110 .br
111 \%[\-maildelivery\ deliveryfile]
112 \%[\-verbose] \%[\-noverbose]
113 \%[\-debug]
114 \%[\-help]
115 .ad
116 .DE
117 \fISlocal\fP is a program designed to allow you to have
118 your inbound mail processed according to a complex
119 set of selection criteria.
120 You do not normally invoke \fIslocal\fP yourself,
121 rather \fIslocal\fP is invoked on your behalf by your system's 
122 Message Transfer Agent.
123
124 The message selection
125 criteria used by \fIslocal\fP
126 is specified in the file \fI\&.maildelivery\fP
127 in the user's home directory.  The format of this file
128 is given below.
129
130 The message delivery address and message sender are
131 determined from the Message Transfer Agent
132 envelope information, if possible.  Under \fISendMail\fP,
133 the sender will obtained from the UUCP \*(lqFrom\ \*(rq
134 line, if present.  The user may override these values
135 with command line arguments, or arguments to 
136 the `\-addr' and `\-sender' switches.
137
138 The message is normally read from the standard input.
139 The `\-file' switch sets the name of the file from which
140 the message should be read, instead of reading stdin.
141 The `\-user' switch tells \fIslocal\fP
142 the name of the user for whom it is delivering mail.
143 The `\-mailbox' switch tells \fIslocal\fP the name
144 of the user's maildrop file.
145
146 The `\-info' switch may be used to pass an arbitrary
147 argument to sub-processes which \fIslocal\fP may
148 invoke on your behalf.
149 The `\-verbose' switch causes \fIslocal\fP
150 to give information on stdout about its progress.
151 The `\-debug' switch produces more verbose debugging output on stderr.
152
153 .Uh "Message Transfer Agents"
154 If your MTA is \fISendMail\fP,
155 you should include the line
156 .sp
157 .nf
158 .in +.5i
159     \*(lq|\ @@(MHETCPATH)/slocal\ \-user\ username\*(rq
160 .in -.5i
161 .fi
162 .sp
163 in your \&.forward file in your home directory.
164 This will cause \fISendMail\fP to invoke \fIslocal\fP on your behalf.
165
166 If your MTA is \fIMMDF-I\fP,
167 you should (symbolically) link @@(MHETCPATH)/slocal to the file
168 bin/rcvmail in your home directory.
169 This will cause \fIMMDF-I\fP to invoke \fIslocal\fP on your behalf
170 with the correct \*(lq\fIaddress\ info\ sender\fP\*(rq arguments.
171
172 If your MTA is \fIMMDF-II\fP,
173 then you should not use \fIslocal\fP.
174 An equivalent functionality is already provided by \fIMMDF-II\fP;
175 see maildelivery(5) for details.
176
177 .Uh "The Maildelivery File"
178
179 The \fI\&.maildelivery\fR file
180 controls how local delivery is performed.
181 Each line of this file
182 consists of five fields, separated by white-space or comma.
183 Since double-quotes are honored,
184 these characters may be included in a single argument by enclosing the
185 entire argument in double-quotes.
186 A double-quote can be included by preceding it with a backslash.
187 Lines beginning with `#' are ignored.
188 The format of each line in the \fI\&.maildelivery\fR file is:
189
190
191         \fBheader       pattern action  result  string\fR
192 .sp
193 .in +.5i
194 .ti -.5i
195 \fBheader\fP:
196 .br
197 The name of a header field that is to be searched for a pattern.
198 This is any field in the headers of the message that might be present.
199 The following special fields are also defined:
200 .sp
201 .in +1i
202 .ta +1i
203 .ti -1i
204 \fIsource\fR    the out-of-band sender information
205 .ti -1i
206 \fIaddr\fR      the address that was used to cause delivery to the recipient
207 .ti -1i
208 \fIdefault\fR   this matches \fIonly\fR if the message hasn't been delivered yet
209 .ti -1i
210 \fI*\fR this always matches
211 .in -1i
212
213 .ti -.5i
214 \fBpattern\fR:
215 .br
216 The sequence
217 of characters to match in the specified header field.
218 Matching is case-insensitive, but does not use regular expressions.
219
220 .ti -.5i
221 \fBaction\fR:
222 .br
223 The action to take to deliver the message:
224 .sp
225 .in +1i
226 .ta +1i
227 .ti -1i
228 \fIdestroy\fR   This action always succeeds.
229
230 .ti -1i
231 \fIfile\fR or > Append
232 the message to the file named by \fBstring\fR.
233 The message is appended to the file in the maildrop 
234 format which is used by your message transport system.
235 If the message can be appended to the file,
236 then this action succeeds.
237 When writing to the file,
238 a \*(lqDelivery\-Date:\ date\*(rq header is added
239 which indicates the date and time that message was appended to the file.
240
241 .ti -1i
242 \fImbox\fR      Identical
243 to \fIfile\fR,
244 but always appends the message using the format used by \fIpackf\fR
245 (the MMDF mailbox format).
246
247 .ti -1i
248 \fIpipe\fR or | Pipe
249 the message as the standard input to the command named by \fBstring\fR,
250 using the Bourne shell \fIsh\fR(1) to interpret the string.
251 Prior to giving the string to the shell,
252 it is expanded with the following built-in variables:
253 .sp
254 .in +1i
255 .ta +1i
256 .ti -1i
257 $(sender)       the out-of-band sender information
258 .ti -1i
259 $(address)      the address that was used to cause delivery to the recipient
260 .ti -1i
261 $(size) the size of the message in bytes
262 .ti -1i
263 $(reply\-to)    either the \*(lqReply\-To:\*(rq or \*(lqFrom:\*(rq field
264 of the message
265 .ti -1i
266 $(info) the out-of-band information specified
267 .in -1i
268 .ti -1i
269 \fIqpipe\fR or
270 .ti -1i
271 \fI<caret>\fR   Similar to \fIpipe\fR,
272 but executes the command directly,
273 after built-in variable expansion,
274 without assistance from the shell.
275 This action can be used to avoid quoting special characters
276 which your shell might interpret.
277 .in -1i
278
279 .ti -.5i
280 \fBresult\fR:
281 .br
282 Indicates how the action should be performed:
283
284 .in +1i
285 .ta +1i
286 .ti -1i
287 \fIA\fR Perform the action.
288 If the action succeeds, then the message is considered delivered.
289
290 .ti -1i
291 \fIR\fR Perform the action.
292 Regardless of the outcome of the action,
293 the message is not considered delivered.
294
295 .ti -1i
296 \fI?\fR Perform
297 the action only if the message has not been delivered.
298 If the action succeeds, then the message is considered delivered.
299
300 .ti -1i
301 \fIN\fR Perform
302 the action only if the message has not been delivered
303 and the previous action succeeded.
304 If this action succeeds, then the message is considered delivered.
305 .sp
306 .in -1i
307 .in -.5i
308 To summarize, here's an example:
309 .sp
310 .if t .in +.5i
311 .nf
312 .ta \w'default  'u +\w'mh-workersxx 'uC +\w'destroy 'uC +\w'result 'u
313 #\fIfield\fR    \fIpattern\fR   \fIaction\fR    \fIresult\fR    \fIstring\fR
314 # lines starting with a '#' are ignored, as are blank lines
315 #
316 # file mail with mmdf2 in the \*(lqTo:\*(rq line into file mmdf2.log
317 \fITo   mmdf2   file    A       mmdf2.log\fP
318 # Messages from mmdf pipe to the program err-message-archive
319 \fIFrom mmdf    pipe    A       /bin/err-message-archive\fP
320 # Anything with the \*(lqSender:\*(rq address \*(lqmh-workers\*(rq
321 # file in mh.log if not filed already
322 \fISender       mh-workers      file    ?       mh.log\fP
323 # \*(lqTo:\*(rq unix \- put in file unix-news
324 \fITo   Unix    >       A       unix-news\fP
325 .\" # if the address is jpo=mmdf \- pipe into mmdf-redist
326 .\" \fIaddr     jpo=mmdf        |       A       mmdf-redist\fP
327 # if the address is jpo=ack \- send an acknowledgement copy back
328 \fIaddr jpo=ack \fP|\fI R       \*(lq/bin/resend\0\-r\0$(reply-to)\*(rq\fP
329 # anything from steve \- destroy!
330 \fIFrom steve   destroy A       \-\fP
331 # anything not matched yet \- put into mailbox
332 \fIdefault      \-      >       ?       mailbox\fP
333 # always run rcvtty
334 \fI*    \-      \fP|\fI R       /mh/lib/rcvtty\fP
335 .re
336 .fi
337 .if t .in -.5i
338
339 The file is always read completely,
340 so that several matches can be made and several actions can be taken.
341 The \fI\&.maildelivery\fR file must be owned either by the user or by root,
342 and must be writable only by the owner.
343 If the \fI\&.maildelivery\fR file cannot be found,
344 or does not perform an action which delivers the message,
345 then the file @@(MHETCPATH)/maildelivery is read according to the same rules.
346 This file must be owned by the root and must be writable only by the root.
347 If this file cannot be found
348 or does not perform an action which delivers the message,
349 then standard delivery to the user's maildrop is performed.
350
351 .Uh "Sub-process environment"
352 When a process is invoked, its environment is:
353 the user/group-ids are set to recipient's ids;
354 the working directory is the recipient's home directory;
355 the umask is 0077;
356 the process has no /dev/tty;
357 the standard input is set to the message;
358 the standard output and diagnostic output are set to /dev/null;
359 all other file-descriptors are closed;
360 the envariables \fB$USER\fR, \fB$HOME\fR, \fB$SHELL\fR are set
361 appropriately,
362 and no other envariables exist.
363
364 The process is given a certain amount of time to execute.
365 If the process does not exit within this limit,
366 the process will be terminated with extreme prejudice.
367 The amount of time is calculated as ((size x 60) + 300) seconds,
368 where size is the number of bytes in the message.
369
370 The exit status of the process is consulted in determining the success of the
371 action.
372 An exit status of zero means that the action succeeded.
373 Any other exit status (or abnormal termination) means that the action failed.
374
375 In order to avoid any time limitations,
376 you might implement a process that began by \fIforking\fR.
377 The parent would return the appropriate value immediately,
378 and the child could continue on,
379 doing whatever it wanted for as long as it wanted.
380 This approach is somewhat risky if the parent is going to return an
381 exit status of zero.
382 If the parent is going to return a non-zero exit status,
383 then this approach can lead to quicker delivery into your maildrop.
384 @@BEGIN: MSGID
385
386 .Uh "Duplicate Message Suppression"
387 \fIslocal\fR is able to detect and supress duplicate messages.
388 To enable this,
389 create two empty files in your $HOME directory:
390 \&.maildelivery.pag and \&.maildelivery.dir.
391 These are ndbm files which are used to store the Message-IDs of
392 incoming messages.
393 @@END: MSGID
394 .Fi
395 ^@@(MHETCPATH)/mtstailor~^MH tailor file
396 ^$HOME/\&.maildelivery~^The file controlling local delivery
397 ^@@(MHETCPATH)/maildelivery~^Rather than the standard file
398 ^@@(MHDROPLOC)~^The default maildrop
399 .Sa
400 rcvstore(1), mhook(1), mh\-format(5)
401 @@BEGIN: MMDFIIMTS
402 , maildelivery(5)
403 @@END: MMDFIIMTS
404 .De
405 `\-noverbose'
406 .Ds
407 `\-maildelivery \&.maildelivery'
408 .Ds
409 `\-mailbox @@(MHDROPLOC)'
410 .Ds
411 `\-file' defaults to stdin
412 .Ds
413 `\-user' defaults to the current user
414 .Co
415 None
416 .Hi
417 @@BEGIN: MHMTS
418 For compatibility with older versions of \fIMH\fR,
419 if \fIslocal\fR can't find the user's \fI\&.maildelivery\fR file,
420 it will attempt to execute an old-style rcvmail hook in the user's $HOME
421 directory.
422 In particular,
423 it will first attempt to execute
424
425 .ti +.5i
426 \&.mh\(rureceive file maildrop directory user
427
428 failing that it will attempt to execute
429
430 .ti +.5i
431 $HOME/bin/rcvmail user file sender
432
433 before giving up and writing to the user's maildrop.
434
435 In addition,
436 whenever a hook or process is invoked,
437 file-descriptor three (3) is set to the message in addition to the standard
438 input.
439
440 @@END: MHMTS
441 \fISlocal\fP is designed to be backward-compatible with the
442 \fImaildelivery\fP facility provided by \fIMMDF-II\fP.
443 Thus, the \fI\&.maildelivery\fP file syntax is limited,
444 as is the functionality of \fIslocal\fP.
445
446 In addition to an exit status of zero,
447 the \fIMMDF\fR values \fIRP_MOK\fR (32) and \fIRP_OK\fR (9)
448 mean that the message has been fully delivered.
449 Any other non-zero exit status,
450 including abnormal termination,
451 is interpreted as the \fIMMDF\fR value \fIRP_MECH\fR (200),
452 which means \*(lquse an alternate route\*(rq
453 (deliver the message to the maildrop).
454 .Bu
455 Only two return codes are meaningful, others should be.
456
457 \fISlocal\fP is designed to be
458 backwards-compatible with the \fImaildelivery\fP functionality provided
459 by \fBMMDF-II\fP.
460
461 Versions of \fIMMDF\fR with the \fImaildelivery\fR mechanism aren't
462 entirely backwards-compatible with earlier versions of \fIMMDF\fP.
463 If you have an \fIMMDF-I\fP old-style hook,
464 the best you can do is to have a one-line
465 \fI\&.maildelivery\fR file:
466
467 .ti +.5i
468 default \- pipe A \*(lqbin/rcvmail $(address) $(info) $(sender)\*(rq
469 .En
470 @
471
472
473 1.14
474 log
475 @note MMDF-II compatibility goal
476 @
477 text
478 @d2 2
479 a3 2
480 .\" @@(#)$Id: slocal.rf,v 1.13 1992/10/26 16:36:30 jromine Exp jromine $
481 .SC SLOCAL 8
482 @
483
484
485 1.13
486 log
487 @document MSGID option
488 @
489 text
490 @d2 1
491 a2 1
492 .\" @@(#)$Id: slocal.rf,v 1.12 1992/07/02 15:51:22 jromine Exp jromine $
493 d364 4
494 @
495
496
497 1.12
498 log
499 @document troubles with "pipe" & special characters
500 @
501 text
502 @d2 1
503 a2 1
504 .\" @@(#)$Id: slocal.rf,v 1.11 1992/02/15 00:08:56 jromine Exp jromine $
505 d292 1
506 d294 8
507 @
508
509
510 1.11
511 log
512 @changes from Stephen Gildea
513 @
514 text
515 @d2 1
516 a2 1
517 .\" @@(#)$Id: slocal.rf,v 1.10 1992/02/12 19:10:01 jromine Exp jromine $
518 d183 2
519 @
520
521
522 1.10
523 log
524 @typo
525 @
526 text
527 @d2 1
528 a2 1
529 .\" @@(#)$Id: slocal.rf,v 1.9 1992/02/12 19:08:15 jromine Exp jromine $
530 d90 2
531 a91 2
532 consists of five fields, separated by white\-space or comma.
533 Since double\-quotes are honored,
534 d93 2
535 a94 2
536 entire argument in double\-quotes.
537 A double\-quote can be included by preceeding it with a backslash.
538 d160 1
539 a160 1
540 it is expanded with the following built\-in variables:
541 d181 1
542 a181 1
543 after built\-in variable expansion,
544 d249 1
545 a249 1
546 If the \fI\&.maildelivery\fR file can not be found,
547 d253 1
548 a253 1
549 If this file can not be found
550 d260 1
551 a260 1
552 the working directory is the recipient's directory;
553 d265 1
554 a265 1
555 all other file\-descriptors are closed;
556 d288 1
557 a288 1
558 If the parent is going to return a non\-zero exit status,
559 d317 1
560 a317 1
561 it will attempt to execute an old\-style rcvmail hook in the user's $HOME
562 d334 1
563 a334 1
564 file\-descriptor three (3) is set to the message in addition to the standard
565 d346 1
566 a346 1
567 All other non\-zero exit status,
568 d355 3
569 a357 3
570 entirely backwards\-compatible with earlier versions of \fIMMDF\fP.
571 If you have an \fIMMDF-I\fP old\-style hook,
572 the best you can do is to have a one\-line
573 @
574
575
576 1.9
577 log
578 @major revision
579 @
580 text
581 @d2 1
582 a2 1
583 .\" @@(#)$Id: slocal.rf,v 1.8 1992/02/12 05:59:38 jromine Exp jromine $
584 d28 1
585 a28 1
586 You do not normallynormally  invoke \fIslocal\fP yourself,
587 @
588
589
590 1.8
591 log
592 @enclose cmd in quotes
593 @
594 text
595 @d2 1
596 a2 1
597 .\" @@(#)$Id: slocal.rf,v 1.7 1992/02/12 04:24:50 jromine Exp jromine $
598 d28 1
599 a28 1
600 You do \fBNOT\fR invoke \fIslocal\fP yourself,
601 d174 1
602 a174 2
603 $(info) miscellaneous out-of-band information as specified
604 on the command line.
605 d216 1
606 d218 1
607 a218 2
608 .in +.5i
609 .ta \w'defaultxxx  'u +\w'mh-workers 'uC +\w'action'uC +\w'result'u
610 a241 1
611 .in -.5i
612 d243 1
613 d245 12
614 a290 12
615 The file is always read completely,
616 so that several matches can be made and several actions can be taken.
617 The \fI\&.maildelivery\fR file must be owned either by the user or by root,
618 and must be writable only by the owner.
619 If the \fI\&.maildelivery\fR file can not be found,
620 or does not perform an action which delivers the message,
621 then the file @@(MHETCPATH)/maildelivery is read according to the same rules.
622 This file must be owned by the root and must be writable only by the root.
623 If this file can not be found
624 or does not perform an action which delivers the message,
625 then standard delivery to the user's maildrop is performed.
626
627 d298 3
628 a300 3
629 #ifdef  MMDF
630 maildelivery(5)
631 #endif
632 d314 29
633 a342 24
634 .\" For compatibility with older versions of \fIMH\fR,
635 .\" if \fIslocal\fR can't find the user's \fI\&.maildelivery\fR file,
636 .\" it will attempt to execute an old\-style rcvmail hook in the user's $HOME
637 .\" directory.
638 .\" In particular,
639 .\" it will first attempt to execute
640 .\" 
641 .\" .ti +.5i
642 .\" \&.mh\(rureceive file maildrop directory user
643 .\" 
644 .\" failing that it will attempt to execute
645 .\" 
646 .\" .ti +.5i
647 .\" $HOME/bin/rcvmail user file sender
648 .\" 
649 .\" before giving up and writing to the user's maildrop.
650 .\" 
651 .\" In addition,
652 .\" whenever a hook or process is invoked,
653 .\" file\-descriptor three (3) is set to the message in addition to the standard
654 .\" input.
655 .\" 
656 @@BEGIN: MMDFIMTS
657 .br
658 a350 2
659 .br
660 @@END: MMDFIMTS
661 d353 10
662 @
663
664
665 1.7
666 log
667 @typo
668 @
669 text
670 @d2 1
671 a2 1
672 .\" @@(#)$Id: slocal.rf,v 1.6 1992/02/12 02:49:43 jromine Exp jromine $
673 d67 1
674 a67 1
675     |\ @@(MHETCPATH)/slocal\ \-user\ username
676 @
677
678
679 1.6
680 log
681 @looks OK
682 @
683 text
684 @d2 1
685 a2 1
686 .\" @@(#)$Id: slocal.rf,v 1.5 1992/02/12 02:31:09 jromine Exp jromine $
687 d41 1
688 a41 1
689 the sender will obtained from the UUCP \*(lqFrom \*(rq
690 d58 1
691 a58 1
692 to give information on stdout about the its progress.
693 d78 1
694 a78 1
695 with the \*(lqaddress\ info\ sender\*(rq arguments.
696 @
697
698
699 1.5
700 log
701 @ckpt
702 @
703 text
704 @d2 1
705 a2 1
706 .\" @@(#)$Id: slocal.rf,v 1.4 1992/02/12 00:23:07 jromine Exp $
707 d11 1
708 d25 5
709 a29 5
710 \fISlocal\fP is a program designed to allow inbound 
711 mail to be processed according to a set of selection
712 criteria.
713 You do \fBNOT\fR invoke the hook yourself,
714 rather the hook is invoked on your behalf by the 
715 d33 2
716 a34 1
717 criteria is specified in the file \fI\&.maildelivery\fP
718 d38 1
719 a38 1
720 The delivery address and message sender are
721 d54 3
722 d59 1
723 a59 1
724 The `\-debug' switch produces verbose debugging output on stderr.
725 d77 2
726 a78 1
727 This will cause \fIMMDF-I\fP to invoke \fIslocal\fP on your behalf.
728 d82 1
729 a82 1
730 An equivalent functionality is already provide by \fIMMDF-II\fP;
731 d87 1
732 a87 2
733 The \fI\&.maildelivery\fR file,
734 which is an ordinary ASCII file,
735 d89 7
736 d98 2
737 a99 1
738         \fBfield        pattern action  result  string\fR
739 d103 1
740 a103 1
741 \fBfield\fP:
742 d105 1
743 a105 2
744 The 
745 name of a header field that is to be searched for a pattern.
746 d112 1
747 a112 1
748 \fIsource\fR    the out\-of\-band sender information
749 d125 2
750 a126 2
751 of characters to match in the specified field.
752 Matching is case\-insensitive but not does not use regular expressions.
753 d158 1
754 a158 1
755 using the Bourne shell \fIsh\fR\0(1) to interpret the string.
756 d165 1
757 a165 1
758 $(sender)       the return address for the message
759 d174 2
760 a175 1
761 $(info) miscellaneous out\-of\-band information
762 d212 1
763 a212 1
764
765 a214 8
766
767 Arguments in the \fI\&.maildelivery\fR file are separated by white\-space or
768 comma.
769 Since double\-quotes are honored,
770 these characters may be included in a single argument by enclosing the
771 entire argument in double\-quotes.
772 A double\-quote can be included by preceeding it with a backslash.
773
774 d216 1
775 a216 1
776
777 d219 1
778 a219 1
779 .ta \w'default  'u +\w'mh-workersxxx 'uR +\w'action'uC +\w'result'u
780 d235 1
781 a235 1
782 \fIaddr jpo=ack |       R       \*(lq/bin/resend\0\-r\0$(reply-to)\*(rq\fP
783 d241 1
784 a241 1
785 \fI*    \-      |       R       /mh/lib/rcvtty\fP
786 d293 1
787 a293 1
788 ^@@(MHETCPATH)/mtstailor~^tailor file
789 d299 3
790 d304 8
791 a350 9
792
793 Versions of \fIMMDF\fR with the \fImaildelivery\fR mechanism aren't
794 entirely backwards\-compatible with earlier versions.
795 If you have an old\-style hook, the best you can do is to have a one\-line
796 \fI\&.maildelivery\fR file:
797
798 .ti +.15i
799 default \- pipe A \*(lqbin/rcvmail $(address) $(info) $(sender)\*(rq
800 .En
801 @
802
803
804 1.4
805 log
806 @ckpt
807 @
808 text
809 @d2 2
810 a3 2
811 .\" @@(#)$Id: slocal.rf,v 1.3 1992/02/11 23:48:28 jromine Exp jromine $
812 .SC MHOOK 1
813 d9 1
814 d11 2
815 d14 1
816 d16 1
817 a16 3
818 \%[\-sender\ sender]
819 \%[\-mailbox\ mbox]
820 \%[\-home\ homedir]
821 d36 7
822 a42 5
823 .Uh "Variables"
824 \fISlocal\fP sets a number of variables which are
825 available as arguments to the programs invoked by \fIslocal\fP.
826 The default values of these parameters may be overridden
827 by command line arguments to \fIslocal\fP.
828 d44 8
829 a51 33
830 .in +.5i
831 .ti -.5i
832 address
833 .br
834 The destination address. 
835 This is obtained from the message envelope delivery information, if possible.
836 If not present, the login name of the uid invoking slocal.
837 .ti -.5i
838 username
839 .br
840 The mbox part of \*(lqaddress\*(rq, else the value of \*(lqaddress\*rq.
841 .ti -.5i
842 homedir
843 .br
844 The user's home directory.  This sets 
845 .ti -.5i
846 mbox
847 .br
848 The user's maildrop file, if not \*(lq@@(MHDROPLOC)\*(rq.
849 .ti -.5i
850 file
851 .br
852 The file from which to read the message, if not stdin.
853 .ti -.5i
854 sender
855 .br
856 The message sender.
857 This is obtained from the message envelope delivery information, if possible.
858 Under \fISendMail\fP, it is
859 obtained from the UUCP \*(lqFrom \*(rq line, if present.
860 .in -.5i
861 The `\-maildelivery' switch sets the name of the 
862 maildelivery file to read instructions from.
863 d54 1
864 a54 1
865 The `\-debug' switch produces verbose debugging output, printed on stderr.
866 d62 1
867 a62 1
868     | @@(MHETCPATH)/slocal -user username
869 d100 1
870 a100 1
871 \fIsource\fR:   the out\-of\-band sender information
872 d102 1
873 a102 1
874 \fIaddr\fR:     the address that was used to cause delivery to the recipient
875 d104 1
876 a104 1
877 \fIdefault\fR:  this matches \fIonly\fR if the message hasn't been delivered yet
878 d106 1
879 a106 1
880 \fI*\fR:        this always matches
881 d116 5
882 a120 2
883 .ti -1i
884 \fBaction\fR:   The action to take to deliver the message:
885 d122 1
886 a122 1
887 .ta +1.5i
888 d124 4
889 a127 1
890 \fIfile\fR or \fI>\fR:  Append
891 a132 1
892
893 d138 1
894 a138 1
895 \fImbox\fR:     Identical
896 d143 2
897 a144 2
898 .ti -.5i
899 \fIpipe\fR or \fI|\fR:  Pipe
900 d149 1
901 d153 1
902 a153 1
903 $(sender):      the return address for the message
904 d155 1
905 a155 1
906 $(address):     the address that was used to cause delivery to the recipient
907 d157 1
908 a157 1
909 $(size):        the size of the message in bytes
910 d159 1
911 a159 1
912 $(reply\-to):   either the \*(lqReply\-To:\*(rq or \*(lqFrom:\*(rq field
913 d162 1
914 a162 1
915 $(info):        miscellaneous out\-of\-band information
916 d164 8
917 d173 69
918 d243 1
919 a243 1
920 the user/group id:s are set to recipient's id:s;
921 a274 48
922 .ti -.5i
923 \fIqpipe\fR or \fI<caret>\fR:
924 .br
925 Similar to \fIpipe\fR,
926 but executes the command directly,
927 after built\-in variable expansion,
928 without assistance from the shell.
929
930 .ti -.5i
931 \fIdestroy\fR:
932 .br
933 This action always succeeds.
934 .in -.5i
935
936 .ti -.25i
937 \fBresult\fR:
938 .br
939 Indicates how the action should be performed:
940
941 .in +.5i
942 .ti -.5i
943 \fIA\fR:
944 .br
945 Perform the action.
946 If the action succeeds, then the message is considered delivered.
947
948 .ti -.5i
949 \fIR\fR:
950 .br
951 Perform the action.
952 Regardless of the outcome of the action,
953 the message is not considered delivered.
954
955 .ti -.5i
956 \fI?\fR:
957 .br
958 Perform the action only if the message has not been delivered.
959 If the action succeeds, then the message is considered delivered.
960
961 .ti -.5i
962 \fIN\fR:
963 .br
964 Perform the action only if the message has not been delivered
965 and the previous action succeeded.
966 If this action succeeds, then the message is considered delivered.
967 .in -.5i
968 .in -.5i
969
970 d285 1
971 a285 1
972 then standard delivery to the user's maildrop, @@(MHDROPLOC), is performed.
973 a286 38
974 Arguments in the \fI\&.maildelivery\fR file are separated by white\-space or
975 comma.
976 Since double\-quotes are honored,
977 these characters may be included in a single argument by enclosing the
978 entire argument in double\-quotes.
979 A double\-quote can be included by preceeding it with a backslash.
980
981 To summarize, here's an example:
982
983 .nf
984 .in +.5i
985 .ta \w'default  'u +\w'uk-mmdf-workers  'u +\w'action  'u +\w'result  'u
986 #\fIfield\fR    \fIpattern\fR   \fIaction\fR    \fIresult\fR    \fIstring\fR
987 # lines starting with a '#' are ignored, as are blank lines
988 #
989 # file mail with mmdf2 in the \*(lqTo:\*(rq line into file mmdf2.log
990 To      mmdf2   file    A       mmdf2.log
991 # Messages from mmdf pipe to the program err-message-archive
992 From    mmdf    pipe    A       err-message-archive
993 # Anything with the \*(lqSender:\*(rq address \*(lquk-mmdf-workers\*(rq
994 # file in mmdf2.log if not filed already
995 Sender  uk-mmdf-workers file    ?       mmdf2.log
996 # \*(lqTo:\*(rq unix \- put in file unix-news
997 To      Unix    >       A       unix-news
998 # if the address is jpo=mmdf \- pipe into mmdf-redist
999 addr    jpo=mmdf        |       A       mmdf-redist
1000 # if the address is jpo=ack \- send an acknowledgement copy back
1001 addr    jpo=ack |       R       \*(lqresend\0\-r\0$(reply-to)\*(rq
1002 # anything from steve \- destroy!
1003 From    steve   destroy A       \-
1004 # anything not matched yet \- put into mailbox
1005 default \-      >       ?       mailbox
1006 # always run rcvalert
1007 *       \-      |       R       rcvalert
1008 .re
1009 .in -.5i
1010 .fi
1011
1012 a295 4
1013 .Ds
1014 \fIaddress\fP is the user invoking \fIslocal\fP
1015 .Ds
1016 \fIuser\fP is the same as \fIaddress\fP
1017 d299 22
1018 a320 22
1019 For compatibility with older versions of \fIMH\fR,
1020 if \fIslocal\fR can't find the user's \fI\&.maildelivery\fR file,
1021 it will attempt to execute an old\-style rcvmail hook in the user's $HOME
1022 directory.
1023 In particular,
1024 it will first attempt to execute
1025
1026 .ti +.5i
1027 \&.mh\(rureceive file maildrop directory user
1028
1029 failing that it will attempt to execute
1030
1031 .ti +.5i
1032 $HOME/bin/rcvmail user file sender
1033
1034 before giving up and writing to the user's maildrop.
1035
1036 In addition,
1037 whenever a hook or process is invoked,
1038 file\-descriptor three (3) is set to the message in addition to the standard
1039 input.
1040
1041 d322 1
1042 d331 1
1043 a332 1
1044 .\}
1045 @
1046
1047
1048 1.3
1049 log
1050 @ckpt
1051 @
1052 text
1053 @d2 1
1054 a2 1
1055 .\" @@(#)$Id: slocal.rf,v 1.1 1992/02/11 21:45:43 jromine Exp jromine $
1056 d101 1
1057 d105 1
1058 a105 1
1059 This file is read by \*(SL.
1060 d107 2
1061 a108 7
1062 The format of each line in the \fI\&.maildelivery\fR file is
1063
1064 .ti +.5i
1065 \fBfield pattern action result string\fR
1066
1067 where
1068
1069 d110 2
1070 a111 2
1071 .ti -.25i
1072 \fBfield\fR:
1073 d113 2
1074 a114 1
1075 The name of a header field that is to be searched for a pattern.
1076 d116 13
1077 a128 10
1078 In addition, the following special fields are also defined:
1079 .in +.25i
1080 \fIsource\fR: the out\-of\-band sender information
1081 .br
1082 \fIaddr\fR: the address that was used to cause delivery to the recipient
1083 .br
1084 \fIdefault\fR: this matches \fIonly\fR if the message hasn't been delivered yet
1085 .br
1086 \fI*\fR: this always matches
1087 .in -.25i
1088 d130 1
1089 a130 1
1090 .ti -.25i
1091 d133 3
1092 a135 2
1093 The sequence of characters to match in the specified field.
1094 Matching is case\-insensitive but not RE\-based.
1095 d137 7
1096 a143 11
1097 .ti -.25i
1098 \fBaction\fR:
1099 .br
1100 The action to take to deliver the message.
1101 This is one of
1102
1103 .in +.5i
1104 .ti -.5i
1105 \fIfile\fR or \fI>\fR:
1106 .br
1107 Append the message to the file named by \fBstring\fR.
1108 d150 1
1109 a150 5
1110 a new field is added:
1111
1112 .ti +.5i
1113 Delivery\-Date:\ date
1114
1115 d153 3
1116 a155 4
1117 .ti -.5i
1118 \fImbox\fR:
1119 .br
1120 Identical to \fIfile\fR,
1121 d160 2
1122 a161 3
1123 \fIpipe\fR or \fI|\fR:
1124 .br
1125 Pipe the message as the standard input to the command named by \fBstring\fR,
1126 d165 10
1127 a174 8
1128 .in +.25i
1129 $(sender): the return address for the message
1130 .br
1131 $(address): the address that was used to cause delivery to the recipient
1132 .br
1133 $(size): the size of the message in bytes
1134 .br
1135 $(reply\-to): either the \*(lqReply\-To:\*(rq or \*(lqFrom:\*(rq field
1136 d176 3
1137 a178 3
1138 .br
1139 $(info): miscellaneous out\-of\-band information
1140 .in -.25i
1141 @
1142
1143
1144 1.2
1145 log
1146 @cut 1
1147 @
1148 text
1149 @d7 2
1150 a8 1
1151 @@(MHETCPATH)/slocal \%[addr\ info\ sender]
1152 d10 1
1153 a10 1
1154 \%[\-user\ name]
1155 d14 3
1156 a16 2
1157 \%[\-home\ directory]
1158 \%[\-maildelivery\ file]
1159 d20 1
1160 d34 43
1161 a99 45
1162 .Uh Options
1163 .in +.5i
1164 .ti -.5i
1165 \-addr\ address
1166 .br
1167 The destination address. 
1168 This is obtained from the message envelope delivery information, if possible.
1169 If not present, the login name of the uid invoking slocal.
1170 .ti -.5i
1171 \-user\ name
1172 .br
1173 The mbox part of "addr", else the value of "addr"
1174 .ti -.5i
1175 \-mailbox\ mbox
1176 .br
1177 The user's maildrop file, if not \*(lq@@(MHDROPLOC)\*(rq.
1178 .ti -.5i
1179 \-home\ directory
1180 .br
1181 The user's home directory.
1182 .ti -.5i
1183 \-file\ file
1184 .br
1185 The file from which to read the message, if not stdin.
1186 .ti -.5i
1187 \-sender\ sender
1188 .br
1189 The message sender.
1190 This is obtained from the message envelope delivery information, if possible.
1191 Under \fISendMail\fP, it is
1192 obtained from the UUCP \*(lqFrom \*(rq line, if present.
1193 .ti -.5i
1194 \-maildelivery\ file
1195 .br
1196 The maildelivery file to read instructions from.
1197 .ti -.5i
1198 \-verbose
1199 .br
1200 Give information on stdout about the progress of slocal.
1201 .ti -.5i
1202 \-debug
1203 .br
1204 Verbose debugging output, printed on stderr.
1205 Helpful when debugging your .maildelivery file.
1206 .in -.5i
1207 @
1208
1209
1210 1.1
1211 log
1212 @Initial revision
1213 @
1214 text
1215 @d2 1
1216 a2 1
1217 .\" @@(#)$Id: mhook.rf,v 1.10 1992/02/10 20:00:15 jromine Exp $
1218 d5 1
1219 a5 1
1220 mhook \- MH receive\-mail hooks
1221 d7 10
1222 a16 23
1223 $HOME/\&.maildelivery
1224 @@BEGIN: MHMTS
1225 .ds SL \fIpost\fR
1226 .ds ZS slocal
1227 @@END: MHMTS
1228 @@BEGIN: MMDFIMTS
1229 .ds SL \fIslocal\fR
1230 .ds ZS slocal
1231 @@END: MMDFIMTS
1232 @@BEGIN: MMDFIIMTS
1233 .ds SL the local channel
1234 .ds ZS mmdfII
1235 @@END: MMDFIIMTS
1236 @@BEGIN: SENDMTS
1237 .ds SL \fIslocal\fR
1238 .ds ZS slocal
1239 @@END: SENDMTS
1240
1241 .ti .5i
1242 @@(MHETCPATH)/rcvdist
1243 \%[\-form\ formfile]
1244 \%[switches\ for\ \fIpostproc\fR]
1245 address\ ...
1246 d18 7
1247 d26 4
1248 a29 4
1249 .ti .5i
1250 @@(MHETCPATH)/rcvpack
1251 file
1252 \%[\-help]
1253 d31 4
1254 a34 27
1255 .ti .5i
1256 @@(MHETCPATH)/rcvtty
1257 \%[command]
1258 \%[\-form\ formatfile]
1259 \%[\-format\ string]
1260 \%[\-bell] \%[\-nobell]
1261 \%[\-newline] \%[\-nonewline]
1262 \%[\-biff]
1263 \%[\-help]
1264 .DE
1265 A receive\-mail hook is a program that is run whenever you receive a
1266 mail message.
1267 You do \fBNOT\fR invoke the hook yourself,
1268 @@BEGIN: MHMTS
1269 rather the hook is invoked on your behalf by \fIMH\fR.
1270 @@END: MHMTS
1271 @@BEGIN: MMDFIMTS
1272 rather the hook is invoked on your behalf by \fIMMDF\fR
1273 when you (symbolically) link @@(MHETCPATH)/slocal to the file
1274 bin/rcvmail in your home directory.
1275 @@END: MMDFIMTS
1276 @@BEGIN: MMDFIIMTS
1277 rather the hook is invoked on your behalf by \fIMMDF\fR.
1278 @@END: MMDFIIMTS
1279 @@BEGIN: SENDMTS
1280 rather the hook is invoked on your behalf by \fISendMail\fR,
1281 when you include the line
1282 d37 1
1283 a37 1
1284     \*(lq| @@(MHETCPATH)/slocal -user username\*(rq
1285 d40 1
1286 d42 1
1287 a42 1
1288 @@END: SENDMTS
1289 d44 56
1290 a103 1
1291 .if '\*(ZS'slocal' \{\
1292 d116 1
1293 a116 1
1294 The name of a field that is to be searched for a pattern.
1295 a315 4
1296 .\}
1297 .if '\*(ZS'mmdfII' \{\
1298 See \fImaildelivery\fR\0(5) for the details.
1299 .\}
1300 a316 37
1301 Four programs are currently standardly available,
1302 \fIrcvdist\fR (redistribute incoming messages to additional recipients),
1303 \fIrcvpack\fR (save incoming messages in a \fIpackf\fR'd file),
1304 and \fIrcvtty\fR (notify user of incoming messages).
1305 The fourth program,
1306 \fIrcvstore\fR\0(1) is described separately.
1307 They all reside in the \fI@@(MHETCPATH)/\fR directory.
1308
1309 The \fIrcvdist\fR program will resend a copy of the message to all of the
1310 addresses listed on its command line.
1311 It uses the format string facility described in \fImh\-format\fR\0(5).
1312
1313 The \fIrcvpack\fR program will append a copy of the message to the file listed
1314 on its command line.
1315 Its use is obsoleted by the \fI\&.maildelivery\fR.
1316
1317 The \fIrcvtty\fR program executes the named file with the message as its
1318 standard input,
1319 and writes the resulting output 
1320 on your terminal.
1321
1322 If no file is specified, or is bogus, etc.,
1323 then \fIrcvtty\fR will instead write a one\-line scan listing.
1324 Either the `\-form\ formatfile' or `\-format\ string' option may be used 
1325 to override the default output format (see \fImh\-format\fP\0(5)).
1326 A newline is output before the 
1327 message output, and the terminal bell is rung
1328 after the output.  The `\-nonewline' and `\-nobell' options
1329 will inhibit these functions.
1330
1331 Normally, \fIrcvtty\fP obeys
1332 write permission as granted by \fImesg\fP\0(1).
1333 With the `\-biff' option, \fIrcvtty\fP will obey the notification
1334 status set by \fIbiff\fP\0(1).
1335 If the terminal access daemon (TTYD) is available on your system,
1336 then \fIrcvtty\fR will give its output to the daemon for output
1337 instead of writing on the user's terminal.
1338 d321 1
1339 d323 7
1340 a329 6
1341 .if '\*(ZS'slocal' \{\
1342 rcvstore (1), mh\-format(5)
1343 .\}
1344 .if '\*(ZS'mmdfII' \{\
1345 rcvstore (1), maildelivery(5), mh\-format(5)
1346 .\}
1347 a331 1
1348 .if '\*(ZS'slocal' \{\
1349 a368 1
1350 .if '\*(ZS'mmdfII' \{\
1351 a375 1
1352 .\}
1353 @