head 1.15; access; symbols; locks; strict; comment @# @; 1.15 date 92.10.28.16.53.03; author jromine; state Exp; branches; next 1.14; 1.14 date 92.10.27.20.21.36; author jromine; state Exp; branches; next 1.13; 1.13 date 92.10.26.16.36.30; author jromine; state Exp; branches; next 1.12; 1.12 date 92.07.02.15.51.22; author jromine; state Exp; branches; next 1.11; 1.11 date 92.02.15.00.08.56; author jromine; state Exp; branches; next 1.10; 1.10 date 92.02.12.19.10.01; author jromine; state Exp; branches; next 1.9; 1.9 date 92.02.12.19.08.15; author jromine; state Exp; branches; next 1.8; 1.8 date 92.02.12.05.59.38; author jromine; state Exp; branches; next 1.7; 1.7 date 92.02.12.04.24.50; author jromine; state Exp; branches; next 1.6; 1.6 date 92.02.12.02.49.43; author jromine; state Exp; branches; next 1.5; 1.5 date 92.02.12.02.31.09; author jromine; state Exp; branches; next 1.4; 1.4 date 92.02.12.00.23.07; author jromine; state Exp; branches; next 1.3; 1.3 date 92.02.11.23.48.28; author jromine; state Exp; branches; next 1.2; 1.2 date 92.02.11.23.15.24; author jromine; state Exp; branches; next 1.1; 1.1 date 92.02.11.21.45.43; author jromine; state Exp; branches; next ; desc @@ 1.15 log @move slocal to (1) @ text @.\" @@(MHWARNING) .\" @@(#)$Id: slocal.rf,v 1.14 1992/10/27 20:21:36 jromine Exp jromine $ .SC SLOCAL 1 .NA slocal \- special local mail delivery .SY @@(MHETCPATH)/slocal \%[address\ info\ sender] .na .br \%[\-addr\ address] \%[\-info\ data] \%[\-sender\ sender] .br \%[\-user\ username] \%[\-mailbox\ mbox] \%[\-file\ file] .\" \%[\-home\ homedir] .br \%[\-maildelivery\ deliveryfile] \%[\-verbose] \%[\-noverbose] \%[\-debug] \%[\-help] .ad .DE \fISlocal\fP is a program designed to allow you to have your inbound mail processed according to a complex set of selection criteria. You do not normally invoke \fIslocal\fP yourself, rather \fIslocal\fP is invoked on your behalf by your system's Message Transfer Agent. The message selection criteria used by \fIslocal\fP is specified in the file \fI\&.maildelivery\fP in the user's home directory. The format of this file is given below. The message delivery address and message sender are determined from the Message Transfer Agent envelope information, if possible. Under \fISendMail\fP, the sender will obtained from the UUCP \*(lqFrom\ \*(rq line, if present. The user may override these values with command line arguments, or arguments to the `\-addr' and `\-sender' switches. The message is normally read from the standard input. The `\-file' switch sets the name of the file from which the message should be read, instead of reading stdin. The `\-user' switch tells \fIslocal\fP the name of the user for whom it is delivering mail. The `\-mailbox' switch tells \fIslocal\fP the name of the user's maildrop file. The `\-info' switch may be used to pass an arbitrary argument to sub-processes which \fIslocal\fP may invoke on your behalf. The `\-verbose' switch causes \fIslocal\fP to give information on stdout about its progress. The `\-debug' switch produces more verbose debugging output on stderr. .Uh "Message Transfer Agents" If your MTA is \fISendMail\fP, you should include the line .sp .nf .in +.5i \*(lq|\ @@(MHETCPATH)/slocal\ \-user\ username\*(rq .in -.5i .fi .sp in your \&.forward file in your home directory. This will cause \fISendMail\fP to invoke \fIslocal\fP on your behalf. If your MTA is \fIMMDF-I\fP, you should (symbolically) link @@(MHETCPATH)/slocal to the file bin/rcvmail in your home directory. This will cause \fIMMDF-I\fP to invoke \fIslocal\fP on your behalf with the correct \*(lq\fIaddress\ info\ sender\fP\*(rq arguments. If your MTA is \fIMMDF-II\fP, then you should not use \fIslocal\fP. An equivalent functionality is already provided by \fIMMDF-II\fP; see maildelivery(5) for details. .Uh "The Maildelivery File" The \fI\&.maildelivery\fR file controls how local delivery is performed. Each line of this file consists of five fields, separated by white-space or comma. Since double-quotes are honored, these characters may be included in a single argument by enclosing the entire argument in double-quotes. A double-quote can be included by preceding it with a backslash. Lines beginning with `#' are ignored. The format of each line in the \fI\&.maildelivery\fR file is: \fBheader pattern action result string\fR .sp .in +.5i .ti -.5i \fBheader\fP: .br The name of a header field that is to be searched for a pattern. This is any field in the headers of the message that might be present. The following special fields are also defined: .sp .in +1i .ta +1i .ti -1i \fIsource\fR the out-of-band sender information .ti -1i \fIaddr\fR the address that was used to cause delivery to the recipient .ti -1i \fIdefault\fR this matches \fIonly\fR if the message hasn't been delivered yet .ti -1i \fI*\fR this always matches .in -1i .ti -.5i \fBpattern\fR: .br The sequence of characters to match in the specified header field. Matching is case-insensitive, but does not use regular expressions. .ti -.5i \fBaction\fR: .br The action to take to deliver the message: .sp .in +1i .ta +1i .ti -1i \fIdestroy\fR This action always succeeds. .ti -1i \fIfile\fR or > Append the message to the file named by \fBstring\fR. The message is appended to the file in the maildrop format which is used by your message transport system. If the message can be appended to the file, then this action succeeds. When writing to the file, a \*(lqDelivery\-Date:\ date\*(rq header is added which indicates the date and time that message was appended to the file. .ti -1i \fImbox\fR Identical to \fIfile\fR, but always appends the message using the format used by \fIpackf\fR (the MMDF mailbox format). .ti -1i \fIpipe\fR or | Pipe the message as the standard input to the command named by \fBstring\fR, using the Bourne shell \fIsh\fR(1) to interpret the string. Prior to giving the string to the shell, it is expanded with the following built-in variables: .sp .in +1i .ta +1i .ti -1i $(sender) the out-of-band sender information .ti -1i $(address) the address that was used to cause delivery to the recipient .ti -1i $(size) the size of the message in bytes .ti -1i $(reply\-to) either the \*(lqReply\-To:\*(rq or \*(lqFrom:\*(rq field of the message .ti -1i $(info) the out-of-band information specified .in -1i .ti -1i \fIqpipe\fR or .ti -1i \fI\fR Similar to \fIpipe\fR, but executes the command directly, after built-in variable expansion, without assistance from the shell. This action can be used to avoid quoting special characters which your shell might interpret. .in -1i .ti -.5i \fBresult\fR: .br Indicates how the action should be performed: .in +1i .ta +1i .ti -1i \fIA\fR Perform the action. If the action succeeds, then the message is considered delivered. .ti -1i \fIR\fR Perform the action. Regardless of the outcome of the action, the message is not considered delivered. .ti -1i \fI?\fR Perform the action only if the message has not been delivered. If the action succeeds, then the message is considered delivered. .ti -1i \fIN\fR Perform the action only if the message has not been delivered and the previous action succeeded. If this action succeeds, then the message is considered delivered. .sp .in -1i .in -.5i To summarize, here's an example: .sp .if t .in +.5i .nf .ta \w'default 'u +\w'mh-workersxx 'uC +\w'destroy 'uC +\w'result 'u #\fIfield\fR \fIpattern\fR \fIaction\fR \fIresult\fR \fIstring\fR # lines starting with a '#' are ignored, as are blank lines # # file mail with mmdf2 in the \*(lqTo:\*(rq line into file mmdf2.log \fITo mmdf2 file A mmdf2.log\fP # Messages from mmdf pipe to the program err-message-archive \fIFrom mmdf pipe A /bin/err-message-archive\fP # Anything with the \*(lqSender:\*(rq address \*(lqmh-workers\*(rq # file in mh.log if not filed already \fISender mh-workers file ? mh.log\fP # \*(lqTo:\*(rq unix \- put in file unix-news \fITo Unix > A unix-news\fP .\" # if the address is jpo=mmdf \- pipe into mmdf-redist .\" \fIaddr jpo=mmdf | A mmdf-redist\fP # if the address is jpo=ack \- send an acknowledgement copy back \fIaddr jpo=ack \fP|\fI R \*(lq/bin/resend\0\-r\0$(reply-to)\*(rq\fP # anything from steve \- destroy! \fIFrom steve destroy A \-\fP # anything not matched yet \- put into mailbox \fIdefault \- > ? mailbox\fP # always run rcvtty \fI* \- \fP|\fI R /mh/lib/rcvtty\fP .re .fi .if t .in -.5i The file is always read completely, so that several matches can be made and several actions can be taken. The \fI\&.maildelivery\fR file must be owned either by the user or by root, and must be writable only by the owner. If the \fI\&.maildelivery\fR file cannot be found, or does not perform an action which delivers the message, then the file @@(MHETCPATH)/maildelivery is read according to the same rules. This file must be owned by the root and must be writable only by the root. If this file cannot be found or does not perform an action which delivers the message, then standard delivery to the user's maildrop is performed. .Uh "Sub-process environment" When a process is invoked, its environment is: the user/group-ids are set to recipient's ids; the working directory is the recipient's home directory; the umask is 0077; the process has no /dev/tty; the standard input is set to the message; the standard output and diagnostic output are set to /dev/null; all other file-descriptors are closed; the envariables \fB$USER\fR, \fB$HOME\fR, \fB$SHELL\fR are set appropriately, and no other envariables exist. The process is given a certain amount of time to execute. If the process does not exit within this limit, the process will be terminated with extreme prejudice. The amount of time is calculated as ((size x 60) + 300) seconds, where size is the number of bytes in the message. The exit status of the process is consulted in determining the success of the action. An exit status of zero means that the action succeeded. Any other exit status (or abnormal termination) means that the action failed. In order to avoid any time limitations, you might implement a process that began by \fIforking\fR. The parent would return the appropriate value immediately, and the child could continue on, doing whatever it wanted for as long as it wanted. This approach is somewhat risky if the parent is going to return an exit status of zero. If the parent is going to return a non-zero exit status, then this approach can lead to quicker delivery into your maildrop. @@BEGIN: MSGID .Uh "Duplicate Message Suppression" \fIslocal\fR is able to detect and supress duplicate messages. To enable this, create two empty files in your $HOME directory: \&.maildelivery.pag and \&.maildelivery.dir. These are ndbm files which are used to store the Message-IDs of incoming messages. @@END: MSGID .Fi ^@@(MHETCPATH)/mtstailor~^MH tailor file ^$HOME/\&.maildelivery~^The file controlling local delivery ^@@(MHETCPATH)/maildelivery~^Rather than the standard file ^@@(MHDROPLOC)~^The default maildrop .Sa rcvstore(1), mhook(1), mh\-format(5) @@BEGIN: MMDFIIMTS , maildelivery(5) @@END: MMDFIIMTS .De `\-noverbose' .Ds `\-maildelivery \&.maildelivery' .Ds `\-mailbox @@(MHDROPLOC)' .Ds `\-file' defaults to stdin .Ds `\-user' defaults to the current user .Co None .Hi @@BEGIN: MHMTS For compatibility with older versions of \fIMH\fR, if \fIslocal\fR can't find the user's \fI\&.maildelivery\fR file, it will attempt to execute an old-style rcvmail hook in the user's $HOME directory. In particular, it will first attempt to execute .ti +.5i \&.mh\(rureceive file maildrop directory user failing that it will attempt to execute .ti +.5i $HOME/bin/rcvmail user file sender before giving up and writing to the user's maildrop. In addition, whenever a hook or process is invoked, file-descriptor three (3) is set to the message in addition to the standard input. @@END: MHMTS \fISlocal\fP is designed to be backward-compatible with the \fImaildelivery\fP facility provided by \fIMMDF-II\fP. Thus, the \fI\&.maildelivery\fP file syntax is limited, as is the functionality of \fIslocal\fP. In addition to an exit status of zero, the \fIMMDF\fR values \fIRP_MOK\fR (32) and \fIRP_OK\fR (9) mean that the message has been fully delivered. Any other non-zero exit status, including abnormal termination, is interpreted as the \fIMMDF\fR value \fIRP_MECH\fR (200), which means \*(lquse an alternate route\*(rq (deliver the message to the maildrop). .Bu Only two return codes are meaningful, others should be. \fISlocal\fP is designed to be backwards-compatible with the \fImaildelivery\fP functionality provided by \fBMMDF-II\fP. Versions of \fIMMDF\fR with the \fImaildelivery\fR mechanism aren't entirely backwards-compatible with earlier versions of \fIMMDF\fP. If you have an \fIMMDF-I\fP old-style hook, the best you can do is to have a one-line \fI\&.maildelivery\fR file: .ti +.5i default \- pipe A \*(lqbin/rcvmail $(address) $(info) $(sender)\*(rq .En @ 1.14 log @note MMDF-II compatibility goal @ text @d2 2 a3 2 .\" @@(#)$Id: slocal.rf,v 1.13 1992/10/26 16:36:30 jromine Exp jromine $ .SC SLOCAL 8 @ 1.13 log @document MSGID option @ text @d2 1 a2 1 .\" @@(#)$Id: slocal.rf,v 1.12 1992/07/02 15:51:22 jromine Exp jromine $ d364 4 @ 1.12 log @document troubles with "pipe" & special characters @ text @d2 1 a2 1 .\" @@(#)$Id: slocal.rf,v 1.11 1992/02/15 00:08:56 jromine Exp jromine $ d292 1 d294 8 @ 1.11 log @changes from Stephen Gildea @ text @d2 1 a2 1 .\" @@(#)$Id: slocal.rf,v 1.10 1992/02/12 19:10:01 jromine Exp jromine $ d183 2 @ 1.10 log @typo @ text @d2 1 a2 1 .\" @@(#)$Id: slocal.rf,v 1.9 1992/02/12 19:08:15 jromine Exp jromine $ d90 2 a91 2 consists of five fields, separated by white\-space or comma. Since double\-quotes are honored, d93 2 a94 2 entire argument in double\-quotes. A double\-quote can be included by preceeding it with a backslash. d160 1 a160 1 it is expanded with the following built\-in variables: d181 1 a181 1 after built\-in variable expansion, d249 1 a249 1 If the \fI\&.maildelivery\fR file can not be found, d253 1 a253 1 If this file can not be found d260 1 a260 1 the working directory is the recipient's directory; d265 1 a265 1 all other file\-descriptors are closed; d288 1 a288 1 If the parent is going to return a non\-zero exit status, d317 1 a317 1 it will attempt to execute an old\-style rcvmail hook in the user's $HOME d334 1 a334 1 file\-descriptor three (3) is set to the message in addition to the standard d346 1 a346 1 All other non\-zero exit status, d355 3 a357 3 entirely backwards\-compatible with earlier versions of \fIMMDF\fP. If you have an \fIMMDF-I\fP old\-style hook, the best you can do is to have a one\-line @ 1.9 log @major revision @ text @d2 1 a2 1 .\" @@(#)$Id: slocal.rf,v 1.8 1992/02/12 05:59:38 jromine Exp jromine $ d28 1 a28 1 You do not normallynormally invoke \fIslocal\fP yourself, @ 1.8 log @enclose cmd in quotes @ text @d2 1 a2 1 .\" @@(#)$Id: slocal.rf,v 1.7 1992/02/12 04:24:50 jromine Exp jromine $ d28 1 a28 1 You do \fBNOT\fR invoke \fIslocal\fP yourself, d174 1 a174 2 $(info) miscellaneous out-of-band information as specified on the command line. d216 1 d218 1 a218 2 .in +.5i .ta \w'defaultxxx 'u +\w'mh-workers 'uC +\w'action'uC +\w'result'u a241 1 .in -.5i d243 1 d245 12 a290 12 The file is always read completely, so that several matches can be made and several actions can be taken. The \fI\&.maildelivery\fR file must be owned either by the user or by root, and must be writable only by the owner. If the \fI\&.maildelivery\fR file can not be found, or does not perform an action which delivers the message, then the file @@(MHETCPATH)/maildelivery is read according to the same rules. This file must be owned by the root and must be writable only by the root. If this file can not be found or does not perform an action which delivers the message, then standard delivery to the user's maildrop is performed. d298 3 a300 3 #ifdef MMDF maildelivery(5) #endif d314 29 a342 24 .\" For compatibility with older versions of \fIMH\fR, .\" if \fIslocal\fR can't find the user's \fI\&.maildelivery\fR file, .\" it will attempt to execute an old\-style rcvmail hook in the user's $HOME .\" directory. .\" In particular, .\" it will first attempt to execute .\" .\" .ti +.5i .\" \&.mh\(rureceive file maildrop directory user .\" .\" failing that it will attempt to execute .\" .\" .ti +.5i .\" $HOME/bin/rcvmail user file sender .\" .\" before giving up and writing to the user's maildrop. .\" .\" In addition, .\" whenever a hook or process is invoked, .\" file\-descriptor three (3) is set to the message in addition to the standard .\" input. .\" @@BEGIN: MMDFIMTS .br a350 2 .br @@END: MMDFIMTS d353 10 @ 1.7 log @typo @ text @d2 1 a2 1 .\" @@(#)$Id: slocal.rf,v 1.6 1992/02/12 02:49:43 jromine Exp jromine $ d67 1 a67 1 |\ @@(MHETCPATH)/slocal\ \-user\ username @ 1.6 log @looks OK @ text @d2 1 a2 1 .\" @@(#)$Id: slocal.rf,v 1.5 1992/02/12 02:31:09 jromine Exp jromine $ d41 1 a41 1 the sender will obtained from the UUCP \*(lqFrom \*(rq d58 1 a58 1 to give information on stdout about the its progress. d78 1 a78 1 with the \*(lqaddress\ info\ sender\*(rq arguments. @ 1.5 log @ckpt @ text @d2 1 a2 1 .\" @@(#)$Id: slocal.rf,v 1.4 1992/02/12 00:23:07 jromine Exp $ d11 1 d25 5 a29 5 \fISlocal\fP is a program designed to allow inbound mail to be processed according to a set of selection criteria. You do \fBNOT\fR invoke the hook yourself, rather the hook is invoked on your behalf by the d33 2 a34 1 criteria is specified in the file \fI\&.maildelivery\fP d38 1 a38 1 The delivery address and message sender are d54 3 d59 1 a59 1 The `\-debug' switch produces verbose debugging output on stderr. d77 2 a78 1 This will cause \fIMMDF-I\fP to invoke \fIslocal\fP on your behalf. d82 1 a82 1 An equivalent functionality is already provide by \fIMMDF-II\fP; d87 1 a87 2 The \fI\&.maildelivery\fR file, which is an ordinary ASCII file, d89 7 d98 2 a99 1 \fBfield pattern action result string\fR d103 1 a103 1 \fBfield\fP: d105 1 a105 2 The name of a header field that is to be searched for a pattern. d112 1 a112 1 \fIsource\fR the out\-of\-band sender information d125 2 a126 2 of characters to match in the specified field. Matching is case\-insensitive but not does not use regular expressions. d158 1 a158 1 using the Bourne shell \fIsh\fR\0(1) to interpret the string. d165 1 a165 1 $(sender) the return address for the message d174 2 a175 1 $(info) miscellaneous out\-of\-band information d212 1 a212 1 a214 8 Arguments in the \fI\&.maildelivery\fR file are separated by white\-space or comma. Since double\-quotes are honored, these characters may be included in a single argument by enclosing the entire argument in double\-quotes. A double\-quote can be included by preceeding it with a backslash. d216 1 a216 1 d219 1 a219 1 .ta \w'default 'u +\w'mh-workersxxx 'uR +\w'action'uC +\w'result'u d235 1 a235 1 \fIaddr jpo=ack | R \*(lq/bin/resend\0\-r\0$(reply-to)\*(rq\fP d241 1 a241 1 \fI* \- | R /mh/lib/rcvtty\fP d293 1 a293 1 ^@@(MHETCPATH)/mtstailor~^tailor file d299 3 d304 8 a350 9 Versions of \fIMMDF\fR with the \fImaildelivery\fR mechanism aren't entirely backwards\-compatible with earlier versions. If you have an old\-style hook, the best you can do is to have a one\-line \fI\&.maildelivery\fR file: .ti +.15i default \- pipe A \*(lqbin/rcvmail $(address) $(info) $(sender)\*(rq .En @ 1.4 log @ckpt @ text @d2 2 a3 2 .\" @@(#)$Id: slocal.rf,v 1.3 1992/02/11 23:48:28 jromine Exp jromine $ .SC MHOOK 1 d9 1 d11 2 d14 1 d16 1 a16 3 \%[\-sender\ sender] \%[\-mailbox\ mbox] \%[\-home\ homedir] d36 7 a42 5 .Uh "Variables" \fISlocal\fP sets a number of variables which are available as arguments to the programs invoked by \fIslocal\fP. The default values of these parameters may be overridden by command line arguments to \fIslocal\fP. d44 8 a51 33 .in +.5i .ti -.5i address .br The destination address. This is obtained from the message envelope delivery information, if possible. If not present, the login name of the uid invoking slocal. .ti -.5i username .br The mbox part of \*(lqaddress\*(rq, else the value of \*(lqaddress\*rq. .ti -.5i homedir .br The user's home directory. This sets .ti -.5i mbox .br The user's maildrop file, if not \*(lq@@(MHDROPLOC)\*(rq. .ti -.5i file .br The file from which to read the message, if not stdin. .ti -.5i sender .br The message sender. This is obtained from the message envelope delivery information, if possible. Under \fISendMail\fP, it is obtained from the UUCP \*(lqFrom \*(rq line, if present. .in -.5i The `\-maildelivery' switch sets the name of the maildelivery file to read instructions from. d54 1 a54 1 The `\-debug' switch produces verbose debugging output, printed on stderr. d62 1 a62 1 | @@(MHETCPATH)/slocal -user username d100 1 a100 1 \fIsource\fR: the out\-of\-band sender information d102 1 a102 1 \fIaddr\fR: the address that was used to cause delivery to the recipient d104 1 a104 1 \fIdefault\fR: this matches \fIonly\fR if the message hasn't been delivered yet d106 1 a106 1 \fI*\fR: this always matches d116 5 a120 2 .ti -1i \fBaction\fR: The action to take to deliver the message: d122 1 a122 1 .ta +1.5i d124 4 a127 1 \fIfile\fR or \fI>\fR: Append a132 1 d138 1 a138 1 \fImbox\fR: Identical d143 2 a144 2 .ti -.5i \fIpipe\fR or \fI|\fR: Pipe d149 1 d153 1 a153 1 $(sender): the return address for the message d155 1 a155 1 $(address): the address that was used to cause delivery to the recipient d157 1 a157 1 $(size): the size of the message in bytes d159 1 a159 1 $(reply\-to): either the \*(lqReply\-To:\*(rq or \*(lqFrom:\*(rq field d162 1 a162 1 $(info): miscellaneous out\-of\-band information d164 8 d173 69 d243 1 a243 1 the user/group id:s are set to recipient's id:s; a274 48 .ti -.5i \fIqpipe\fR or \fI\fR: .br Similar to \fIpipe\fR, but executes the command directly, after built\-in variable expansion, without assistance from the shell. .ti -.5i \fIdestroy\fR: .br This action always succeeds. .in -.5i .ti -.25i \fBresult\fR: .br Indicates how the action should be performed: .in +.5i .ti -.5i \fIA\fR: .br Perform the action. If the action succeeds, then the message is considered delivered. .ti -.5i \fIR\fR: .br Perform the action. Regardless of the outcome of the action, the message is not considered delivered. .ti -.5i \fI?\fR: .br Perform the action only if the message has not been delivered. If the action succeeds, then the message is considered delivered. .ti -.5i \fIN\fR: .br Perform the action only if the message has not been delivered and the previous action succeeded. If this action succeeds, then the message is considered delivered. .in -.5i .in -.5i d285 1 a285 1 then standard delivery to the user's maildrop, @@(MHDROPLOC), is performed. a286 38 Arguments in the \fI\&.maildelivery\fR file are separated by white\-space or comma. Since double\-quotes are honored, these characters may be included in a single argument by enclosing the entire argument in double\-quotes. A double\-quote can be included by preceeding it with a backslash. To summarize, here's an example: .nf .in +.5i .ta \w'default 'u +\w'uk-mmdf-workers 'u +\w'action 'u +\w'result 'u #\fIfield\fR \fIpattern\fR \fIaction\fR \fIresult\fR \fIstring\fR # lines starting with a '#' are ignored, as are blank lines # # file mail with mmdf2 in the \*(lqTo:\*(rq line into file mmdf2.log To mmdf2 file A mmdf2.log # Messages from mmdf pipe to the program err-message-archive From mmdf pipe A err-message-archive # Anything with the \*(lqSender:\*(rq address \*(lquk-mmdf-workers\*(rq # file in mmdf2.log if not filed already Sender uk-mmdf-workers file ? mmdf2.log # \*(lqTo:\*(rq unix \- put in file unix-news To Unix > A unix-news # if the address is jpo=mmdf \- pipe into mmdf-redist addr jpo=mmdf | A mmdf-redist # if the address is jpo=ack \- send an acknowledgement copy back addr jpo=ack | R \*(lqresend\0\-r\0$(reply-to)\*(rq # anything from steve \- destroy! From steve destroy A \- # anything not matched yet \- put into mailbox default \- > ? mailbox # always run rcvalert * \- | R rcvalert .re .in -.5i .fi a295 4 .Ds \fIaddress\fP is the user invoking \fIslocal\fP .Ds \fIuser\fP is the same as \fIaddress\fP d299 22 a320 22 For compatibility with older versions of \fIMH\fR, if \fIslocal\fR can't find the user's \fI\&.maildelivery\fR file, it will attempt to execute an old\-style rcvmail hook in the user's $HOME directory. In particular, it will first attempt to execute .ti +.5i \&.mh\(rureceive file maildrop directory user failing that it will attempt to execute .ti +.5i $HOME/bin/rcvmail user file sender before giving up and writing to the user's maildrop. In addition, whenever a hook or process is invoked, file\-descriptor three (3) is set to the message in addition to the standard input. d322 1 d331 1 a332 1 .\} @ 1.3 log @ckpt @ text @d2 1 a2 1 .\" @@(#)$Id: slocal.rf,v 1.1 1992/02/11 21:45:43 jromine Exp jromine $ d101 1 d105 1 a105 1 This file is read by \*(SL. d107 2 a108 7 The format of each line in the \fI\&.maildelivery\fR file is .ti +.5i \fBfield pattern action result string\fR where d110 2 a111 2 .ti -.25i \fBfield\fR: d113 2 a114 1 The name of a header field that is to be searched for a pattern. d116 13 a128 10 In addition, the following special fields are also defined: .in +.25i \fIsource\fR: the out\-of\-band sender information .br \fIaddr\fR: the address that was used to cause delivery to the recipient .br \fIdefault\fR: this matches \fIonly\fR if the message hasn't been delivered yet .br \fI*\fR: this always matches .in -.25i d130 1 a130 1 .ti -.25i d133 3 a135 2 The sequence of characters to match in the specified field. Matching is case\-insensitive but not RE\-based. d137 7 a143 11 .ti -.25i \fBaction\fR: .br The action to take to deliver the message. This is one of .in +.5i .ti -.5i \fIfile\fR or \fI>\fR: .br Append the message to the file named by \fBstring\fR. d150 1 a150 5 a new field is added: .ti +.5i Delivery\-Date:\ date d153 3 a155 4 .ti -.5i \fImbox\fR: .br Identical to \fIfile\fR, d160 2 a161 3 \fIpipe\fR or \fI|\fR: .br Pipe the message as the standard input to the command named by \fBstring\fR, d165 10 a174 8 .in +.25i $(sender): the return address for the message .br $(address): the address that was used to cause delivery to the recipient .br $(size): the size of the message in bytes .br $(reply\-to): either the \*(lqReply\-To:\*(rq or \*(lqFrom:\*(rq field d176 3 a178 3 .br $(info): miscellaneous out\-of\-band information .in -.25i @ 1.2 log @cut 1 @ text @d7 2 a8 1 @@(MHETCPATH)/slocal \%[addr\ info\ sender] d10 1 a10 1 \%[\-user\ name] d14 3 a16 2 \%[\-home\ directory] \%[\-maildelivery\ file] d20 1 d34 43 a99 45 .Uh Options .in +.5i .ti -.5i \-addr\ address .br The destination address. This is obtained from the message envelope delivery information, if possible. If not present, the login name of the uid invoking slocal. .ti -.5i \-user\ name .br The mbox part of "addr", else the value of "addr" .ti -.5i \-mailbox\ mbox .br The user's maildrop file, if not \*(lq@@(MHDROPLOC)\*(rq. .ti -.5i \-home\ directory .br The user's home directory. .ti -.5i \-file\ file .br The file from which to read the message, if not stdin. .ti -.5i \-sender\ sender .br The message sender. This is obtained from the message envelope delivery information, if possible. Under \fISendMail\fP, it is obtained from the UUCP \*(lqFrom \*(rq line, if present. .ti -.5i \-maildelivery\ file .br The maildelivery file to read instructions from. .ti -.5i \-verbose .br Give information on stdout about the progress of slocal. .ti -.5i \-debug .br Verbose debugging output, printed on stderr. Helpful when debugging your .maildelivery file. .in -.5i @ 1.1 log @Initial revision @ text @d2 1 a2 1 .\" @@(#)$Id: mhook.rf,v 1.10 1992/02/10 20:00:15 jromine Exp $ d5 1 a5 1 mhook \- MH receive\-mail hooks d7 10 a16 23 $HOME/\&.maildelivery @@BEGIN: MHMTS .ds SL \fIpost\fR .ds ZS slocal @@END: MHMTS @@BEGIN: MMDFIMTS .ds SL \fIslocal\fR .ds ZS slocal @@END: MMDFIMTS @@BEGIN: MMDFIIMTS .ds SL the local channel .ds ZS mmdfII @@END: MMDFIIMTS @@BEGIN: SENDMTS .ds SL \fIslocal\fR .ds ZS slocal @@END: SENDMTS .ti .5i @@(MHETCPATH)/rcvdist \%[\-form\ formfile] \%[switches\ for\ \fIpostproc\fR] address\ ... d18 7 d26 4 a29 4 .ti .5i @@(MHETCPATH)/rcvpack file \%[\-help] d31 4 a34 27 .ti .5i @@(MHETCPATH)/rcvtty \%[command] \%[\-form\ formatfile] \%[\-format\ string] \%[\-bell] \%[\-nobell] \%[\-newline] \%[\-nonewline] \%[\-biff] \%[\-help] .DE A receive\-mail hook is a program that is run whenever you receive a mail message. You do \fBNOT\fR invoke the hook yourself, @@BEGIN: MHMTS rather the hook is invoked on your behalf by \fIMH\fR. @@END: MHMTS @@BEGIN: MMDFIMTS rather the hook is invoked on your behalf by \fIMMDF\fR when you (symbolically) link @@(MHETCPATH)/slocal to the file bin/rcvmail in your home directory. @@END: MMDFIMTS @@BEGIN: MMDFIIMTS rather the hook is invoked on your behalf by \fIMMDF\fR. @@END: MMDFIIMTS @@BEGIN: SENDMTS rather the hook is invoked on your behalf by \fISendMail\fR, when you include the line d37 1 a37 1 \*(lq| @@(MHETCPATH)/slocal -user username\*(rq d40 1 d42 1 a42 1 @@END: SENDMTS d44 56 a103 1 .if '\*(ZS'slocal' \{\ d116 1 a116 1 The name of a field that is to be searched for a pattern. a315 4 .\} .if '\*(ZS'mmdfII' \{\ See \fImaildelivery\fR\0(5) for the details. .\} a316 37 Four programs are currently standardly available, \fIrcvdist\fR (redistribute incoming messages to additional recipients), \fIrcvpack\fR (save incoming messages in a \fIpackf\fR'd file), and \fIrcvtty\fR (notify user of incoming messages). The fourth program, \fIrcvstore\fR\0(1) is described separately. They all reside in the \fI@@(MHETCPATH)/\fR directory. The \fIrcvdist\fR program will resend a copy of the message to all of the addresses listed on its command line. It uses the format string facility described in \fImh\-format\fR\0(5). The \fIrcvpack\fR program will append a copy of the message to the file listed on its command line. Its use is obsoleted by the \fI\&.maildelivery\fR. The \fIrcvtty\fR program executes the named file with the message as its standard input, and writes the resulting output on your terminal. If no file is specified, or is bogus, etc., then \fIrcvtty\fR will instead write a one\-line scan listing. Either the `\-form\ formatfile' or `\-format\ string' option may be used to override the default output format (see \fImh\-format\fP\0(5)). A newline is output before the message output, and the terminal bell is rung after the output. The `\-nonewline' and `\-nobell' options will inhibit these functions. Normally, \fIrcvtty\fP obeys write permission as granted by \fImesg\fP\0(1). With the `\-biff' option, \fIrcvtty\fP will obey the notification status set by \fIbiff\fP\0(1). If the terminal access daemon (TTYD) is available on your system, then \fIrcvtty\fR will give its output to the daemon for output instead of writing on the user's terminal. d321 1 d323 7 a329 6 .if '\*(ZS'slocal' \{\ rcvstore (1), mh\-format(5) .\} .if '\*(ZS'mmdfII' \{\ rcvstore (1), maildelivery(5), mh\-format(5) .\} a331 1 .if '\*(ZS'slocal' \{\ a368 1 .if '\*(ZS'mmdfII' \{\ a375 1 .\} @