op.me

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· ME 代码 · 共 2,890 行 · 第 1/5 页

ME
2,890
字号
or some similar tool)as any logical need.Maintaining more than three separate tables by handis essentially an impossible job..sh 4 "Small site \*- complete information".ppA small site(two or three hosts)may find it more reasonable to have complete informationat each host.This would require that each hostknow exactly where each network connection is,possibly including the names of each host on that network.As long as the site remains smalland the the configuration remains relatively static,the update problem will probably not be too great..sh 4 "Single host".ppThis is in some sense the trivial case.The only major issue is trying to insure that you don'thave to know too much about your environment.For example,if you have a UUCP connectionyou might find it useful to know about the names of hostsconnected directly to you,but this is really not necessarysince this may be determined from the syntax..sh 3 "Relevant issues".ppThe canonical form you useshould almost certainly be as specified inthe Arpanet protocolsRFC819 and RFC822.Copies of these RFC's are included on the.i sendmailtapeas.i doc/rfc819.lprand.i doc/rfc822.lpr ..ppRFC822describes the format of the mail message itself..i Sendmailfollows this RFC closely,to the extent that many of the standards described in this documentcan not be changed without changing the code.In particular,the following characters have special interpretations:.(b< > ( ) " \e.)bAny attempt to use these characters for other than their RFC822purpose in addresses is probably doomed to disaster..ppRFC819describes the specifics of the domain-based addressing.This is touched on in RFC822 as well.Essentially each host is given a namewhich is a right-to-left dot qualified pseudo-pathfrom a distinguished root.The elements of the path need not be physical hosts;the domain is logical rather than physical.For example,at Berkeleyone legal host is.q a.cc.berkeley.arpa ;reading from right to left,.q arpais a top level domain(related to, but not limited to, the physical Arpanet),.q berkeleyis both an Arpanet host and a logical domainwhich is actually interpreted bya host called ucbvax(which is actually just the.q "major"host for this domain),.q ccrepresents the Computer Center,(in this case a strictly logical entity),and.q ais a host in the Computer Center;this particular host happens to be connectedvia berknet,but other hosts might be connected via one of two ethernetsor some other network..ppBeware when reading RFC819that there are a number of errors in it..sh 3 "How to proceed".ppOnce you have decided on a philosophy,it is worth examining the available configuration tablesto decide if any of them are close enoughto steal major parts of.Even under the worst of conditions,there is a fair amount of boiler plate that can be collected safely..ppThe next step is to build ruleset three.This will be the hardest part of the job.Beware of doing too much to the address in this ruleset,since anything you do will reflect throughto the message.In particular,stripping of local domains is best deferred,since this can leave you with addresses with no domain spec at all.Since.i sendmaillikes to append the sending domain to addresses with no domain,this can change the semantics of addresses.Also try to avoidfully qualifying domains in this ruleset.Although technically legal,this can lead to unpleasantly and unnecessarily long addressesreflected into messages.The Berkeley configuration filesdefine ruleset nineto qualify domain names and strip local domains.This is called from ruleset zeroto get all addresses into a cleaner form..ppOnce you have ruleset three finished,the other rulesets should be relatively trivial.If you need hints,examine the supplied configuration tables..sh 3 "Testing the rewriting rules \*- the \-bt flag".ppWhen you build a configuration table,you can do a certain amount of testingusing the.q "test mode"of.i sendmail .For example,you could invoke.i sendmailas:.(bsendmail \-bt \-Ctest.cf.)bwhich would read the configuration file.q test.cfand enter test mode.In this mode,you enter lines of the form:.(brwset address.)bwhere.i rwsetis the rewriting set you want to useand.i addressis an address to apply the set to.Test mode shows you the steps it takesas it proceeds,finally showing you the address it ends up with.You may use a comma separated list of rwsetsfor sequential application of rules to an input;ruleset three is always applied first.For example:.(b1,21,4 monet:bollard.)bfirst applies ruleset three to the input.q monet:bollard.Ruleset one is then applied to the output of ruleset three,followed similarly by rulesets twenty-one and four..ppIf you need more detail,you can also use the.q \-d21flag to turn on more debugging.For example,.(bsendmail \-bt \-d21.99.)bturns on an incredible amount of information;a single word addressis probably going to print out several pages worth of information..sh 3 "Building mailer descriptions".ppTo add an outgoing mailer to your mail system,you will have to define the characteristics of the mailer..ppEach mailer must have an internal name.This can be arbitrary,except that the names.q localand.q progmust be defined..ppThe pathname of the mailer must be given in the P field.If this mailer should be accessed via an IPC connection,use the string.q [IPC]instead..ppThe F field defines the mailer flags.You should specify an.q for.q rflag to pass the name of the sender as a.b \-for.b \-rflag respectively.These flags are only passed if they were passed to.i sendmail,so that mailers that give errors under some circumstancescan be placated.If the mailer is not pickyyou can just specify.q "\-f $g"in the argv template.If the mailer must be called as.b rootthe.q Sflag should be given;this will not reset the useridbefore calling the mailer\**..(f\**\c.i Sendmailmust be running setuid to rootfor this to work..)fIf this mailer is local(i.e., will perform final deliveryrather than another network hop)the.q lflag should be given.Quote characters(backslashes and " marks)can be stripped from addresses if the.q sflag is specified;if this is not giventhey are passed through.If the mailer is capable of sending to more than one useron the same hostin a single transactionthe.q mflag should be stated.If this flag is on,then the argv template containing.b $uwill be repeated for each unique useron a given host.The.q eflag will mark the mailer as being.q expensive,which will cause.i sendmailto defer connectionuntil a queue run\**..(f\**The.q cconfiguration option must be givenfor this to be effective..)f.ppAn unusual case is the.q Cflag.This flag applies to the mailer that the message is received from,rather than the mailer being sent to;if set,the domain spec of the sender(i.e., the.q @host.domainpart)is savedand is appended to any addresses in the messagethat do not already contain a domain spec.For example,a message of the form:.(bFrom: eric@ucbarpaTo: wnj@monet, mckusick.)bwill be modified to:.(bFrom: eric@ucbarpaTo: wnj@monet, mckusick@ucbarpa.)b.i "if and only if"the.q Cflag is defined in the mailer corresponding to.q eric@ucbarpa..ppOther flags are describedin Appendix C..ppThe S and R fields in the mailer descriptionare per-mailer rewriting setsto be applied to sender and recipient addressesrespectively.These are applied after the sending domain is appendedand the general rewriting sets(numbers one and two)are applied,but before the output rewrite(ruleset four)is applied.A typical use is to append the current domainto addresses that do not already have a domain.For example,a header of the form:.(bFrom: eric.)bmight be changed to be:.(bFrom: eric@ucbarpa.)bor.(bFrom: ucbvax!eric.)bdepending on the domain it is being shipped into.These sets can also be usedto do special purpose output rewritingin cooperation with ruleset four..ppThe E field defines the string to useas an end-of-line indication.A string containing only newline is the default.The usual backslash escapes(\er, \en, \ef, \eb)may be used..ppFinally,an argv template is given as the E field.It may have embedded spaces.If there is no argv with a.b $umacro in it,.i sendmailwill speak SMTPto the mailer.If the pathname for this mailer is.q [IPC],the argv should be.(bIPC $h [ \fIport\fP ].)bwhere.i portis the optional port numberto connect to..ppFor example,the specifications:.(b.ta \w'Mlocal, 'u +\w'P=/bin/mail, 'u +\w'F=rlsm, 'u +\w'S=10, 'u +\w'R=20, 'uMlocal,	P=/bin/mail,	F=rlsm	S=10,	R=20,	A=mail \-d $uMether,	P=[IPC],	F=meC,	S=11,	R=21,	A=IPC $h, M=100000.)bspecifies a mailer to do local deliveryand a mailer for ethernet delivery.The first is called.q local,is located in the file.q /bin/mail,takes a picky.b \-rflag,does local delivery,quotes should be stripped from addresses,and multiple users can be delivered at once;ruleset tenshould be applied to sender addresses in the messageand ruleset twentyshould be applied to recipient addresses;the argv to send to a message will be the word.q mail,the word.q \-d,and words containing the name of the receiving user.If a.b \-rflag is insertedit will be between the words.q mailand.q \-d.The second mailer is called.q ether,it should be connected to via an IPC connection,it can handle multiple users at once,connections should be deferred,and any domain from the sender addressshould be appended to any receiver namewithout a domain;sender addresses should be processed by ruleset elevenand recipient addresses by ruleset twenty-one.There is a 100,000 byte limit on messages passed through this mailer..++ A.+c "COMMAND LINE FLAGS".ba 0.nr ii 1i.ppArguments must be presented with flags before addresses.The flags are:.ip "\-f\ \fIaddr\fP"The sender's machine address is.i addr .This flag is ignored unless the real useris listed as a.q "trusted user"or if.i addrcontains an exclamation point(because of certain restrictions in UUCP)..ip "\-r\ \fIaddr\fP"An obsolete form of.b \-f ..ip "\-h\ \fIcnt\fP"Sets the.q "hop count"to.i cnt .This represents the number of times this message has been processedby.i sendmail(to the extent that it is supported by the underlying networks)..i Cntis incremented during processing,and if it reachesMAXHOP(currently 30).i sendmailthrows away the message with an error..ip \-F\fIname\fPSets the full name of this user to.i name ..ip \-nDon't do aliasing or forwarding..ip \-tRead the header for.q To: ,.q Cc: ,and.q Bcc:lines, and send to everyone listed in those lists.The.q Bcc:line will be deleted before sending.Any addresses in the argument vector will be deletedfrom the send list..ip \-b\fIx\fPSet operation mode to.i x .Operation modes are:.(b.ta 4nm	Deliver mail (default)a	Run in arpanet mode (see below)s	Speak SMTP on input sided	Run as a daemont	Run in test modev	Just verify addresses, don't collect or deliveri	Initialize the alias databasep	Print the mail queuez	Freeze the configuration file.)bThe special processing for theARPANETincludes reading the.q "From:"line from the header to find the sender,printingARPANETstyle messages(preceded by three digit reply codes for compatibility withthe FTP protocol[Neigus73, Postel74, Postel77]),and ending lines of error messages with <CRLF>..ip \-q\fItime\fPTry to process the queued up mail.If the time is given,a sendmail will run through the queue at the specified intervalto deliver queued mail;otherwise, it only runs once..ip \-C\fIfile\fPUse a different configuration file..ip \-d\fIlevel\fPSet debugging level..ip \-o\fIx\|value\fPSet option.i xto the specified.i value .These options are described in Appendix B..ppThere are a number of options that may be specified asprimitive flags(provided for compatibility with.i delivermail ).These are the e, i, m, and v options.Also,the f optionmay be specified as the.b \-sflag..+c "CONFIGURATION OPTIONS".ppThe following options may be set using the.b \-oflag on the command lineor the.b Oline in the configuration file:.nr ii 1i.ip A\fIfile\fPUse the named.i fileas the alias file.If no file is specified,use.i aliasesin the current directory..ip aIf set,wait for an.q @:@entry to exist in the alias databasebefore starting up.If it does not appear in five minutes,rebuild the database..ip cIf an outgoing mailer is marked as being expensive,don't connect immediately.This requires that queueing be compiled in,since it will depend on a queue run process toactually send the mail..ip d\fIx\fPDeliver in mode.i x .Legal modes are:.(b.ta 4ni	Deliver interactively (synchronously)b	Deliver in background (asynchronously)q	Just queue the message (deliver during queue run).)b.ip DIf set,rebuild the alias database if necessary and possible.If this option is not set,.i sendmailwill never rebuild the alias databaseunless explicitly requestedusing.b \-bi ..ip e\fIx\fPDispose of errors using mode.i x .The values for.i xare:.(bp	Print error messages (default)q	No messages, just give exit statusm	Mail back errorsw	Write back errors (mail if user not logged in)e	Mail back errors and give ze

⌨️ 快捷键说明

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