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