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

📄 intro.me

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 ME
📖 第 1 页 / 共 3 页
字号:
but they only effect the error message \*- the.q "return to sender"function is always handled in one of these two ways..)f.sh 2 "Message Header Editing".ppCertain editing of the message headeroccurs automatically.Header lines can be insertedunder control of the configuration file.Some lines can be merged;for example,a.q From:line and a.q Full-name:line can be merged under certain circumstances..sh 2 "Configuration File".ppAlmost all configuration information is read at runtimefrom an ASCII file,encodingmacro definitions(defining the value of macros used internally),header declarations(telling sendmail the format of header lines that it will process specially,i.e., lines that it will add or reformat),mailer definitions(giving information such as the location and characteristicsof each mailer),and address rewriting rules(a limited production system to rewrite addresseswhich is used to parse and rewrite the addresses)..ppTo improve performance when reading the configuration file,a memory image can be provided.This provides a.q compiledform of the configuration file..sh 1 "USAGE AND IMPLEMENTATION".sh 2 "Arguments".ppArguments may be flags and addresses.Flags set various processing options.Following flag arguments,address arguments may be given,unless we are running in SMTP mode.Addresses follow the syntax in RFC822[Crocker82]for ARPANETaddress formats.In brief, the format is:.npAnything in parentheses is thrown away(as a comment)..npAnything in angle brackets (\c.q "<\|>" )is preferredover anything else.This rule implements the ARPANET standard that addresses of the form.(buser name <machine-address>.)bwill send to the electronic.q machine-addressrather than the human.q "user name.".npDouble quotes(\ "\ )quote phrases;backslashes quote characters.Backslashes are more powerfulin that they will cause otherwise equivalent phrasesto compare differently \*- for example,.i userand.i"user".rare equivalent,but.i \euseris different from either of them..ppParentheses, angle brackets, and double quotesmust be properly balanced and nested.The rewriting rules control remaining parsing\**..(f\**Disclaimer: Some special processing is doneafter rewriting local names; see below..)f.sh 2 "Mail to Files and Programs".ppFiles and programs are legitimate message recipients.Files provide archival storage of messages,useful for project administration and history.Programs are useful as recipients in a variety of situations,for example,to maintain a public repository of systems messages(such as the Berkeley.i msgsprogram,or the MARS system[Sattley78])..ppAny address passing through the initial parsing algorithmas a local address(i.e, not appearing to be a valid address for another mailer)is scanned for two special cases.If prefixed by a vertical bar (\c.q \^|\^ )the rest of the address is processed as a shell command.If the user name begins with a slash mark (\c.q /\^ )the name is used as a file name,instead of a login name..ppFiles that have setuid or setgid bits setbut no execute bits sethave those bits honored if.i sendmailis running as root..sh 2 "Aliasing, Forwarding, Inclusion".pp.i Sendmailreroutes mail three ways.Aliasing applies system wide.Forwarding allows each user to reroute incoming maildestined for that account.Inclusion directs.i sendmailto read a file for a list of addresses,and is normally usedin conjunction with aliasing..sh 3 "Aliasing".ppAliasing maps names to address lists using a system-wide file.This file is indexed to speed access.Only names that parse as localare allowed as aliases;this guarantees a unique key(since there are no nicknames for the local host)..sh 3 "Forwarding".ppAfter aliasing,recipients that are local and validare checked for the existence of a.q .forwardfile in their home directory.If it exists,the message is.i notsent to that user,but rather to the list of users in that file.Oftenthis list will contain only one address,and the feature will be used for network mail forwarding..ppForwarding also permits a user to specify a private incoming mailer.For example,forwarding to:.(b"\^|\|/usr/local/newmail myname".)bwill use a different incoming mailer..sh 3 "Inclusion".ppInclusion is specified in RFC 733 [Crocker77a] syntax:.(b:Include: pathname.)bAn address of this form reads the file specified by.i pathnameand sends to all users listed in that file..ppThe intent is.i notto support direct use of this feature,but rather to use this as a subset of aliasing.For example,an alias of the form:.(bproject: :include:/usr/project/userlist.)bis a method of letting a project maintain a mailing listwithout interaction with the system administration,even if the alias file is protected..ppIt is not necessary to rebuild the index on the alias databasewhen a :include: list is changed..sh 2 "Message Collection".ppOnce all recipient addresses are parsed and verified,the message is collected.The message comes in two parts:a message header and a message body,separated by a blank line..ppThe header is formatted as a series of linesof the form.(b	field-name: field-value.)bField-value can be split across lines by starting the followinglines with a space or a tab.Some header fields have special internal meaning,and have appropriate special processing.Other headers are simply passed through.Some header fields may be added automatically,such as time stamps..ppThe body is a series of text lines.It is completely uninterpreted and untouched,except that lines beginning with a dothave the dot doubledwhen transmitted over an SMTP channel.This extra dot is stripped by the receiver..sh 2 "Message Delivery".ppThe send queue is ordered by receiving hostbefore transmissionto implement message batching.Each address is marked as it is sentso rescanning the list is safe.An argument list is built as the scan proceeds.Mail to files is detected during the scan of the send list.The interface to the maileris performed using one of the techniquesdescribed in section 2.2..ppAfter a connection is established,.i sendmailmakes the per-mailer changes to the headerand sends the result to the mailer.If any mail is rejected by the mailer,a flag is set to invoke the return-to-sender functionafter all delivery completes..sh 2 "Queued Messages".ppIf the mailer returns a.q "temporary failure"exit status,the message is queued.A control file is used to describe the recipients to be sent toand various other parameters.This control file is formatted as a series of lines,each describing a sender,a recipient,the time of submission,or some other salient parameter of the message.The header of the message is storedin the control file,so that the associated data file in the queueis just the temporary file that was originally collected..sh 2 "Configuration".ppConfiguration is controlled primarily by a configuration fileread at startup..i Sendmailshould not need to be recomplied except.npTo change operating systems(V6, V7/32V, 4BSD)..npTo remove or insert the DBM(UNIX database)library..npTo change ARPANET reply codes..npTo add headers fields requiring special processing..lpAdding mailers or changing parsing(i.e., rewriting)or routing informationdoes not require recompilation..ppIf the mail is being sent by a local user,and the file.q .mailcfexists in the sender's home directory,that file is read as a configuration fileafter the system configuration file.The primary use of this feature is to add header lines..ppThe configuration file encodes macro definitions,header definitions,mailer definitions,rewriting rules,and options..sh 3 Macros.ppMacros can be used in three ways.Certain macros transmitunstructured textual informationinto the mail system,such as the name.i sendmailwill use to identify itself in error messages.Other macros transmit information from.i sendmailto the configuration filefor use in creating other fields(such as argument vectors to mailers);e.g., the name of the sender,and the host and userof the recipient.Other macros are unused internally,and can be used as shorthand in the configuration file..sh 3 "Header declarations".ppHeader declarations inform.i sendmailof the format of known header lines.Knowledge of a few header linesis built into.i sendmail ,such as the.q From:and.q Date:lines..ppMost configured headerswill be automatically insertedin the outgoing messageif they don't exist in the incoming message.Certain headers are suppressed by some mailers..sh 3 "Mailer declarations".ppMailer declarations tell.i sendmailof the various mailers available to it.The definition specifies the internal name of the mailer,the pathname of the program to call,some flags associated with the mailer,and an argument vector to be used on the call;this vector is macro-expanded before use..sh 3 "Address rewriting rules".ppThe heart of address parsing in.i sendmailis a set of rewriting rules.These are an ordered list of pattern-replacement rules,(somewhat like a production system,except that order is critical),which are applied to each address.The address is rewritten textually until it is either rewritteninto a special canonical form(i.e.,a (mailer, host, user)3-tuple,such as {arpanet, usc-isif, postel}representing the address.q "postel@usc-isif" ),or it falls off the end.When a pattern matches,the rule is reapplied until it fails..ppThe configuration file also supports the editing of addressesinto different formats.For example,an address of the form:.(bucsfcgl!tef.)bmight be mapped into:.(btef@ucsfcgl.UUCP.)bto conform to the domain syntax.Translations can also be done in the other direction..sh 3 "Option setting".ppThere are several options that can be setfrom the configuration file.These include the pathnames of various support files,timeouts,default modes,etc..sh 1 "COMPARISON WITH OTHER MAILERS".sh 2 "Delivermail".pp.i Sendmailis an outgrowth of.i delivermail .The primary differences are:.npConfiguration information is not compiled in.This change simplifies many of the problemsof moving to other machines.It also allows easy debugging of new mailers..npAddress parsing is more flexible.For example,.i delivermailonly supported one gateway to any network,whereas.i sendmailcan be sensitive to host namesand reroute to different gateways..npForwarding and:include:features eliminate the requirement that the system alias filebe writable by any user(or that an update program be written,or that the system administration make all changes)..np.i Sendmailsupports message batching across networkswhen a message is being sent to multiple recipients..npA mail queue is provided in.i sendmail.Mail that cannot be delivered immediatelybut can potentially be delivered lateris stored in this queue for a later retry.The queue also provides a buffer against system crashes;after the message has been collectedit may be reliably redeliveredeven if the system crashes during the initial delivery..np.i Sendmailuses the networking support provided by 4.2BSDto provide a direct interface networks such as the ARPANETand/or Ethernetusing SMTP (the Simple Mail Transfer Protocol)over a TCP/IP connection..sh 2 "MMDF".ppMMDF[Crocker79]spans a wider problem set than.i sendmail .For example,the domain ofMMDF includes a.q "phone network"mailer, whereas.i sendmailcalls on preexisting mailers in most cases..ppMMDF and.i sendmailboth support aliasing,customized mailers,message batching,automatic forwarding to gateways,queueing,and retransmission.MMDF supports two-stage timeout,which.i sendmaildoes not support..ppThe configuration for MMDFis compiled into the code\**..(f\**Dynamic configuration tables are currently being consideredfor MMDF;allowing the installer to select either compiledor dynamic tables..)f.ppSince MMDF does not consider backwards compatibilityas a design goal,the address parsing is simpler but much less flexible.

⌨️ 快捷键说明

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