1.nr DR 1 \" this is a draft copy 2.nr si 3n 3.he 'SENDMAIL''%' 4.fo 'Version 3.23'DRAFT'Last Mod 11/14/82' 5.ls 2 6.+c 7.(l C 8.sz 14 9SENDMAIL \*- An Internetwork Mail Router 10.sz 11.sp 12Eric Allman\(dg 13.sp 0.5 14.i 15Britton-Lee, Inc. 161919 Addison Street, Suite 105. 17Berkeley, California 94704. 18.)l 19.sp 20.(l F 21.ce 22ABSTRACT 23.sp \n(psu 24Routing mail through a heterogenous internet presents many new 25problems. Among the worst of these is that of address mapping. 26Historically, this has been handled on an 27.i "ad hoc" 28basis. However, 29this approach has become unmanageable as internets grow. 30.sp \n(psu 31Sendmail acts a unified "post office" to which all mail can be 32submitted. Address interpretation is controlled by a production 33system, which can parse both domain-based addressing and old-style 34.i "ad hoc" 35addresses. 36The production system is powerful 37enough to rewrite addresses in the message header to conform to the 38standards of a number of common target networks, including old 39(NCP/RFC733) Arpanet, new (TCP/RFC822) Arpanet, UUCP, and Phonenet. 40Sendmail also implements an SMTP server, message 41queueing, and aliasing. 42.)l 43.sp 2 44.(f 45\(dgA considerable part of this work 46was done while under the employ 47of the INGRES Project 48at the University of California at Berkeley. 49.)f 50.pp 51.i Sendmail 52implements a general internetwork mail routing facility, 53featuring aliasing and forwarding, 54automatic routing to network gateways, 55and flexible configuration. 56.pp 57In a simple network, 58each node has an address, 59and resources can be identified 60with a host-resource pair; 61in particular, 62the mail system can refer to users 63using a host-username pair. 64Host names and numbers have to be administered by a central authority, 65but usernames can be assigned locally to each host. 66.pp 67In an internet, 68multiple networks with different characterstics 69and managements 70must communicate. 71In particular, 72the syntax and semantics of resource identification change. 73Certain special cases can be handled trivially 74by 75.i "ad hoc" 76techniques, 77such as 78providing network names that appear local to hosts 79on other networks, 80as with the Ethernet at Xerox PARC [ref?]. 81However, the general case is extremely complex. 82For example, 83some networks require point-to-point routing, 84which simplifies the database update problem 85since only adjacent hosts must be entered 86into the system tables, 87while others use end-to-end addressing. 88Some networks use a left-associative syntax 89and others use a right-associative syntax, 90causing ambiguity in mixed addresses. 91.pp 92Internet standards seek to eliminate these problems. 93Initially, these proposed expanding the address pairs 94to address triples, 95consisting of 96{network, host, resource} 97triples. 98Network numbers must be universally agreed upon, 99and hosts can be assigned locally 100on each network. 101The user-level presentation was quickly expanded 102to address domains, 103comprised of a local resource identification 104and a hierarchical domain specification 105with a common static root. 106The domain technique 107separates the issue of physical versus logical addressing. 108For example, 109an address of the form 110.q "eric@a.cc.berkeley.arpa" 111describes only the logical 112organization of the address space. 113.pp 114.i Sendmail 115is intended to help bridge the gap 116between the totally 117.i "ad hoc" 118world 119of networks that know nothing of each other 120and the clean, tightly-coupled world 121of unique network numbers. 122It can accept old arbitrary address syntaxes, 123resolving ambiguities using heuristics 124specified by the system administrator, 125as well as domain-based addressing. 126It helps guide the conversion of message formats 127between disparate networks. 128In short, 129.i sendmail 130is designed to assist a graceful transition 131to consistent internetwork addressing schemes. 132.sp 133.pp 134Section 1 discusses the design goals for 135.i sendmail . 136Section 2 gives an overview of the basic functions of the system. 137In section 3, 138details of usage are discussed. 139Section 4 compares 140.i sendmail 141to other internet mail routers, 142and an evaluation of 143.i sendmail 144is given in section 5, 145including future plans. 146.sh 1 "DESIGN GOALS" 147.pp 148Design goals for 149.i sendmail 150include: 151.np 152Compatibility with the existing mail programs, 153including Bell version 6 mail, 154Bell version 7 mail 155[UNIX80], 156Berkeley 157.i Mail 158[Shoens79], 159BerkNet mail 160[Schmidt79], 161and hopefully UUCP mail 162[Nowitz78a, Nowitz78b]. 163ARPANET mail 164[Crocker77a, Postel77] 165was also required. 166.np 167Reliability, in the sense of guaranteeing 168that every message is correctly delivered 169or at least brought to the attention of a human 170for correct disposal; 171no message should ever be completely lost. 172This goal was considered essential 173because of the emphasis on mail in our environment. 174It has turned out to be one of the hardest goals to satisfy, 175especially in the face of the many anomalous message formats 176produced by various ARPANET sites. 177For example, 178certain sites generate improperly formated addresses, 179occasionally 180causing error-message loops. 181Some hosts use blanks in names, 182causing problems with 183UNIX mail programs that assume that an address 184is one word. 185The semantics of some fields 186are interpreted slightly differently 187by different sites. 188In summary, 189the obscure features of the ARPANET mail protocol 190really 191.i are 192used and 193are difficult to support, 194but must be supported. 195Even obeying the standard is insufficient. 196For example, 197Wharton changed our host name from 198.q BERKELEY 199to 200.q BERKEL- , 201which confused error processing. 202Cases such as this 203must be handled gracefully. 204.np 205Existing software to do actual delivery 206should be used whenever possible. 207This goal derives as much from political and practical considerations 208as technical. 209.np 210Easy expansion to 211fairly complex environments, 212including multiple 213connections to a single network type 214(such as with multiple UUCP or Ether nets 215[Metcalfe76]). 216This goal requires consideration of the contents of an address 217as well as its syntax 218in order to determine which gateway to use. 219For example, 220the ARPANET is bringing up the 221TCP protocol to replace the old NCP protocol. 222No host at Berkeley runs both TCP and NCP, 223so it is necessary to look at the ARPANET host name 224to determine whether to route mail to an NCP gateway 225or a TCP gateway. 226.np 227Configuration should not be compiled into the code. 228A single compiled program should be able to run as is at any site 229(barring such basic changes as the CPU type or the operating system). 230We have found this seemingly unimportant goal 231to be critical in real life. 232Besides the simple problems that occur when any program gets recompiled 233in a different environment, 234many sites like to 235.q fiddle 236with anything that they will be recompiling anyway. 237.np 238.i Sendmail 239must be able to let various groups maintain their own mailing lists, 240and let individuals specify their own forwarding, 241without modifying the system alias file. 242.np 243Each user should be able to specify which mailer to execute 244to process mail being delivered for him. 245This feature allows users who are using specialized mailers 246that use a different format to build their environment 247without changing the system, 248and facilitates specialized functions 249(such as returning an 250.q "I am on vacation" 251message). 252.np 253Network traffic should be minimized 254by batching addresses to a single host where possible, 255without assistance from the user. 256.pp 257These goals motivated the architecture illustrated in figure 1. 258.(z 259.hl 260.ie t \ 261. sp 18 262.el \{\ 263.(c 264+---------+ +---------+ +---------+ 265| sender1 | | sender2 | | sender3 | 266+---------+ +---------+ +---------+ 267 | | | 268 +----------+ + +----------+ 269 | | | 270 v v v 271 +-------------+ 272 | sendmail | 273 +-------------+ 274 | | | 275 +----------+ + +----------+ 276 | | | 277 v v v 278+---------+ +---------+ +---------+ 279| mailer1 | | mailer2 | | mailer3 | 280+---------+ +---------+ +---------+ 281.)c 282.\} 283 284.ce 285Figure 1 \*- Sendmail System Structure. 286.hl 287.)z 288The user interacts with a mail generating and sending program. 289When the mail is created, 290the generator calls 291.i sendmail , 292which routes the message to the correct mailer(s). 293Since some of the senders may be network servers 294and some of the mailers may be network clients, 295.i sendmail 296may be used as an internet mail gateway. 297.sh 1 "OVERVIEW" 298.sh 2 "System Organization" 299.pp 300.i Sendmail 301neither interfaces with the user 302nor does actual mail delivery. 303Rather, 304it collects a message 305generated by a user interface program (UIP) 306such as Berkeley 307.i Mail , 308MS 309[Crocker77b], 310or MH 311[Borden79], 312edits the message as required by the destination network, 313and calls appropriate mailers 314to do mail delivery or queueing for network transmission\**. 315.(f 316\**except when mailing to a file, 317when 318.i sendmail 319does the delivery directly. 320.)f 321This discipline allows the insertion of new mailers 322at minimum cost. 323In this sense 324.i sendmail 325resembles the Message Processing Module (MPM) 326of [Postel79b]. 327.sh 2 "Interfaces to the Outside World" 328.pp 329There are three ways 330.i sendmail 331can communicate with the outside world, 332both in receiving and in sending mail. 333These are using the conventional UNIX 334argument vector/return status, 335speaking SMTP over a pair of UNIX pipes, 336and speaking SMTP over an interprocess(or) channel. 337.sh 3 "Argument vector/exit status" 338.pp 339This technique is the standard UNIX method 340for communicating with the process. 341A list of recipients is sent in the argument vector, 342and the message body is sent on the standard input. 343Anything that the mailer prints 344is simply collected and sent back to the sender 345if there were any problems. 346The exit status from the mailer is collected 347after the message is sent, 348and a diagnostic is printed if appropriate. 349.sh 3 "SMTP over pipes" 350.pp 351The SMTP protocol 352[Postel82] 353can be used to run an interactive lock-step interface 354with the mailer. 355A subprocess is still created, 356but no recipient addresses are passed to the mailer 357via the argument list. 358Instead, they are passed one at a time 359in commands sent to the processes standard input. 360Anything appearing on the standard output 361must be a reply code 362in a special format. 363.sh 3 "SMTP over an IPC connection" 364.pp 365This technique is similar to the previous technique, 366except that it uses a 4.2bsd IPC channel 367[ref?]. 368This method is exceptionally flexible 369in that the mailer need not reside 370on the same machine. 371It is normally used to connect to a sendmail process 372on another machine. 373.sh 2 "Operational Description" 374.pp 375When a sender wants to send a message, 376it issues a request to 377.i sendmail 378using one of the three methods described above. 379.i Sendmail 380operates in two distinct phases. 381In the first phase, 382it collects and stores the message. 383In the second phase, 384message delivery occurs. 385If there were errors during processing 386during the second phase, 387.i sendmail 388creates and returns a new message describing the error 389and/or returns an status code 390telling what went wrong. 391.sh 3 "Argument processing and address parsing" 392.pp 393If 394.i sendmail 395is called using one of the two subprocess techniques, 396the arguments 397are first scanned 398and option specifications are processed. 399Recipient addresses are then collected, 400either from the command line 401or from the SMTP 402RCPT command, 403and a list of recipients is created. 404Aliases are expanded at this step, 405including mailing lists. 406As much validation as possible of the addresses 407is done at this step: 408syntax is checked, and local addresses are verified, 409but detailed checking of host names and addresses 410is deferred until delivery. 411Forwarding is also performed 412as the local addresses are verified. 413.pp 414.i Sendmail 415appends each address 416to the recipient list after parsing. 417When a name is aliased or forwarded, 418the old name is retained in the list, 419and a flag is set that tells the delivery phase 420to ignore this recipient. 421This list is kept free from duplicates, 422preventing alias loops 423and duplicate messages deliverd to the same recipient, 424as might occur if a person is in two groups. 425.sh 3 "Message collection" 426.pp 427.i Sendmail 428then collects the message. 429The message should have a header at the beginning. 430No formatting requirements are imposed on the message 431except that they must be lines of text 432(i.e., binary data is not allowed). 433The header is parsed and stored in memory, 434and the body of the message is saved 435in a temporary file. 436.pp 437To simplify the program interface, 438the message is collected even if no addresses were valid. 439The message will be returned with an error. 440.sh 3 "Message delivery" 441.pp 442For each unique mailer and host in the recipient list, 443.i sendmail 444calls the appropriate mailer. 445Each mailer invocation sends to all users receiving the message on one host. 446Mailers that only accept one recipient at a time 447are handled properly. 448.pp 449The message is sent to the mailer 450using one of the same three interfaces 451used to submit a message to sendmail. 452Each copy of the message is 453prepended by a customized header. 454The mailer status code is caught and checked, 455and a suitable error message given as appropriate. 456The exit code must conform to a system standard 457or a generic message 458(\c 459.q "Service unavailable" ) 460is given. 461.sh 3 "Queueing for retransmission" 462.pp 463If the mailer returned an status that 464indicated that it might be able to handle the mail later, 465.i sendmail 466will queue the mail and try again later. 467.sh 3 "Return to sender" 468.pp 469If errors occur during processing, 470.i sendmail 471returns the message to the sender for retransmission. 472The letter can be mailed back 473or written in the file 474.q dead.letter 475in the sender's home directory\**. 476.(f 477\**Obviously, if the site giving the error is not the originating 478site, the only reasonable option is to mail back to the sender. 479Also, there are many more error disposition options, 480but they only effect the error message \*- the 481.q "return to sender" 482function is always handled in one of these two ways. 483.)f 484.sh 2 "Message Header Editing" 485.pp 486Certain editing of the message header 487occurs automatically. 488Header lines can be inserted 489under control of the configuration file. 490Some lines can be merged; 491for example, 492a 493.q From: 494line and a 495.q Full-name: 496line can be merged under certain circumstances. 497.sh 2 "Configuration File" 498.pp 499Almost all configuration information is read at runtime 500from an ASCII file, 501encoding 502macro definitions 503(defining the value of macros used internally), 504header declarations 505(telling sendmail the format of header lines that it will process specially, 506i.e., lines that it will add or reformat), 507mailer definitions 508(giving information such as the location and characteristics 509of each mailer), 510and address rewriting rules 511(a limited production system to rewrite addresses 512which is used to parse and rewrite the addresses). 513.sh 1 "USAGE AND IMPLEMENTATION" 514.sh 2 "Arguments" 515.pp 516Arguments may be flags and addresses. 517Flags set various processing options. 518Following flag arguments, 519address arguments may be given, 520unless we are running in SMTP mode. 521Addresses follow the syntax in RFC822 522[Crocker82] 523for ARPANET 524address formats. 525In brief, the format is: 526.np 527Anything in parentheses is thrown away 528(as a comment). 529.np 530Anything in angle brackets (\c 531.q "<>" ) 532is preferred 533over anything else. 534This rule implements the ARPANET standard that addresses of the form 535.(b 536user name <machine-address> 537.)b 538will send to the electronic 539.q machine-address 540rather than the human 541.q "user name." 542.np 543Double quotes 544(\ "\ ) 545quote phrases; 546backslashes quote characters. 547Backslashes are more powerful 548in that they will cause otherwise equivalent phrases 549to compare differently \*- for example, 550.i user 551and 552.i 553"user" 554.r 555are equivalent, 556but 557.i \euser 558is different from either of them. 559.pp 560Parentheses, angle brackets, and double quotes 561must be properly balanced and nested. 562The rewriting rules control remaining parsing\**. 563.(f 564\**Disclaimer: Some special processing is done 565after rewriting local names; see below. 566.)f 567.sh 2 "Mail to Files and Programs" 568.pp 569Files and programs are legitimate message recipients. 570Files provide archival storage of messages, 571useful for project administration and history. 572Programs are useful as recipients in a variety of situations, 573for example, 574to maintain a public repository of systems messages 575(such as the Berkeley 576.i msgs 577program, 578or the MARS system 579[Sattley78]). 580.pp 581Any address passing through the initial parsing algorithm 582as a local address 583(i.e, not appearing to be a valid address for another mailer) 584is scanned for two special cases. 585If prefixed by a vertical bar (\c 586.q \^|\^ ) 587the rest of the address is processed as a shell command. 588If the user name begins with a slash mark (\c 589.q /\^ ) 590the name is used as a file name, 591instead of a login name. 592.pp 593Files that have setuid or setgid bits set 594but no execute bits set 595have those bits honored if 596.i sendmail 597is running as root. 598.sh 2 "Aliasing, Forwarding, Inclusion" 599.pp 600.i Sendmail 601reroutes mail three ways. 602Aliasing applies system wide. 603Forwarding allows each user to reroute incoming mail 604destined for that account. 605Inclusion directs 606.i sendmail 607to read a file for a list of addresses, 608and is normally used 609in conjunction with aliasing. 610.sh 3 "Aliasing" 611.pp 612Aliasing maps names to address lists using a system-wide file. 613This file is indexed to speed access. 614Only names that parse as local 615are allowed as aliases; 616this guarantees a unique key 617(since there are no nicknames for the local host). 618.sh 3 "Forwarding" 619.pp 620After aliasing, 621recipients that are local and valid 622are checked for the existence of a 623.q .forward 624file in their home directory. 625If it exists, 626the message is 627.i not 628sent to that user, 629but rather to the list of users in that file. 630Often 631this list will contain only one address, 632and the feature will be used for network mail forwarding. 633.pp 634Forwarding also permits a user to specify a private incoming mailer. 635For example, 636forwarding to: 637.(b 638"\^|\|/usr/local/newmail myname" 639.)b 640will use a different incoming mailer. 641.sh 3 "Inclusion" 642.pp 643Inclusion is specified in RFC 733 [Crocker77a] syntax: 644.(b 645:Include: pathname 646.)b 647An address of this form reads the file specified by 648.i pathname 649and sends to all users listed in that file. 650.pp 651The intent is 652.i not 653to support direct use of this feature, 654but rather to use this as a subset of aliasing. 655For example, 656an alias of the form: 657.(b 658project: :include:/usr/project/userlist 659.)b 660is a method of letting a project maintain a mailing list 661without interaction with the system administration, 662even if the alias file is protected. 663.pp 664It is not necessary to rebuild the alias database 665when a :include: list is changed. 666.sh 2 "Message Collection" 667.pp 668Once all recipient addresses are parsed and verified, 669the message is collected. 670The message comes in two parts: 671a message header and a message body, 672separated by a blank line. 673.pp 674The header is formatted as a series of lines 675of the form 676.(b 677 field-name: field-value 678.)b 679Field-value can be split across lines by starting the following 680lines with a space or a tab. 681Some header fields have special internal meaning, 682and have appropriate special processing. 683Other headers are simply passed through. 684Some header fields may be added automatically, 685such as time stamps. 686.pp 687The body is a series of text lines. 688It is completely uninterpreted and untouched, 689except that lines beginning with a dot 690have the dot doubled 691when transmitted over an SMTP channel. 692This extra dot is stripped by the receiver. 693.sh 2 "Message Delivery" 694.pp 695The send queue is ordered by receiving host 696before transmission 697to implement message batching. 698Each address is marked as it is sent 699so rescanning the list is safe. 700An argument list is built as the scan proceeds. 701Mail to files is detected during the scan of the send list. 702The interface to the mailer 703is performed using one of the techniques 704described in section 2.2. 705.pp 706After a connection is established, 707.i sendmail 708makes the per-mailer changes to the header 709and sends the result to the mailer. 710If any mail is rejected by the mailer, 711a flag is set to invoke the return-to-sender function 712after all delivery completes. 713.sh 2 "Queued Messages" 714.pp 715If the mailer returns a 716.q "temporary failure" 717exit status, 718the message is queued. 719A control file is used to describe the recipients to be sent to 720and various other parameters. 721This control file is formatted as a series of lines, 722each describing a sender, 723a recipient, 724the time of submission, 725or some other salient parameter of the message. 726The header of the message is stored 727in the control file, 728so that the associated data file in the queue 729is just the temporary file that was originally collected. 730.sh 2 "Examples of Interactions With Other Mailers" 731.pp 732Two examples of how network-specific work is passed to other programs 733are the incoming UUCP mailer 734(\c 735.i rmail ) 736and the outgoing ARPANET mailer. 737.sh 3 "Incoming UUCP mail" 738.pp 739Mail coming in from the UUCP network 740is not guaranteed to have a normal header line, 741nor will an argument be passed telling who it is from\**. 742.(f 743\**As a result, 744it is impossible to verify UUCP sender addresses. 745.)f 746Fortuitously, 747UUCP mail calls the program 748.i rmail 749rather than 750.i mail 751or 752.i sendmail . 753The 754.i rmail 755program has been modified to do the special-purpose parsing 756necessary to decode UUCP headers 757and turn them into a normal UUCP address; 758this address is then passed to 759.i sendmail . 760.sh 3 "Outgoing ARPANET mail" 761.pp 762The ARPANET imposes many standards that 763.i sendmail 764does not care to enforce. 765For example, 766an arpanet sitename must be on 767.i every 768address, 769not just the 770.q "From:" 771address. 772Certain UNIX sites like to use 773.q % 774as an alternative to 775.q @ , 776which must be translated. 777The outgoing ARPANET mailer makes these transformations 778before passing the message to the network. 779.sh 2 "Configuration" 780.pp 781Configuration is controlled primarily by a configuration file 782read at startup. 783.i Sendmail 784should not need to be recomplied except 785.np 786To change operating systems 787(V6, V7/32V, 4BSD). 788.np 789To remove or insert the DBM 790(UNIX database) 791library. 792.np 793To change ARPANET reply codes. 794.np 795To add headers fields requiring special processing. 796.lp 797Adding mailers or changing parsing 798(i.e., rewriting) 799or routing information 800does not require recompilation. 801.pp 802If the mail is being sent by a local user, 803and the file 804.q .mailcf 805exists in the sender's home directory, 806that file is read as a configuration file 807after the system configuration file. 808The primary use of this feature is to add header lines. 809.pp 810The configuration file encodes macro definitions, 811header definitions, 812mailer definitions, 813rewriting rules, 814and options. 815.sh 3 Macros 816.pp 817Macros can be used in three ways. 818Certain macros transmit 819unstructured textual information 820into the mail system, 821such as the name 822.i sendmail 823will use to identify itself in error messages. 824Other macros transmit information from 825.i sendmail 826to the configuration file 827for use in creating other fields 828(such as argument vectors to mailers); 829e.g., the name of the sender, 830and the host and user 831of the recipient. 832Other macros are unused internally, 833and can be used as shorthand in the configuration file. 834.sh 3 "Header declarations" 835.pp 836Header declarations inform 837.i sendmail 838of the format of known header lines. 839Knowledge of a few header lines 840is built into 841.i sendmail , 842such as the 843.q From: 844and 845.q Date: 846lines. 847.pp 848Most configured headers 849will be automatically inserted 850in the outgoing message 851if they don't exist in the incoming message. 852Certain headers are suppressed by some mailers. 853.sh 3 "Mailer declarations" 854.pp 855Mailer declarations tell 856.i sendmail 857of the various mailers available to it. 858The definition specifies the internal name of the mailer, 859the pathname of the program to call, 860some flags associated with the mailer, 861and an argument vector to be used on the call; 862this vector is macro-expanded before use. 863.sh 3 "Address rewriting rules" 864.pp 865The heart of address parsing in 866.i sendmail 867is a set of rewriting rules. 868These are an ordered list of pattern-replacement rules, 869(somewhat like a production system, 870except that order is critical), 871which are applied to each address. 872The address is rewritten textually until it is either rewritten 873into a special canonical form 874(i.e., 875a (mailer, host, user) 8763-tuple, 877such as {arpanet, usc-isif, postel} 878representing the address 879.q "postel@usc-isif" ), 880or it falls off the end. 881When a pattern matches, 882the rule is reapplied until it fails. 883.pp 884The configuration file also supports the editing of addresses 885into different formats. 886For example, 887an address of the form: 888.(b 889ucsfcgl!tef 890.)b 891might be mapped into: 892.(b 893tef@ucsfcgl.UUCP 894.)b 895to conform to the domain syntax. 896Translations can also be done in the other direction. 897.sh 3 "Option setting" 898.pp 899There are several options that can be set 900from the configuration file. 901These include the pathnames of various support files, 902timeouts, 903default modes, 904etc. 905.sh 1 "COMPARISON WITH OTHER MAILERS" 906.sh 2 "Delivermail" 907.pp 908.i Sendmail 909is an outgrowth of 910.i delivermail . 911The primary differences are: 912.np 913Configuration information is not compiled in. 914This change simplifies many of the problems 915of moving to other machines. 916It also allows easy debugging of new mailers. 917.np 918Address parsing is more flexible. 919For example, 920.i delivermail 921only supported one gateway to any network, 922whereas 923.i sendmail 924can be sensitive to host names 925and reroute to different gateways. 926.np 927Forwarding and 928:include: 929features eliminate the requirement that the system alias file 930be writable by any user 931(or that an update program be written, 932or that the system administration make all changes). 933.np 934.i Sendmail 935supports message batching across networks 936when a message is being sent to multiple recipients. 937.sh 2 "MMDF" 938.pp 939MMDF 940[Crocker79] 941spans a wider problem set than 942.i sendmail . 943For example, 944the domain of 945MMDF includes a 946.q "phone network" 947mailer, whereas 948.i sendmail 949calls on preexisting mailers in most cases. 950.pp 951MMDF and 952.i sendmail 953both support aliasing, 954customized mailers, 955message batching, 956automatic forwarding to gateways, 957queueing, 958and retransmission. 959MMDF supports two-stage timeout, 960which 961.i sendmail 962does not currently support. 963.pp 964The configuration for MMDF 965is completely compiled into the code\**. 966.(f 967\**Dynamic configuration tables are currently being considered 968for MMDF; 969allowing the installer to select either compiled 970or dynamic tables. 971.)f 972.pp 973Since MMDF does not consider backwards compatibility 974as a design goal, 975the address parsing is much less flexible. 976.pp 977It is slightly harder to integrate a new channel\** 978.(f 979\**The MMDF equivalent of a 980.i sendmail 981.q mailer. 982.)f 983into MMDF. 984In particular, 985MMDF must know the location and format 986of host tables for all channels, 987and the channel must speak a special protocol. 988.pp 989MMDF strictly separates the submission and delivery phases. 990Although 991.i sendmail 992has the concept of each of these stages, 993they are integrated into one program, 994whereas in MMDF they are split into two programs. 995.sh 2 "Message Processing Module" 996.pp 997The Message Processing Module (MPM) 998discussed by Postel [Postel79b] 999matches 1000.i sendmail 1001closely in terms of its basic architecture. 1002However, 1003like MMDF, 1004the MPM includes the network interface software 1005as part of its domain. 1006.pp 1007MPM also postulates a duplex channel to the receiver, 1008as does MMDF, 1009thus allowing simpler handling of errors 1010by the mailer 1011than is possible in 1012.i sendmail . 1013When a message queued by 1014.i sendmail 1015is sent, 1016any errors must be returned to the sender 1017by the mailer itself. 1018Both MPM and MMDF mailers 1019can return an immediate error response, 1020and a single error processor can create an appropriate response. 1021.pp 1022MPM prefers passing the message as a structured object, 1023with type-length-value tuples. 1024Such a convention requires a much higher degree of cooperation 1025between mailers than is required by 1026.i sendmail . 1027MPM also assumes a universally agreed upon internet name space 1028(with each address in the form of a net-host-user tuple), 1029which 1030.i sendmail 1031does not. 1032.sh 1 "EVALUATIONS AND FUTURE PLANS" 1033.pp 1034.i Sendmail 1035is designed to work in a nonhomogeneous environment. 1036Every attempt is made to avoid imposing any constraints 1037on the underlying mailers. 1038This goal has driven much of the design. 1039One of the major problems 1040has been the lack of a uniform address space, 1041as postulated in [Postel79a] 1042and [Postel79b]. 1043.pp 1044A nonuniform address space implies that a path will be specified 1045in all addresses, 1046either explicitly (as part of the address) 1047or implicitly 1048(as with implied forwarding to gateways). 1049This restriction has the unpleasant effect of making replying to messages 1050exceedingly difficult, 1051since there is no one 1052.q address 1053for any person, 1054but only a way to get there from wherever you are. 1055.pp 1056Interfacing to mail programs 1057that were not initially intended to be applied 1058in an internet environment 1059has been amazingly successful, 1060and has reduced the job to a manageable task. 1061.pp 1062.i Sendmail 1063has knowledge of a few difficult environments 1064built in. 1065It generates ARPANET FTP/SMTP compatible error messages 1066(prepended with three-digit numbers 1067[Neigus73, Postel74, Postel82]) 1068as necessary, 1069optionally generates UNIX-style 1070.q From 1071lines on the front of messages for some mailers, 1072and knows how to parse the same lines on input. 1073Also, 1074error handling has an option customized for BerkNet. 1075.pp 1076The decision to avoid doing any type of delivery where possible 1077(even, or perhaps especially, local delivery) 1078has turned out to be a good idea. 1079Even with local delivery, 1080there are issues of the location of the mailbox, 1081the format of the mailbox, 1082the locking protocol used, 1083etc., 1084that are best decided by other programs. 1085One surprisingly major annoyance in many internet mailers 1086is that the location and format of local mail is built in. 1087The feeling seems to be that local mail is so common 1088that it should be efficient. 1089This feeling is not born out by 1090our experience; 1091on the contrary, 1092the location and format of mailboxes seems to vary widely 1093from system to system. 1094.pp 1095The ability to automatically generate a response to incoming mail 1096(by forwarding mail to a program) 1097seems useful 1098(\c 1099.q "I am on vacation until late August...." ) 1100but can create problems 1101such as forwarding loops 1102(two people on vacation whose programs send notes back and forth, 1103for instance) 1104if these programs are not well written. 1105A program could be written to do standard tasks correctly, 1106but this would solve the general case. 1107.pp 1108It might be desirable to implement some form of load limiting. 1109I am unaware of any mail system that addresses this problem, 1110nor am I aware of any reasonable solution at this time. 1111.pp 1112The configuration file is currently practically inscrutable; 1113considerable convenience could be realized 1114with a higher-level format. 1115.pp 1116It seems clear that common protocols will be changing soon 1117to accommodate changing requirements and environments. 1118These changes will include modifications to the message header 1119(e.g., [NBS80]) 1120or to the body of the message itself 1121(such as for multimedia messages 1122[Postel80]). 1123Experience indicates that 1124these changes should be relatively trivial to integrate 1125into the existing system. 1126.pp 1127In tightly coupled environments, 1128it would be nice to have a name server integrated into the mail system. 1129This would allow a site such as 1130.q Berkeley 1131to appear as a single host, 1132rather than as a collection of hosts, 1133and would allow people to move transparently among machines 1134without having to change their addresses. 1135Such a facility 1136would require an automatically updated database 1137and some method of resolving conflicts. 1138Ideally this would be effective even without 1139all hosts being under 1140a single management. 1141However, 1142it is not clear whether this feature 1143should be integrated into the 1144aliasing facility 1145or should be considered a 1146.q "value added" 1147feature outside 1148.i sendmail 1149itself. 1150.pp 1151As a more interesting case, 1152the CSNET name server 1153[ref?] 1154provides an facility that goes beyond a single 1155tightly-coupled environment. 1156Such a facility would normally exist outside of 1157.i sendmail 1158however. 1159.sh 0 "ACKNOWLEDGEMENTS" 1160.pp 1161Thanks are due to Kurt Shoens for his continual cheerful 1162assistance and good advice, 1163Bill Joy for pointing me in the correct direction 1164(over and over), 1165and Mark Horton for more advice, 1166prodding, 1167and many of the good ideas. 1168Kurt and Eric Schmidt are to be credited 1169for using 1170.i delivermail 1171as a server for their programs 1172(\c 1173.i Mail 1174and BerkNet respectively) 1175before any sane person should have, 1176and making the necessary modifications 1177promptly and happily. 1178Eric gave me considerable advice about the perils 1179of network software which saved me an unknown 1180amount of work and grief. 1181Mark did the original implementation of the DBM version 1182of aliasing, installed the VFORK code, 1183wrote the current version of 1184.i rmail , 1185and was the person who really convinced me 1186to put the work into 1187.i delivermail 1188to turn it into 1189.i sendmail . 1190Kurt deserves accolades for using 1191.i sendmail 1192when I was myself afraid to take the risk; 1193how a person can continue to be so enthusiastic 1194in the face of so much bitter reality is beyond me. 1195.pp 1196Kurt, 1197Mark, 1198Kirk McKusick, 1199Marvin Solomon, 1200and many others have reviewed this paper, 1201giving considerable useful advice. 1202.pp 1203Special thanks are reserved for Mike Stonebraker at Berkeley 1204and Bob Epstein at Britton-Lee, 1205who both knowingly allowed me to put so much work into this 1206project 1207when there were so many other things I really should 1208have been working on. 1209.+c 1210.ce 1211REFERENCES 1212.nr ii 1.5i 1213.ip [Borden79] 1214Borden, S., 1215Gaines, R. S., 1216and 1217Shapiro, N. Z., 1218.ul 1219The MH Message Handling System: Users' Manual. 1220R-2367-PAF. 1221Rand Corporation. 1222October 1979. 1223.ip [Crocker77a] 1224Crocker, D. H., 1225Vittal, J. J., 1226Pogran, K. T., 1227and 1228Henderson, D. A. Jr., 1229.ul 1230Standard for the Format of ARPA Network Text Messages. 1231RFC 733, 1232NIC 41952. 1233In [Feinler78]. 1234November 1977. 1235.ip [Crocker77b] 1236Crocker, D. H., 1237.ul 1238Framework and Functions of the MS Personal Message System. 1239R-2134-ARPA, 1240Rand Corporation, 1241Santa Monica, California. 12421977. 1243.ip [Crocker79] 1244Crocker, D. H., 1245Szurkowski, E. S., 1246and 1247Farber, D. J., 1248.ul 1249An Internetwork Memo Distribution Facility \*- MMDF. 12506th Data Communication Symposium, 1251Asilomar. 1252November 1979. 1253.ip [Crocker82] 1254Crocker, D. H., 1255.ul 1256Standard for the Format of Arpa Internet Text Messages. 1257RFC 822. 1258Network Information Center, 1259SRI International, 1260Menlo Park, California. 1261August 1982. 1262.ip [Metcalfe76] 1263Metcalfe, R., 1264and 1265Boggs, D., 1266.q "Ethernet: Distributed Packet Switching for Local Computer Networks" , 1267.ul 1268Communications of the ACM 19, 12697. 1270July 1976. 1271.ip [Feinler78] 1272Feinler, E., 1273and 1274Postel, J. 1275(eds.), 1276.ul 1277ARPANET Protocol Handbook. 1278NIC 7104, 1279Network Information Center, 1280SRI International, 1281Menlo Park, California. 12821978. 1283.ip [NBS80] 1284National Bureau of Standards, 1285.ul 1286Specification of a Draft Message Format Standard. 1287Report No. ICST/CBOS 80-2. 1288October 1980. 1289.ip [Neigus73] 1290Neigus, N., 1291.ul 1292File Transfer Protocol for the ARPA Network. 1293RFC 542, NIC 17759. 1294In [Feinler78]. 1295August, 1973. 1296.ip [Nowitz78a] 1297Nowitz, D. A., 1298and 1299Lesk, M. E., 1300.ul 1301A Dial-Up Network of UNIX Systems. 1302Bell Laboratories. 1303In 1304UNIX Programmer's Manual, Seventh Edition, 1305Volume 2. 1306August, 1978. 1307.ip [Nowitz78b] 1308Nowitz, D. A., 1309.ul 1310Uucp Implementation Description. 1311Bell Laboratories. 1312In 1313UNIX Programmer's Manual, Seventh Edition, 1314Volume 2. 1315October, 1978. 1316.ip [Postel74] 1317Postel, J., 1318and 1319Neigus, N., 1320Revised FTP Reply Codes. 1321RFC 640, NIC 30843. 1322In [Feinler78]. 1323June, 1974. 1324.ip [Postel77] 1325Postel, J., 1326.ul 1327Mail Protocol. 1328NIC 29588. 1329In [Feinler78]. 1330November 1977. 1331.ip [Postel79a] 1332Postel, J., 1333.ul 1334Internet Message Protocol. 1335RFC 753, 1336IEN 85. 1337Network Information Center, 1338SRI International, 1339Menlo Park, California. 1340March 1979. 1341.ip [Postel79b] 1342Postel, J. B., 1343.ul 1344An Internetwork Message Structure. 1345In 1346.ul 1347Proceedings of the Sixth Data Communications Symposium, 1348IEEE. 1349New York. 1350November 1979. 1351.ip [Postel80] 1352Postel, J. B., 1353.ul 1354A Structured Format for Transmission of Multi-Media Documents. 1355RFC 767. 1356Network Information Center, 1357SRI International, 1358Menlo Park, California. 1359August 1980. 1360.ip [Postel82] 1361Postel, J. B., 1362.ul 1363Simple Mail Transfer Protocol. 1364RFC821 1365(obsoleting RFC788). 1366Network Information Center, 1367SRI International, 1368Menlo Park, California. 1369August 1982. 1370.ip [Schmidt79] 1371Schmidt, E., 1372.ul 1373An Introduction to the Berkeley Network. 1374University of California, Berkeley California. 13751979. 1376.ip [Shoens79] 1377Shoens, K., 1378.ul 1379Mail Reference Manual. 1380University of California, Berkeley. 1381In UNIX Programmer's Manual, 1382Seventh Edition, 1383Volume 2C. 1384December 1979. 1385.ip [Sluizer81] 1386Sluizer, S., 1387and 1388Postel, J. B., 1389.ul 1390Mail Transfer Protocol. 1391RFC 780. 1392Network Information Center, 1393SRI International, 1394Menlo Park, California. 1395May 1981. 1396.ip [Su82] 1397Su, Zaw-Sing, 1398and 1399Postel, Jon, 1400.ul 1401The Domain Naming Convention for Internet User Applications. 1402RFC819. 1403Network Information Center, 1404SRI International, 1405Menlo Park, California. 1406August 1982. 1407.ip [UNIX80] 1408.ul 1409The UNIX Programmer's Manual, Seventh Edition, 1410Virtual VAX-11 Version, 1411Volume 1. 1412Bell Laboratories, 1413modified by the University of California, 1414Berkeley California. 1415November 1980. 1416