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

📄 intro.me

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 ME
📖 第 1 页 / 共 3 页
字号:
.nr DR 1	\" this is a draft copy.nr si 3n.he 'SENDMAIL''%'.fo 'Version 4.1'DRAFT'Last Mod 7/25/83'.if n .ls 2.+c.(l C.sz 14SENDMAIL \*- An Internetwork Mail Router.sz.spEric Allman\(dg.sp 0.5.iBritton-Lee, Inc.1919 Addison Street, Suite 105.Berkeley, California 94704..)l.sp.(l F.ceABSTRACT.sp \n(psuRouting mail through a heterogenous internet presents many newproblems.  Among the worst of these is that of address mapping.Historically, this has been handled on an.i "ad hoc"basis.  However,this approach has become unmanageable as internets grow..sp \n(psuSendmail acts a unified "post office" to which all mail can besubmitted.  Address interpretation is controlled by a productionsystem, which can parse both domain-based addressing and old-style.i "ad hoc"addresses.The production system is powerfulenough to rewrite addresses in the message header to conform to thestandards of a number of common target networks, including old(NCP/RFC733) Arpanet, new (TCP/RFC822) Arpanet, UUCP, and Phonenet.Sendmail also implements an SMTP server, messagequeueing, and aliasing..)l.sp 2.(f\(dgA considerable part of this workwas done while under the employof the INGRES Projectat the University of California at Berkeley..)f.pp.i Sendmailimplements a general internetwork mail routing facility,featuring aliasing and forwarding,automatic routing to network gateways,and flexible configuration..ppIn a simple network,each node has an address,and resources can be identifiedwith a host-resource pair;in particular,the mail system can refer to usersusing a host-username pair.Host names and numbers have to be administered by a central authority,but usernames can be assigned locally to each host..ppIn an internet,multiple networks with different charactersticsand managementsmust communicate.In particular,the syntax and semantics of resource identification change.Certain special cases can be handled triviallyby.i "ad hoc"techniques,such asproviding network names that appear local to hostson other networks,as with the Ethernet at Xerox PARC.However,  the general case is extremely complex.For example,some networks require point-to-point routing,which simplifies the database update problemsince only adjacent hosts must be enteredinto the system tables,while others use end-to-end addressing.Some networks use a left-associative syntaxand others use a right-associative syntax,causing ambiguity in mixed addresses..ppInternet standards seek to eliminate these problems.Initially, these proposed expanding the address pairsto address triples,consisting of{network, host, resource}triples.Network numbers must be universally agreed upon,and hosts can be assigned locallyon each network.The user-level presentation was quickly expandedto address domains,comprised of a local resource identificationand a hierarchical domain specificationwith a common static root.The domain techniqueseparates the issue of physical versus logical addressing.For example,an address of the form.q "eric@a.cc.berkeley.arpa"describes only the logicalorganization of the address space..pp.i Sendmailis intended to help bridge the gapbetween the totally.i "ad hoc"worldof networks that know nothing of each otherand the clean, tightly-coupled worldof unique network numbers.It can accept old arbitrary address syntaxes,resolving ambiguities using heuristicsspecified by the system administrator,as well as domain-based addressing.It helps guide the conversion of message formatsbetween disparate networks.In short,.i sendmailis designed to assist a graceful transitionto consistent internetwork addressing schemes..sp.ppSection 1 discusses the design goals for.i sendmail .Section 2 gives an overview of the basic functions of the system.In section 3,details of usage are discussed.Section 4 compares.i sendmailto other internet mail routers,and an evaluation of.i sendmailis given in section 5,including future plans..sh 1 "DESIGN GOALS".ppDesign goals for.i sendmailinclude:.npCompatibility with the existing mail programs,including Bell version 6 mail,Bell version 7 mail[UNIX83],Berkeley.i Mail[Shoens79],BerkNet mail[Schmidt79],and hopefully UUCP mail[Nowitz78a, Nowitz78b].ARPANET mail[Crocker77a, Postel77]was also required..npReliability, in the sense of guaranteeingthat every message is correctly deliveredor at least brought to the attention of a humanfor correct disposal;no message should ever be completely lost.This goal was considered essentialbecause of the emphasis on mail in our environment.It has turned out to be one of the hardest goals to satisfy,especially in the face of the many anomalous message formatsproduced by various ARPANET sites.For example,certain sites generate improperly formated addresses,occasionallycausing error-message loops.Some hosts use blanks in names,causing problems withUNIX mail programs that assume that an addressis one word.The semantics of some fieldsare interpreted slightly differentlyby different sites.In summary,the obscure features of the ARPANET mail protocolreally.i areused andare difficult to support,but must be supported..npExisting software to do actual deliveryshould be used whenever possible.This goal derives as much from political and practical considerationsas technical..npEasy expansion tofairly complex environments,including multipleconnections to a single network type(such as with multiple UUCP or Ether nets[Metcalfe76]).This goal requires consideration of the contents of an addressas well as its syntaxin order to determine which gateway to use.For example,the ARPANET is bringing up theTCP protocol to replace the old NCP protocol.No host at Berkeley runs both TCP and NCP,so it is necessary to look at the ARPANET host nameto determine whether to route mail to an NCP gatewayor a TCP gateway..npConfiguration should not be compiled into the code.A single compiled program should be able to run as is at any site(barring such basic changes as the CPU type or the operating system).We have found this seemingly unimportant goalto be critical in real life.Besides the simple problems that occur when any program gets recompiledin a different environment,many sites like to.q fiddlewith anything that they will be recompiling anyway..np.i Sendmailmust be able to let various groups maintain their own mailing lists,and let individuals specify their own forwarding,without modifying the system alias file..npEach user should be able to specify which mailer to executeto process mail being delivered for him.This feature allows users who are using specialized mailersthat use a different format to build their environmentwithout changing the system,and facilitates specialized functions(such as returning an.q "I am on vacation"message)..npNetwork traffic should be minimizedby batching addresses to a single host where possible,without assistance from the user..ppThese goals motivated the architecture illustrated in figure 1..(z.hl.ie t \.	sp 18.el \{\.(c+---------+   +---------+   +---------+| sender1 |   | sender2 |   | sender3 |+---------+   +---------+   +---------+     |  	   |             |     +----------+  +  +----------+		|  |  |		v  v  v            +-------------+            |   sendmail  |            +-------------+		|  |  |     +----------+  +  +----------+     |  	   |             |     v             v             v+---------+   +---------+   +---------+| mailer1 |   | mailer2 |   | mailer3 |+---------+   +---------+   +---------+.)c.\}.ceFigure 1 \*- Sendmail System Structure..hl.)zThe user interacts with a mail generating and sending program.When the mail is created,the generator calls.i sendmail ,which routes the message to the correct mailer(s).Since some of the senders may be network serversand some of the mailers may be network clients,.i sendmailmay be used as an internet mail gateway..sh 1 "OVERVIEW".sh 2 "System Organization".pp.i Sendmailneither interfaces with the usernor does actual mail delivery.Rather,it collects a messagegenerated by a user interface program (UIP)such as Berkeley.i Mail ,MS[Crocker77b],or MH[Borden79],edits the message as required by the destination network,and calls appropriate mailersto do mail delivery or queueing for network transmission\**..(f\**except when mailing to a file,when.i sendmaildoes the delivery directly..)fThis discipline allows the insertion of new mailersat minimum cost.In this sense .i sendmailresembles the Message Processing Module (MPM)of [Postel79b]..sh 2 "Interfaces to the Outside World".ppThere are three ways.i sendmailcan communicate with the outside world,both in receiving and in sending mail.These are using the conventional UNIXargument vector/return status,speaking SMTP over a pair of UNIX pipes,and speaking SMTP over an interprocess(or) channel..sh 3 "Argument vector/exit status".ppThis technique is the standard UNIX methodfor communicating with the process.A list of recipients is sent in the argument vector,and the message body is sent on the standard input.Anything that the mailer printsis simply collected and sent back to the senderif there were any problems.The exit status from the mailer is collectedafter the message is sent,and a diagnostic is printed if appropriate..sh 3 "SMTP over pipes".ppThe SMTP protocol[Postel82]can be used to run an interactive lock-step interfacewith the mailer.A subprocess is still created,but no recipient addresses are passed to the mailervia the argument list.Instead, they are passed one at a timein commands sent to the processes standard input.Anything appearing on the standard outputmust be a reply codein a special format..sh 3 "SMTP over an IPC connection".ppThis technique is similar to the previous technique,except that it uses a 4.2bsd IPC channel[UNIX83].This method is exceptionally flexiblein that the mailer need not resideon the same machine.It is normally used to connect to a sendmail processon another machine..sh 2 "Operational Description".ppWhen a sender wants to send a message,it issues a request to.i sendmailusing one of the three methods described above..i Sendmailoperates in two distinct phases.In the first phase,it collects and stores the message.In the second phase,message delivery occurs.If there were errors during processingduring the second phase,.i sendmailcreates and returns a new message describing the errorand/or returns an status codetelling what went wrong..sh 3 "Argument processing and address parsing".ppIf.i sendmailis called using one of the two subprocess techniques,the argumentsare first scannedand option specifications are processed.Recipient addresses are then collected,either from the command lineor from the SMTPRCPT command,and a list of recipients is created.Aliases are expanded at this step,including mailing lists.As much validation as possible of the addressesis done at this step:syntax is checked, and local addresses are verified,but detailed checking of host names and addressesis deferred until delivery.Forwarding is also performedas the local addresses are verified..pp.i Sendmailappends each addressto the recipient list after parsing.When a name is aliased or forwarded,the old name is retained in the list,and a flag is set that tells the delivery phaseto ignore this recipient.This list is kept free from duplicates,preventing alias loopsand duplicate messages deliverd to the same recipient,as might occur if a person is in two groups..sh 3 "Message collection".pp.i Sendmailthen collects the message.The message should have a header at the beginning.No formatting requirements are imposed on the messageexcept that they must be lines of text(i.e., binary data is not allowed).The header is parsed and stored in memory,and the body of the message is savedin a temporary file..ppTo simplify the program interface,the message is collected even if no addresses were valid.The message will be returned with an error..sh 3 "Message delivery".ppFor each unique mailer and host in the recipient list,.i sendmailcalls the appropriate mailer.Each mailer invocation sends to all users receiving the message on one host.Mailers that only accept one recipient at a timeare handled properly..ppThe message is sent to the mailerusing one of the same three interfacesused to submit a message to sendmail.Each copy of the message isprepended by a customized header.The mailer status code is caught and checked,and a suitable error message given as appropriate.The exit code must conform to a system standardor a generic message(\c.q "Service unavailable" )is given..sh 3 "Queueing for retransmission".ppIf the mailer returned an status thatindicated that it might be able to handle the mail later,.i sendmailwill queue the mail and try again later..sh 3 "Return to sender".ppIf errors occur during processing,.i sendmailreturns the message to the sender for retransmission.The letter can be mailed backor written in the file.q dead.letterin the sender's home directory\**..(f\**Obviously, if the site giving the error is not the originatingsite, the only reasonable option is to mail back to the sender.Also, there are many more error disposition options,

⌨️ 快捷键说明

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