op.me

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

ME
2,890
字号
.i sendmailcan operate in,set by the.q dconfiguration option.These modesspecify how quickly mail will be delivered.Legal modes are:.(b.ta 4ni	deliver interactively (synchronously)b	deliver in background (asynchronously)q	queue only (don't deliver).)bThere are tradeoffs.Mode.q ipasses the maximum amount of information to the sender,but is hardly ever necessary.Mode.q qputs the minimum load on your machine,but means that delivery may be delayed for up to the queue interval.Mode.q bis probably a good compromise.However, this mode can cause large numbers of processesif you have a mailer that takes a long time to deliver a message..sh 2 "Log Level".ppThe level of logging can be set for sendmail.The default using a standard configuration table is level 9.The levels are as follows:.ip 0No logging..ip 1Major problems only..ip 2Message collections and failed deliveries..ip 3Successful deliveries..ip 4Messages being defered(due to a host being down, etc.)..ip 5Normal message queueups..ip 6Unusual but benign incidents,e.g.,trying to process a locked queue file..ip 9Log internal queue id to external message id mappings.This can be useful for tracing a messageas it travels between several hosts..ip 12Several messages that are basically only of interestwhen debugging..ip 16Verbose information regarding the queue..sh 2 "File Modes".ppThere are a number of filesthat may have a number of modes.The modes depend on what functionality you wantand the level of security you require..sh 3 "To suid or not to suid?".pp.i Sendmailcan safely be madesetuid to root.At the point where it is about to.i exec \|(2)a mailer,it checks to see if the userid is zero;if so,it resets the userid and groupid to a default(set by the.b uand.b goptions).(This can be overriddenby setting the.b Sflag to the mailerfor mailers that are trustedand must be called as root.)However,this will cause mail processingto be accounted(using.i sa \|(8))to rootrather than to the user sending the mail..sh 3 "Temporary file modes".ppThe mode of all temporary files that.i sendmailcreates is determined by the.q Foption.Reasonable values for this option are0600and0644.If the more permissive mode is selected,it will not be necessary to run.i sendmailas root at all(even when running the queue)..sh 3 "Should my alias database be writable?".ppAt Berkeleywe have the alias database(/usr/lib/aliases*)mode 666.There are some dangers inherent in this approach:any user can add him-/her-selfto any list,or can.q stealany other user's mail.However,we have found users to be basically trustworthy,and the cost of having a read-only databasegreater than the expense of finding and eradicatingthe rare nasty person..ppThe database that.i sendmailactually usedis represented by the two files.i aliases.dirand.i aliases.pag(both in /usr/lib).The mode on these files should match the modeon /usr/lib/aliases.If.i aliasesis writableand theDBMfiles(\c.i aliases.dirand.i aliases.pag )are not,users will be unable to reflect their desired changesthrough to the actual database.However,if.i aliasesis read-onlyand the DBM files are writable,a slightly sophisticated usercan arrange to steal mail anyway..ppIf your DBM files are not writable by the worldor you do not have auto-rebuild enabled(with the.q Doption),then you must be careful to reconstruct the alias databaseeach time you change the text version:.(bnewaliases.)bIf this step is ignored or forgottenany intended changes will also be ignored or forgotten..sh 1 "THE WHOLE SCOOP ON THE CONFIGURATION FILE".ppThis section describes the configuration filein detail,including hints on how to write one of your ownif you have to..ppThere is one point that should be made clear immediately:the syntax of the configuration fileis designed to be reasonably easy to parse,since this is done every time.i sendmailstarts up,rather than easy for a human to read or write.On the.q "future project"list is aconfiguration-file compiler..ppAn overview of the configuration fileis given first,followed by details of the semantics..sh 2 "The Syntax".ppThe configuration file is organized as a series of lines,each of which begins with a single characterdefining the semantics for the rest of the line.Lines beginning with a space or a tabare continuation lines(although the semantics are not well defined in many places).Blank lines and lines beginning with a sharp symbol(`#')are comments..sh 3 "R and S \*- rewriting rules".ppThe core of address parsingare the rewriting rules.These are an ordered production system..i Sendmailscans through the set of rewriting ruleslooking for a match on the left hand side(LHS)of the rule.When a rule matches,the address is replaced by the right hand side(RHS)of the rule..ppThere are several sets of rewriting rules.Some of the rewriting sets are used internallyand must have specific semantics.Other rewriting setsdo not have specifically assigned semantics,and may be referenced by the mailer definitionsor by other rewriting sets..ppThe syntax of these two commands are:.(b F.b S \c.i n.)bSets the current ruleset being collected to.i n .If you begin a ruleset more than onceit deletes the old definition..(b F.b R \c.i lhs.i rhs.i comments.)bThefields must be separatedby at least one tab character;there may be embedded spacesin the fields.The.i lhsis a pattern that is applied to the input.If it matches,the input is rewritten to the.i rhs .The.i commentsare ignored..sh 3 "D \*- define macro".ppMacros are named with a single character.These may be selected from the entire ASCII set,but user-defined macrosshould be selected from the set of upper case letters only.Lower case lettersand special symbolsare used internally..ppThe syntax for macro definitions is:.(b F.b D \c.i x\|val.)bwhere.i xis the name of the macroand.i valis the value it should have.Macros can be interpolated in most places using the escape sequence.b $ \c.i x ..sh 3 "C and F \*- define classes".ppClasses of words may be definedto match on the left hand side of rewriting rules.For examplea class of all local names for this sitemight be createdso that attempts to send to oneselfcan be eliminated.These can either be defined directly in the configuration fileor read in from another file.Classes may be given namesfrom the set of upper case letters.Lower case letters and special charactersare reserved for system use..ppThe syntax is:.(b F.b C \c.i c\|word1.i word2....br.b F \c.i c\|file[.i format].)bThe first form defines the class.i cto match any of the named words.It is permissible to split them among multiple lines;for example, the two forms:.(bCHmonet ucbmonet.)band.(bCHmonetCHucbmonet.)bare equivalent.The second formreads the elements of the class.i cfrom the named.i file ;the.i formatis a.i scanf \|(3)patternthat should produce a single string..sh 3 "M \*- define mailer".ppPrograms and interfaces to mailersare defined in this line.The format is:.(b F.b M \c.i name ,{\c.i field =\c.i value \|}*.)bwhere.i nameis the name of the mailer(used internally only)and the.q field=namepairs define attributes of the mailer.Fields are:.(b.ta 1iPath	The pathname of the mailerFlags	Special flags for this mailerSender	A rewriting set for sender addressesRecipient	A rewriting set for recipient addressesArgv	An argument vector to pass to this mailerEol	The end-of-line string for this mailerMaxsize	The maximum message length to this mailer.)bOnly the first character of the field name is checked..sh 3 "H \*- define header".ppThe format of the header lines that sendmail inserts into the messageare defined by the.b Hline.The syntax of this line is:.(b F.b H [\c.b ? \c.i mflags \c.b ? ]\c.i hname \c.b :.i htemplate.)bContinuation lines in this specare reflected directly into the outgoing message.The.i htemplateis macro expanded before insertion into the message.If the.i mflags(surrounded by question marks)are specified,at least one of the specified flagsmust be stated in the mailer definitionfor this header to be automatically output.If one of these headers is in the inputit is reflected to the outputregardless of these flags..ppSome headers have special semanticsthat will be described below..sh 3 "O \*- set option".ppThere are a number of.q randomoptions thatcan be set from a configuration file.Options are represented by single characters.The syntax of this line is:.(b F.b O \c.i o\|value.)bThis sets option.i oto be.i value .Depending on the option,.i valuemay be a string, an integer,a boolean(with legal values.q t ,.q T ,.q f ,or.q F ;the default is TRUE),ora time interval..sh 3 "T \*- define trusted users".ppTrusted usersare those users who are permittedto override the sender addressusing the.b \-fflag.These typically are.q root,.q uucp,and.q network,but on some users it may be convenientto extend this list to include other users,perhaps to supporta separateUUCPlogin for each host.The syntax of this line is:.(b F.b T \c.i user1.i user2 ....)bThere may be more than one of these lines..sh 3 "P \*- precedence definitions".ppValues for the.q "Precedence:"field may be defined using the.b Pcontrol line.The syntax of this field is:.(b\fBP\fP\fIname\fP\fB=\fP\fInum\fP.)bWhen the.i nameis found in a.q Precedence:field,the message class is set to.i num .Higher numbers mean higher precedence.Numbers less than zerohave the special propertythat error messages will not be returned.The default precedence is zero.For example,our list of precedences is:.(bPfirst-class=0Pspecial-delivery=100Pjunk=\-100.)b.sh 2 "The Semantics".ppThis section describes the semantics of the configuration file..sh 3 "Special macros, conditionals".ppMacros are interpolatedusing the construct.b $ \c.i x ,where.i xis the name of the macro to be interpolated.In particular,lower case letters are reserved to havespecial semantics,used to pass information in or out of sendmail,and some special characters are reserved toprovide conditionals, etc..ppThe following macros.i mustbe defined to transmit information into.i sendmail:.(b.ta 4ne	The SMTP entry messagej	The \*(lqofficial\*(rq domain name for this sitel	The format of the UNIX from linen	The name of the daemon (for error messages)o	The set of "operators" in addressesq	default format of sender address.)bThe.b $emacro is printed out when SMTP starts up.The first word must be the.b $jmacro.The.b $jmacroshould be in RFC821 format.The.b $land.b $nmacros can be considered constantsexcept under terribly unusual circumstances.The.b $omacro consists of a list of characterswhich will be considered tokensand which will separate tokenswhen doing parsing.For example, if.q rwere in the.b $omacro, then the input.q addresswould be scanned as three tokens:.q add,.q r,and.q ess.Finally, the.b $qmacro specifies how an address should appear in a messagewhen it is defaulted.For example, on our system these definitions are:.(bDe$j Sendmail $v ready at $bDnMAILER-DAEMONDlFrom $g  $dDo.:%@!^=/Dq$g$?x ($x)$.Dj$H.$D.)bAn acceptable alternative for the.b $qmacro is.q "$?x$x $.<$g>" .These correspond to the following two formats:.(beric@Berkeley (Eric Allman)Eric Allman <eric@Berkeley>.)b.ppSome macros are defined by.i sendmailfor interpolation into argv's for mailersor for other contexts.These macros are:.(ba	The origination date in Arpanet format

⌨️ 快捷键说明

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