⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 maildelivery.5

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 5
字号:
.tr ~.de NP.IP "\fI\\$1\fP" 10...de II.nr P- \\n()P	 \" save the preceeding IP space.nr )P 0	\" now set it to 0.NP "\\$1\fP".nr )P \\n(P-	 \" restore the preceeding IP space...ds M \fI.maildelivery\fP.TH MAILDELIVERY 5 "1 October, 1985".SH NAMEmaildelivery.SH SYNOPSISUser delivery specification file.SH DESCRIPTIONThe delivery of mail by the local channel can run through variouscourses, including using a user tailorable file.The delivery follows the following strategy, giving up at any pointit considers the message delivered..RS.IP "1)" 4If the address indicates a pipe or file defaultthen that is carried out..IP "2)" 4The file \*M(or something similar) in the home directory is read if it existsand the actions in it are followed..IP "3)" 4A system-wide file is consulted next, such as.I /usr/lib/maildeliveryand the actions are similar to 2..IP "4)" 4If the message still hasn't been delivered, then it is put intothe user's normal mailbox .RI ( .mailor.IR mailbox )depending on the system..RE.PPThe format of the \*M file is.RS.B field.I <FS>.B pattern.I <FS>.B action.I <FS>
.B result.I <FS>.B string.REwhere.br.NP fieldis name of a field that is to be searched for a pattern.This is any header field that you might find in a message.The most commonly used headers are usuallyFrom, to, cc, subject and sender.As well as the standard headers, there are some psuedo-headersthat are can also be used. These are :-.RS.II sourceThe out of band sender information. This is the address MMDF woulduse for reporting delivery problems with the message..II addrthe address that was used to mail to you, normally 'yourname' or 'yourname=string' (see below)..II defaultif the message hasn't been delivered yet, this field is matched..II *this case is always true regardless of any other action..RE.NP patternis some sequence of characters that may be matched in theabove.IR field .Case is not significant..IP \fIaction\fP 10is one of the mail delivery actions supported by thelocal channel.  Currently the supported actions are.B fileor.BR > ,whichappends the message to the given file, with delimiters;.B pipeor.BR | ,which starts up a process with the messageas the standard input;and.B destroywhich throws the message away.There is also.B qpipeor.BR ^ ,which fakes a pipe command and is quicker than the standard pipe,but does not do header reformatting..brFor piped commands, the exit status of the command is significant.An exit status of 0 implies that the command succeeded and everythingwent well. An exit status of octal 0300-0377 indicates that a permanentfailure occured and the message should be rejected, these error codesare given in mmdf.h. Any other exitstatus indicates a temporary failure and the delivery attempt willbe aborted and restarted at a later time..NP resultis one of the letters A, R or ? which stand forAccept, Reject and "Accept if not delivered yet".They have the following effects:.RS.II AIf the result of this line's action is OK, then the message can beconsidered delivered..II RThe message is not to be considered delivered by this action..II ?This is equivalent to.I Aexcept that the action is not carriedout if the message has already been accepted..RE.PPThe file is always read completely so that several matchescan be made, and several actions taken.As a security check, the \*M file must be owned by eitherthe user or root, and must not have group or generalwrite permission. In addition the system delivery file has the aboverestrictions but must also be owned by root.If the field specified does not need a pattern a dash (\-)or similar symbol is usually inserted to show that the field is presentbut not used.The field separator character can be either a tab, space or comma (,).These characters can be included in a string by quoting them withdouble quotes (") (double quotes can be included with a backslash '\e')..PPMMDF treats local addresses which contain an equals sign ('=')in a special manner.  Everything in a local addressfrom an equals sign to the '@' is ignored and passed on to thelocal channel.  The local channel will make the entire string availablefor matching against the.I addrstring of the \*M file.For example, if you were tosubscribe to a digest as "foo=digest@bar.NET",.B submitand the local channel will verifythat it is legal to deliverto "foo", but then the entire string "foo=digest" will be availablefor string matching against the \*M file for the.B addrfield..SH ENVIRONMENTThe environment in which piped programs are runcontains a few standard features, specifically:.ne 5.sp.nfHOME is set to the user's home directory.USER is set to the user's login name.SHELL is set to the user's login shell (defaults to /bin/sh)..sp.fiThe default umask is set up to 077, this gives a very protectivecreation mask.Initgroups is called if 4.2 version of UNIX is running.If further requirements are needed, then a shell scriptcan be run first to set up more complex environments..PPThere are certain built-in variables that you can give toa piped program.  These are.IR $(sender) ,.IR $(address) ,.IR $(size) ,.I $(reply-to)and.IR $(info) ..I $(sender)is set to the return address for the message..I $(address)is set to the address that was used to mail to you, normally `yourname'or `yourname=string'..I $(size)is set to the size in bytes of this message..I $(reply-to)is set to the Reply-To: field (or the From: field if the former ismissing) and so can be used for automatic replies..I $(info)is the info field from the internal mail header and is probably onlyof interest to the system maintainers..SH EXAMPLE.PPHere is a rough idea of what a \*M file looks like:.ne 12.nf.sp# lines \fIstarting\fP with a '#' are ignored.# as are blank lines# file mail with mmdf2 in the "To:" line into file mmdf2.logTo~~~~mmdf2~~~~file~~~~A~~~~mmdf2.log# Messages from mmdf pipe to the program err-message-archiveFrom~~~~mmdf~~~~pipe~~~~A~~~~err-message-archive# Anything with the "Sender:" address "uk-mmdf-workers"# file in mmdf2.log if not filed alreadySender~~~~uk-mmdf-workers~~~~file~~~~?~~~~mmdf2.log# "To:" unix \- put in file unix-newsTo~~~~Unix~~~~>~~~~A~~~~unix-news# if the address is jpo=mmdf \- pipe into mmdf-redistAddr~~~~jpo=mmdf~~~~|~~~~A~~~~mmdf-redist# if the address is jpo=ack \- send an acknowledgement copy backAddr~~~~jpo=ack~~~~|~~~~R~~~~resend~~\-r~~$(reply-to)# anything from steve \- destroy!from~~~~steve~~~~destroy~~~~A~~~~\-# anything not matched yet \- put into mailboxdefault~~~~\-~~~~>~~~~?~~~~mailbox# always run rcvalert*~~~~\-~~~~|~~~~R~~~~rcvalert.sp.fi.SH FILES$HOME/.maildelivery\- the files normal location..br/usr/lib/maildelivery \-the system file. This should be protected against attack.  Itmay contain contents such as:.ne 4.sp.nfdefault~~~~\-~~~~pipe~~~~A~~~~stdreceive*~~~~\-~~~~|~~~~R~~~~ttynotify.fi.spThis alows interfacing to non-standard mail systems,ones that don't believe in delimiter-separated mailboxes.SH "SEE ALSO"rcvtrip(1).SH BUGSAnd why not?

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -