doug@umich.UUCP (Douglas Orr) (02/06/86)
Here is a sendmail configuration aid that we came up with, in response to a somewhat bizarre mail environment. It centralizes all of the configuration information in one m4 file, so that you don't have to modify the common source to change configurations. This makes supporting multiple configurations a bit easier. It also provides facilities for setting up internal mail domains, hiding host names, and doing all kinds of mail forwarding to other hosts. In a followup item, I will also post the programs we use to let you send mail using non-uucp style addressing, with uucp as the basic transport mechanism. The combination of these things allow us to support things that closely resemble mail domains, zip mail all over the place, and generally go nuts. This is probably a good time to thank everyone who has put up with periodic mail breakdowns while we were getting this stuff put together. -Doug doug@umich.csnet ihnp4!umich!doug P.S. Please address any mail flames to me personally. # This is a shell archive. # Remove everything above and including the cut line. # Then run the rest of the file through sh. -----cut here-----cut here-----cut here-----cut here----- #!/bin/sh # shar: Shell Archiver # Run the following text with /bin/sh to create: # README # base.m4 # localbase.m4 # mailers.m4 # sm.m4 # version.m4 # sample.mc # umich.mc # cosi.mc # This archive created: Thu Feb 6 11:33:29 1986 cat << \SHAR_EOF > README Sendmail Configuration Kit By Douglas Orr Textset Inc., Ann Arbor, Mi. Lee Pearson EECS Dept., the University of Michigan Paul Killey Computing Center, the University of Michigan {ihnp4,pur-ee}!umich!textset!doug, doug%textset@umich.csnet, etc. {ihnp4,pur-ee}!umich!lee, lee@eecs.umich.csnet, etc. {ihnp4,pur-ee}!umich!um.cc!paul_killey, paul_killey@um.cc.umich.csnet, etc. Configurations that provide access to a number of different mail services can be hard for the novice to produce. The traditional approach of modifying the Berkeley configuration file does not always work well. The sendmail.cf file is the result of concatenating of several m4 files, making it difficult for the casual programmer to fully understand its contents. In addition, the basic assumptions that are made in the standard Berkeley configuration do not always apply to a given configuration. This directory contains a sendmail configuration where all (we think) of the configurable information has been removed into a single m4 file. To change a configuration it should be necessary to modify that file alone. Provisions have been made for rfc822 and uucp address formats, arpa, csnet, mailnet, bitnet, and uucp top level mail networks, forwarding to a mail network, various kinds of local mail networks, and hiding internal machine names from the outside world through the use of internal domains. This work is based on the Berkeley and Sun sendmail configurations. CONFIGURATION OVERVIEW: A sendmail configuration consists of 6 files: sm.m4 contains the basic recipient parsing and mailer invocation. It includes localbase.m4 and mailers.m4 and rulesets 0,9,29 localbase.m4 contains the definition of sendmail macros (most of which come from m4 macros defined in the .mc file) and ruleset 6 base.m4 contains boilerplate configuration information and rulesets 1,2,3,4 mailers.m4 contains the specific mailer definitions and the rulesets that they invoke. xxx.mc contains m4 macro definitions that control the whole mess xxx.cf is the actual config file produced by running xxx.mc through m4 (xxx is the name of a specific configuration) The configuration file has two major areas that need to be defined. First is the set of names by which the site is to be known (incoming mail). Second is the set of mail networks to which the site has access, and possibly the names of the hosts/subdomains within those networks (outgoing mail). It is assumed that each site is a member of a mail domain that forms an administrative entity. That domain may be enclosed by a larger domain consisting of peer entities. For example, at EECS department at the University of Michigan, the mail domain is known as "eecs". It is enclosed by the larger "UMICH" domain that encloses it, the computing center, several research groups, etc. The sm.m4 file contains provisions for a variety of mail networks. The destination of outgoing mail is first checked to see if it belongs to one of the mail networks that service other sites within the local domain (EECS in our case). Next, the destination is checked to see if the mail belongs to one of the mail networks that service hosts that are within the domain that immediately encloses our local domain (UMICH). Next, the destination is checked to see if it belongs to one of a number of popular external mail networks (arpanet, bitnet, etc.). Finally, the address is checked to see if it is destined for local delivery. The names by which the current site is known and which internal and external mail networks are enabled depends on settings made in the xxx.mc file. SETTING UP A CONFIGURATION: In order to set up a new configuration, it is suggested that you make a copy of sample.mc, and fill in the appropriate values, for each of the fields. Definitions for the mailers to be used locally may have to be added. Existing definitions may have to be modified. Then add your configuration name to the Makefile, make, test, and install the new configuration. Naturally, with this sort of complex operation it is very important that you test the configuration file before you install it. VARIABLE SETTINGS: The variables preceded by an * must be defined. Most variables must be defined with a particular value. A few are used as boolean variables - it is only checked to see if the variable has been defined, not how. When a variable's value is a list of items, the elements in the list are separated by blanks. Be certain not to leave any blanks between the last word in a variable definition and the closing parenthesis, as the blanks will be included in the definition. The following variables control the names by which the current site is known: * i_d - is defined as the the name of the domain that encloses your site. Example: define(`i_d', `eecs') o_d - is defined as the innermost outer domain that encloses your inner domain. Example: define(`o_d', `UMICH') * inner_domain_hosts - is defined as the list of hosts within the internal domain. Example: define(`inner_domain_hosts', `zippy crim ciprnet') or define(`inner_domain_hosts', `zippy') * official_name - is defined as the smtp hostname. Example: define(`official_name', `$w.UMICH.EDU') * uucp_name - is defined as this site's uucp name. This is the name that gets tacked on to outgoing uucp mail when forming a return address, so it should agree with the name by which your site is known to the uucp world. non_uucp_domain_hosts - this is a list of sites within the external_domain for which you wish to gateway uucp mail. This is a hack that gives the config file permission to drop the ".UUCP" suffix for the listed hosts, allowing people to send mail to those hosts from the uucp world. Typically, this is the list of sites in the <o_d> with which you are connected that do not have uucp mail. uucp_hack - is a boolean variable which should be defined if the <i_d> or <o_d> name is a valid uucp site within the domain. For example, user@umich.UUCP would normally be considered to be a local mail address, just like user@umich.CSNET. Defining this variable asserts that there is a uucp site 'umich' to which this site has access, and forces the mail to be sent via uucp. route_addr - is a boolean variable which should be defined if return addresses are to be generated using the route- addr format instead of the % format. Lots of mailers and mail programs mung up route-addr forms, so, despite the fact that I find them more aesthetically pleasing, they don't work as well reliably as the % format. trusted_users - is a list of users who can set their own from fields. Usually, these are the people who are involved with testing mail. Mail network variables: Each of this set of variables defines a sendmail class. Sendmail classes have two forms - the C form, where the class entries are enumerated in-line, and the F form, where class entries are read from a file using a given format. Since it is not clear which form is going to be best for a given application, it is left to the user to give the correct sendmail class definition as the value of the variable. For example: define(`uucp_mail', `CB mysite yoursite') or define(`uucp_mail', `FB/usr/local/lib/mail/palias %s') are two examples of the different ways to define class B, within sendmail. Each of these variables defines the list of sites that will be recognized as belonging to a particular mail domain. The delivery mechanism and address format to be used are defined when the mailer name is bound to a mailer definition. Each of the mailer definitions is an m4 function. A mailer name is bound to a mailer program by invoking the function, giving the mailer name and address type as an argument. All mail types must be bound to mailer programs and address types, even if the binding seems implicit (such as uucp mail). There are currently 6 address types. They determine what the addresses used in the To: and From: fields look like. For historical and organizational reasons, mail going to different places frequently needs to have different looking To: and From: fields, depending on the destination, delivery mechanism, etc. The 7 address types are: Type From: use 0 uucp_name!user uucp mail 1 user@host.i_d inner domain mail 2 user@i_d inner domain mail (hide host names) 3 user@host.i_d.o_d outer domain mail 4 user@i_d.o_d outer domain mail (hide host names) 5 user@official_host_name mail to an smtp site that needs our "official" smtp name as a return address 8 user local mail The primary categories of addresses are those that need host name and those that don't, and those that need the outer domain name and those that don't (types 0,5 and 8 are special cases). The address types that hide host names are appropriate in environments where all mail comes in to one machine, from which it is distributed and/or all users are completely aliased, so that the actual host to be used within the inner domain can be unambiguously determined once the mail enters the inner domain. Examples: Arpa mail may be sent out over an ethernet. Assuming we need a return address that is different from our position in the mail heirarchy, we use address type 5 for apranet mail. To make this association, the ethernet_mailer function is invoked with "arpa" as the mail type and "5" as the address type - ether_mailer(arpa,5) - at the end of the xxx.mc file. Any number of mailer names may be bound to the same mailer program (arpa, bitnet, and inner_local mail might all get sent using an ethernet, for example). inner_lan_mail - hosts in the inner domain that are accessable via a lan (class A). inner_local_mail - hosts in the inner domain not on the lan (class B), for example sites accessable via uucp. outer_lan_mail - hosts in the outer domain, but that are accessable via a lan (class C). outer_local_mail - hosts in the outer domain, not on a lan (class D). uucp_mail - outside hosts that you exchange uucp mail with (class E). muucp_mail - outside hosts that you exchange uucp mail with using modified addressing (class F). arpa_mail - arpanet hosts (class G). csnet_mail - csnet (class H). bitnet_mail - bitnet sites (class I). mailnet_mail - mailnet sites (class J). inner_domain_other_mail - is a boolean variable. When true, this asserts that mail to a known inner_domain_host that is not directly reachable by this host should be forwarded to a smarter mailer, whose hostname is defined in the variable <inner_domain_other_relay>. outer_domain_other_mail - is a boolean variable. When true, this asserts that mail to a known outer_domain_host that is not directly reachable by this host should be forwarded to a smarter mailer, whose hostname is defined in the variable <outer_domain_other_relay>. other_mail - is a boolean variable. When defined, this asserts that any mail whose address is unknown should be passed to a smarter mailer, whose host name is defined in the variable <other_relay>. By default, only non-local mail is forwarded. An "other" mailer must be defined if this facility is to be used. forward_all - is a boolean variable. When defined, this asserts that all mail (including local mail) should be forwarded to the "other" mailer. "other_mail" must be defined to use this facility. Classes A-K are reserved for mail class definitions. If mail can be sent to a mail network through a relay host on another network, then the host name of the relayer should be given as the value for the mail network relay host variable (the mailer name must also be bound to the mail network of the relay host). If mail is sent directly to that network, the relay host should be left undefined. For example, UMICH sends arpa mail via the site csnet-relay, so we define define(`arpa_mail') define(`arpa_relay', `csnet-relay') arpa_relay - name of site that does arpa mail relaying csnet_relay - name of site that does csnet mail relaying ... other_relay - name of site that does relaying for "other" mail Naturally, there may be some mail classes unaccounted for in the set configuration, and there may be special rules required to recognize them. Special care must be taken, when defining these rules, to escape special characters properly so that m4 doesn't mangle them. Pound sign and expressions with a dollar sign followed by a number are particularly sensitive. Two variables are provided for this purpose - internal_mail_rules - is defined as the sendmail rules required to recognize mail for, and invoke special local mailers. These are typically mailers that work within the external_domain. external_mail_rules - is defined as the sendmail rules required to recognize mail for, and invoke special external mailers. It is also the case that obsolete site names must sometimes be supported. The variable <name_equivalences> is provided, and classes O-V are reserved for this purpose - name_equivalences - is defined as the sendmail rules required to transform one set of names into another, as a special local conversion. These rules are invoked in ruleset 6. MAILER DEFINITIONS: There are a number of mailers defined in the file mailers.m4. These definitions may not apply, or may have to be tailored to your site. The local mailer, prog mailer, ethernet mailer and uucp mailer are relevant to most sites. STRATEGIES: We have tried to implement something of a hierarchy in our mail configurations, where sites have increasing amounts of knowledge, as they rise in the hierarchy. This allows sites at the bottom of the heirarchy to worry mostly about local delivery, machines further up to worry more about inner domain mail delivery, machines further up to worry about outer domain delivery or external mail delivery, and so on. Machines at the lower levels can then be set up to just forward mail they can't deliver to smarter mailers further up in the heirarchy. This allows us to restrict the amount of knowledge that most mailers have of the outside world, localize changes, etc. Using address types that hide host names gives us the freedom to move users around within a domain, without changing the mail address by which they are known to the outside world. It also makes addresses shorter, which never hurts. BUGS: Several macros depend on the correct setting of other macros. IN SEVERAL MACRO DEFINITIONS, TRAILING BLANKS AFTER THE MACRO VALUE ARE FATAL. For example, define( `i_d', `eecs' ) is not the same as define( `i_d', `eecs') The first will work. The second will not. As might be expected, this mail is probably biased towards our set of configurations. SHAR_EOF cat << \SHAR_EOF > base.m4 ############################################################ # # General configuration information # # This information is basically just "boiler-plate"; it must be # there, but is essentially constant. # # ############################################################ ########################## ### Special macros ### ########################## # my name DnMAILER-DAEMON # UNIX header format DlFrom $g $d # delimiter (operator) characters Do.:%@!^=/[] # format of a total name Dq$g$?x ($x)$. # SMTP login message De$j Sendmail $v/$V ready at $b ################### ### Options ### ################### # location of alias file OA/usr/lib/aliases # default delivery mode (deliver in background) Odbackground # (don't) connect to "expensive" mailers #Oc # temporary file mode OF0600 # default GID Og1 # location of help file OH/usr/lib/sendmail.hf # log level OL9 # default messages to old style Oo # queue directory OQ/usr/spool/mqueue # read timeout -- violates protocols Or2h # status file OS/usr/lib/sendmail.st # queue up everything before starting transmission Os # Queue when we're busy (x) and refuse SMTP when really busy (X) Ox15 OX20 # default timeout interval OT3d # time zone names (V6 only) OtCST,CDT # default UID Ou1 # rebuild aliases database if necessary OD # wizard's password #OW* ############################### ### Message precedences ### ############################### Pfirst-class=0 Pspecial-delivery=100 Pjunk=-100 ######################### ### Trusted users ### ######################### T root uucp ifdef(`trusted_users', trusted_users) ############################# ### Format of headers ### ############################# H?P?Return-Path: <$g> HReceived: $?sfrom $s $.by $j ($v/$V) id $i; $b H?D?Resent-Date: $a H?D?Date: $a H?F?Resent-From: $q H?F?From: $q H?x?Full-Name: $x HSubject: H?M?Resent-Message-Id: <$t.$i@$j> H?M?Message-Id: <$t.$i@$j> ########################### ### Rewriting rules ### ########################### ################################ # Sender Field Pre-rewriting # ################################ S1 # mixed rfc/uucp stuff is a problem when we tack on our host name R$+!$+<@$-.UUCP> $3!$1!$2 ################################### # Recipient Field Pre-rewriting # ################################### S2 ################################# # Final Output Post-rewriting # ################################# S4 R@ $@ handle <> error addr # fully qualify domain names... R$*<$*$=A>$* $: $1<$2$3.i_d>$4 inner lan R$*<$*$=B>$* $: $1<$2$3.i_d>$4 inner local ifdef(`o_d', ` R$*<$*$=C>$* $: $1<$2$3.o_d>$4 outer lan R$*<$*$=D>$* $: $1<$2$3.o_d>$4 outer local ') # externalize local domain info R$*<$+>$* $1$2$3 defocus R@$+:$+:$+ $@@$1,$2:$3 <route-addr> canonical ########################### # Name Canonicalization # ########################### S3 # handle "from:<>" special case R<> $@@ turn into magic token # basic textual canonicalization R$*<$+>$* $2 basic RFC821/822 parsing R$+ at $+ $1@$2 "at" -> "@" for RFC 822 R$*<$*>$* $1$2$3 in case recursive # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later R@$+,$+ @$1:$2 change all "," to ":" # localize and dispose of domain-based addresses R@$+:$+ $@ $>6<@$1>:$2 handle <route-addr> # more miscellaneous cleanup R$+ $: $>8$1 host dependent cleanup R$+:$*;@$+ $@ $1:$2;@$3 list syntax R$+@$+ $: $1<@$2> focus on domain R$+<$+@$+> $1$2<@$3> move gaze right R$+<@$+> $@ $>6$1<@$2> already canonical # convert old-style addresses to a domain-based address R$+%$+ $: $1<@$2> user%host.domain R$+<@$+%$+> $1%$2<@$3> move gaze right R$+<@$+> $@ $>6 $1<@$2> already canonical R$-:$+ $@ $>6 $2<@$1> host:user R$+^$+ $1!$2 convert ^ to ! R$-.$+!$+ $@ $>6 $3<@$1.$2> resolve uucp form R$+!$+ $@ $>6 $2<@$1.uucp> resolve uucp names R$-.$+ $@ $>6 $1<@$2> user.d1[.d2...] R$-=$+ $@ $>6$2<@$1.bitnet> resolve bitnet names SHAR_EOF cat << \SHAR_EOF > localbase.m4 ## General Macros # # m4 variables -> sendmail variable declarations ## mail version number (?) DV2.1 # our uucp name `DU'uucp_name # Our given name `Dj'official_name # mail networks ifdef(`inner_lan_mail', inner_lan_mail) ifdef(`inner_local_mail', inner_local_mail) ifdef(`outer_lan_mail', outer_lan_mail) ifdef(`outer_local_mail', outer_local_mail) ifdef(`uucp_mail', uucp_mail) ifdef(`muucp_mail', muucp_mail) ifdef(`arpa_mail', arpa_mail) ifdef(`csnet_mail', csnet_mail) ifdef(`bitnet_mail', bitnet_mail) ifdef(`mailnet_mail', mailnet_mail) # relay hosts ifdef(`uucp_relay', DE uucp_relay) ifdef(`arpa_relay', DG arpa_relay) ifdef(`csnet_relay', DH csnet_relay) ifdef(`bitnet_relay', DI bitnet_relay) ifdef(`mailnet_relay', DJ mailnet_relay) ifdef(`inner_domain_other_relay', DB inner_domain_other_relay) ifdef(`outer_domain_other_relay', DD outer_domain_other_relay) ifdef(`other_relay', DK other_relay) # external domain peer hosts CV ifdef(`non_uucp_domain_hosts',non_uucp_domain_hosts) # current arpa domains CW ARPA EDU GOV COM ORG MIL # members of inner domain CX inner_domain_hosts # our domains CY i_d ifdef(`o_d',o_d) # known top-level domains CZ UUCP CSNET ARPA EDU GOV MIL COM ORG MAILNET ifdef(`o_d',o_d) include(base.m4) ####################### # Rewriting rules # ####################### ##### special local conversions S6 # local name equivalences ifdef(`name_equivalences', name_equivalences) R$*<$*$=A>$* $1<$2$3.i_d>$4 R$*<$*$=B>$* $1<$2$3.i_d>$4 ifdef(`o_d', ` R$*<$*$=C>$* $1<$2$3.o_d>$4 R$*<$*$=D>$* $1<$2$3.o_d>$4 ') SHAR_EOF cat << \SHAR_EOF > mailers.m4 dnl( # # Mailer type definitions # # Invoke these definitions, with the specific name used for the mailer # For example, the ethernet mailer could be referenced both with the # names "arpa" and "lan". In this case, the lines # #ether_mailer(arpa) #ether_mailer(lan) # # should both be included define(local_mailer, `M$1, P=/bin/mail, F=rlsDFMmn, S=18, R=28, A=mail -d $u') define(prog_mailer, `M$1, P=/bin/sh, F=lsDFMe, S=18, R=28, A=sh -c $u') # ether-net define(ether_mailer, `M$1, P=[IPC], F=msDFMueCX, S=1$2, R=2$2, A=IPC $h') # purdue-net define(pnet_mailer, `M$1, P=/usr/local/bin/nsmail, F=SsDFMmuCXL, S=1$2, R=2$2, M=100000, A=nsmail $h $g $u') # chaosnet define(chaos_mailer, `M$1, P=/usr/lib/mailers/chaosmail, F=nsmFDuhC, S=1$2, R=2$2, A=chaosmail $h $u') # vanilla uucp, brainy uucp, and modified uucp define(uucp_mailer, `M$1, P=/usr/bin/uux, F=sDFMhuU, S=1$2, R=2$2, M=100000, A=uux - -r $h!rmail ($u) ') define(buucp_mailer, `M$1, P=/usr/local/lib/mail/uumail, F=sDFhuUM, S=1$2, R=2$2, M=100000, A=uumail $h!$u ') define(muucp_mailer, `M$1, P=/usr/bin/rxmail, F=DFmMu, S=1$2, R=2$2, M=100000, A=rxmail $h -f $g $u') # async-smtp define(smtp_mailer, `M$1, P=/usr/local/lib/smtp/smtp-submit, F=SCnsmFDxXL, S=1$2, R=2$2, M=20000, A=smtp-submit -f $g $u') # async-pmdf define(pmdf_mailer, `M$1, P=/usr/local/lib/pmdf/pmdf-submit, F=mDsFSn, S=1$2, R=2$2, M=100000, A=pmdf-deliver -f $g $u') ) # local productions # sender: S18 R@ $n errors to mailer-daemon # Null production S28 # uucp productions ## General code to convert back to old style uucp names S5 # do something reasonable with all of the combinations that seem # reasonable... try to convert non_uucp_domain_hosts into some sort of # a uucp address that makes sense, and can be reversed # convert the various forms of our name into uucp-ese R$+<@$j> $@ $U!$1 R$+<@$w> $@ $U!$1 R$+<@$w.i_d> $@ $U!$1 # convert names in the uucp "domain" R$+<@$=V.uucp> $@ $2!$1 R$+<@$-.$=V.uucp> $@ $2.$3!$1 R$+<@$-.uucp> $@ $2!$1 R$+<@$-.$-.uucp> $@ $3!$1.$2 # convert name we know about to uucp addresses R$+<@$=V> $@ $2!$1 R$+<@$=B> $@ $2!$1 R$+<@$-.$=V> $@ $2.$3!$1 R$+<@$-.$=B> $@ $3!$1.$2 R$+<@$=V.$=Z> $@ $2.$3!$1 R$+<@$=B.$=Z> $@ $2.$3!$1 R$+<@$-.$=V.$=Y> $@ $2.$3!$1 R$+<@$-.$=B.$=Y> $@ $3!$1.$2 R$+<@$-.$=V.$=Z> $@ $2.$3.$4!$1 ??!!yow R$+<@$-.$=B.$=Z> $@ $2.$3.$4!$1 # everything else is a bit of a mystery... do the best you can R<@$+>$* $@ @$1$2 just defocus and punt R$*<$*>$* $@ $1$2$3 Defocus strange stuff ## Address type 0 -> uucp format ... a!b!c S10 R$+ $: $>5$1 convert to old style R$=w!$+ $2 strip local name R$U!$+ $@ $U!$1 ucbvax!ucbvax!xxx R$U:$+ $@ $U!$1 ucbvax!ucbvax:xxx R$+ $@ $U!$1 stick on our host name S20 R$+ $: $>5$1 convert to old style `#' Address type 1 -> user@host.i_d S11 # Fully qualify our domain names R$*<$*$j>$* $@ $1<$2$w.i_d>$3 qualify R$*<$*$w>$* $@ $1<$2$w.i_d>$3 qualify R$*<$*i_d>$* $@ $1<`$2'i_d>$3 all set # tack on our host name R<@$+>:$+ $@ <@$w.i_d>:@$1:$2 R$+%$+<@$+> $@ $1%$2%$3<@$w.i_d> ifdef(`route_addr', ` R$+<@$+> $@ <@$w.i_d>:$1@$2 ',` R$+<@$+> $@ $1%$2<@$w.i_d> ') R$+ $@ $1<@$w.i_d> S21 # Fully qualify our domain names R$*<$*$j>$* $@ $1<$2$w.i_d>$3 R$*<$*$w>$* $@ $1<$2$w.i_d>$3 R$*<$*$=X>$* $@ $1<$2$3.i_d>$4 R$*<$*i_d>$* $@ $1<`$2'i_d>$3 # is this a real domain name? R$*<$*>$* $@ $1<$2>$3 R$+ $@ $1<@$w.i_d> qualify ######## `#' Address type 2 -> user@i_d (absorb host names. no external domain) S12 # Fully qualify our domain names R$*<$*$j>$* $@ $1<$2i_d>$3 absorb host names R$*<$*$w>$* $@ $1<$2i_d>$3 absorb host names R$*<$*$=X>$* $@ $1<$2i_d>$4 mask our pals R$*<$*i_d>$* $@ $1<$2i_d>$3 all set # tack on our host name (assume this is going out of our domain) R<@$+>:$+ $@ <@i_d>:@$1:$2 R$+%$+<@$+> $@ $1%$2%$3<@i_d> ifdef(`route_addr', ` R$+<@$+> $@ <@i_d>:$1@$2 ',` R$+<@$+> $@ $1%$2<@i_d> ') R$+ $@ $1<@i_d> S22 # Fully qualify our domain names R$*<$*$j>$* $@ $1<$2i_d>$3 absorb host names R$*<$*$w>$* $@ $1<$2i_d>$3 absorb host names R$*<$*$=X>$* $@ $1<$2i_d>$4 R$*<$*i_d>$* $@ $1<$2i_d>$3 all set # is this a real domain name? R$*<$*>$* $@ $1<$2>$3 R$+ $@ $1<@i_d> ##### `#' Address type 3 -> user@host.i_d.o_d *** o_d must be defined *** S13 # Fully qualify our domain names R$*<$*$j>$* $@ $1<$2$w.i_d.o_d>$3 R$*<$*$w>$* $@ $1<$2$w.i_d.o_d>$3 qualify R$*<$*i_d>$* $@ $1<$2$w.i_d.o_d>$3 ditto R$*<$*$=X>$* $@ $1<$2$3.i_d.o_d>$4 ditto R$*<$*o_d>$* $@ $1<`$2'o_d>$3 all set # tack on our host name (assume this is going from inner to outer domain) R<@$+>:$+ $@ <@$w.i_d.o_d>:@$1:$2 R$+%$+<@$+> $@ $1%$2%$3<@$w.i_d.o_d> ifdef(`route_addr', ` R$+<@$+> $@ <@$w.i_d.o_d>:$1@$2 ',` R$+<@$+> $@ $1%$2<@$w.i_d.o_d> ') R$+ $@ $1<@$w.i_d.o_d> S23 # Fully qualify our domain names R$*<$*$j>$* $@ $1<$2$w.i_d.o_d>$3 R$*<$*$w>$* $@ $1<$2$w.i_d.o_d>$3 qualify R$*<$*i_d>$* $@ $1<$2i_d.o_d>$3 ditto R$*<$*$=X>$* $@ $1<$2$3.i_d.o_d>$4 ditto R$*<$*i_d>$* $@ $1<$2i_d.o_d>$3 qualify R$*<$*i_o>$* $@ $1<$2o_d>$3 all set # is this a real domain name? R$*<$*>$* $@ $1<$2>$3 R$+ $@ $1<@$w.i_d.o_d> ##### `#' Address type 4 -> user@i_d.o_d (absorb host names) S14 # Fully qualify our domain names R$*<$*$j>$* $@ $1<$2i_d.o_d>$3 qualify (delete hostname) R$*<$*$w>$* $@ $1<$2i_d.o_d>$3 qualify (delete hostname) R$*<$*$w.i_d>$* $@ $1<$2i_d.o_d>$3 ditto R$*<$*$=X>$* $@ $1<$2i_d.o_d>$4 ditto R$*<$*$=X.i_d>$* $@ $1<$2i_d.o_d>$4 ditto R$*<$*i_d>$* $@ $1<`$2'i_d.o_d>$3 qualify R$*<$*o_d>$* $@ $1<`$2'o_d>$3 all set # tack on our host name (assume this is going from inner to outer domain) R<@$+>:$+ $@ <@i_d.o_d>:@$1:$2 R$+%$+<@$+> $@ $1%$2%$3<@i_d.o_d> ifdef(`route_addr', ` R$+<@$+> $@ <@i_d.o_d>:$1@$2 ',` R$+<@$+> $@ $1%$2<@i_d.o_d> ') R$+ $@ $1<@i_d.o_d> S24 # Fully qualify our domain names R$*<$*$j>$* $@ $1<$2i_d.o_d>$3 qualify (delete hostname) R$*<$*$w>$* $@ $1<$2i_d.o_d>$3 qualify (delete hostname) R$*<$*$w.i_d>$* $@ $1<$2i_d.o_d>$3 ditto R$*<$*$=X>$* $@ $1<$2i_d.o_d>$4 ditto R$*<$*$=X.i_d>$* $@ $1<$2i_d.o_d>$4 ditto R$*<$*i_d>$* $@ $1<$2i_d.o_d>$3 qualify R$*<$*o_d>$* $@ $1<$2o_d>$3 qualify # is this a real domain name? R$*<$*>$* $@ $1<$2>$3 R$+ $@ $1<@i_d.o_d> ##### `#' Address type 5 -> user@$j (arpa smtp address form) S15 R$*<$*$j>$* $@ $1<$2$j>$3 all set # mung up real domain name R$*<$*$w>$* $@ $1<$2$j>$3 u@h -> u@x.y.edu, etc. R$*<$*$w.i_d>$* $@ $1<$2$j>$3 u@h.i -> u@x.y.edu, etc. ifdef(`o_d', ` R$*<$*$w.i_d.o_d>$* $@ $1<$2$j>$3 u@h.i.o -> u@x.y.edu ') # tack on our host name (assume this is going out of our domain) R<@$+>:$+ $@ <@$j>:@$1:$2 R$+%$+<@$+> $@ $1%$2%$3<@$j> ifdef(`route_addr', ` R$+<@$+> $@ <@$j>:$1@$2 ',` R$+<@$+> $@ $1%$2<@$j> ') R$+ $@ $1<@$j> S25 R$*<$*$j>$* $@ $1<$2$j>$3 all set # mung up real domain name R$*<$*$w>$* $@ $1<$2$j>$3 u@i -> u@x.y.edu, etc. R$*<$*$w.i_d>$* $@ $1<$2$j>$3 u@i -> u@x.y.edu, etc. ifdef(`o_d', ` R$*<$*$w.i_d.o_d>$* $@ $1<$2$j>$3 u@i.o -> u@x.y.edu ') # is this a real domain name? R$*<$*>$* $@ $1<$2>$3 R$+ $@ $1<@$j> SHAR_EOF cat << \SHAR_EOF > sm.m4 ## SENDMAIL CONFIGURATION FILE ## $Header: sm.m4,v 1.10 86/01/31 15:50:13 lee Exp $ ## Douglas Orr - Textset Inc. ## Lee Pearson - University of Michigan EECS ## Paul Killey - University of Michigan CC ## based on ucb/sun configurations ## ("I used to think sendmail was evil ... but now I UNDERSTAND!") ## we have full sendmail support here Oa include(`localbase.m4') S0 # first make canonical R$*<$*>$* $1$2$3 defocus R$+ $: $>3 $1 make canonical # handle special cases..... R@ $#local $:$n handle <> form R$*<$*>$* $: $>9 $1<$2>$3 peel off outer domains # now delete the local info and run degenerates through again R$*<$*$w.$=Y>$* $1<$2>$4 thishost.localdomain R$*<$*$j>$* $1<$2>$3 our friend, mr. smtp R$*<$*$w.UUCP>$* $1<$2>$3 thishost (uucp suks) R$*<$*$w>$* $1<$2>$3 thishost R$*<$*.>$* $1<$2>$3 drop trailing dot R<@>:$* $@ $>29 $1 retry after route strip R$*<@> $@ $>29 $1 strip null trash & retry # re-run stuff addressed to this domain R$*<@$=Y> $@ $>29 $1 already here R<@$=Y>:$* $@ $>29 $2 route-addr to nowhere ## these hosts are reachable by (sometimes exclusively) means other than ## the dreaded uucp. shun and avoid it. R$*<$*$=V.UUCP>$* $@ $>0 $1<$2$3>$4 h.UUCP -> h ## Invoke a particular mailer ## INTERNAL MAIL ifdef(`inner_lan_mail', ` ## inner local area network mail R$*<$*$=A.'i_d`>$* $#inner_lan $@$3 $:$1<$2$3'.i_d`>$4 R$*<$*$=A>$* $#inner_lan $@$3 $:$1<$2$3'.i_d`>$4 ' `ifdef(`o_d', ` R$*<$*$=A.'i_d.o_d`>$* $#inner_lan $@$3 $:$1<$2$3'.i_d`>$4 ')' ) ifdef(`inner_local_mail', ` ## generic inner domain mail R$*<$*$=B.'i_d`>$* $#inner_local $@$3 $:$1<$2$3'.i_d`>$4 R$*<$*$=B>$* $#inner_local $@$3 $:$1<$2$3'.i_d`>$4 ' `ifdef(`o_d', ` R$*<$*$=B.'i_d.o_d`>$* $#inner_local $@$3 $:$1<$2$3'.i_d`>$4 ')' ) ifdef(`internal_mail_rules', `## special local (internal) mail rules ' internal_mail_rules ) ifdef(`inner_domain_other_mail', ` # left-over mail for our outer domain R$*<$*'i_d`>$* $#inner_domain_other $@$B $:$1<$2'i_d`>$3 ',` R$*<$*'i_d`>$* $#error $:$1$2 unknown address in 'i_d` domain ') ## EXTERNAL MAIL ## mail by domain ifdef(`mailnet_mail', ` ## mailnet mail. R$*<$*$-.MAILNET>$* $#mailnet $@'ifdef(`mailnet_relay',`$J',`$3') `$:$1<$2$3.Mailnet>$4 user@domain ') ifdef(`csnet_mail', ` ## Csnet mail R$*<$*$-.CSNET>$* $#csnet $@'ifdef(`csnet-relay',`$H',`Csnet-relay') `$:$1<$2$3>$4 user@domain R$*<$*$-.CS.NET>$* $#csnet $@'ifdef(`csnet-relay',`$H',`Csnet-relay') `$:$1<$2$3>$4 user@domain ') ifdef(`bitnet_mail', ` ## Bitnet mail R$*<$*$-.BITNET>$* $#bitnet $@'ifdef(`bitnet_relay',`$I',`$3') `$:$1<$2$3.BITNET>$4 user@domain ') ifdef(`arpa_mail', ## Arpa mail - numeric addrs, u@h.EDU, etc., arpa hosts `ifdef(`arpa_relay', ` R<@[$+]>:$* $#arpa $@$G $:<@[$1]>:$2 numeric internet spec R$*<@[$+]> $#arpa $@$G $:$1<@[$2]> numeric internet spec R$*<$+.$=W>$* $#arpa $@$G $:$1<$2.$3>$4 user@domain.ARPA... ', ` R<@[$+]>:$* $#arpa $@[$1] $:$2 numeric internet spec R$*<@[$+]> $#arpa $@[$2] $:$1 numeric internet spec R$*<$*$-.$=W>$* $#arpa $@$3 $:$1<$2$3.$4>$5 user@domain.ARPA... ')' ) ifdef(`outer_lan_mail', ` ## outer local area network mail R$*<$*$=C.'o_d`>$* $#outer_lan $@$3 $:$1<$2$3'.o_d`>$4 R$*<$*$=C>$* $#outer_lan $@$3 $:$1<$2$3'.o_d`>$4 ') ifdef(`outer_local_mail', ` ## generic outer domain host mail R$*<$*$=D.'o_d`>$* $#outer_local $@$3 $:$1<$2$3'.o_d`>$4 R$*<$*$=D>$* $#outer_local $@$3 $:$1<$2$3'.o_d`>$4 ') ifdef(`o_d', `ifdef(`outer_domain_other_mail', ` # left-over mail for our outer domain R$*<$*'o_d`>$* $#outer_domain_other $@$D $:$1<$2'o_d`>$3 ',` R$*<$*'o_d`>$* $#error $:$1$2'o_d` unknown address in 'o_d` domain ')' ) ## mail by site ifdef(`arpa_mail', ` R$*<$*$=G>$* $#arpa $@'ifdef(`arpa_relay',`$G',`$3') `$:$1<$2$3>$4 user@domain ') ifdef(`csnet_mail', ` R$*<$*$=H>$* $#csnet $@'ifdef(`csnet_relay',`$H',`Csnet-relay') `$:$1<$2$3>$4 user@domain ') ifdef(`bitnet_mail', ` R$*<$*$=I>$* $#bitnet $@'ifdef(`bitnet_relay',`$I',`$3') `$:$1<$2$3.BITNET>$4 user@domain ') ifdef(`mailnet_mail', ` R$*<$*$=J>$* $#mailnet $@'ifdef(`mailnet_relay',`$J',`$3') `$:$1<$2$3.Mailnet>$4 user@domain ') ifdef(`muucp_mail', ` ## Modified uucp mail out of our domain R$*<$*$=F>$* $#muucp $@$3 $:$1<$2$3>$4 ') ifdef(`external_mail_rules', `##' special local (external) mail rules external_mail_rules) ifdef( `uucp_mail', ` R$*<$*$=E>$* $1<$2$3.UUCP>$4 user@uucphost.UUCP ifdef( `uucp_relay', ` ## Uucp mail - anything that looks vaguely like a uucp address # hosts we know how to get to directly R<@$+.$=E.UUCP>:$+ $#uucp $@$2 $:@$1.$2.UUCP:$3 @host.domain.UUCP: ... R<@$=E.UUCP>:$+ $#uucp $@$1 $:$2 @host.UUCP: ... R$+<@$+.$=E.UUCP> $#uucp $@$3 $:$1@$2.$3.UUCP user@host.domain.UUCP R$+<@$=E.UUCP> $#uucp $@$2 $:$1 user@host.UUCP # relay up to a site with more knowledge R$*<@$*$-.UUCP>$* $#uucp $@$E $:$1@$2$3.UUCP$4 ', ` ## Uucp mail - anything that looks vaguely like a uucp address # If it is uucp, the mailer better be able to handle it R<@$+.$-.UUCP>:$+ $#uucp $@$2 $:@$1.$2.UUCP:$3 @host.domain.UUCP: ... R<@$-.UUCP>:$+ $#uucp $@$1 $:$2 @host.UUCP: ... R$+<@$+.$-.UUCP> $#uucp $@$3 $:$1@$2.$3.UUCP user@host.domain.UUCP R$+<@$-.UUCP> $#uucp $@$2 $:$1 user@host.UUCP ')' ) ifdef(`other_mail', ` ## All other mail forwarded to mysterious, powerful "other" mailer R$*<@$+>$* $#other $@$K $:$1<@$2>$3 user@host ifdef(`forward_all', ` R$+ $#other $@$K $:$1 everything else ') ',` # Error on any names with a network in them here since we couldnt # figure out where to send them. R$*<@$+>$* $#error $:$1@$2 Unknown host or domain in address ' ) # remaining names are local (since they aren't on any of our networks) R$+ $#local $:$1 everything else S9 ## Special cases R$*<@$U.UUCP>$* $@ $1<@>$2 clean this up in S0 ifdef(`uucp_hack', ` ## For sites whose domain name is a valid uucp site R$*<@$+.$=Y.UUCP>$* $@ $1<@$2.$3>$4 R$*<@$=Y.UUCP>$* $@ $1<@$2.UUCP>$3 ') # Peel off extra outer domains (mostly error conditions) R$*<$*$=Z.$=Z>$* $1<$2$3>$5 x@y.arpa.csnet R$*<$*$=Y.$=Z>$* $1<$2$3>$5 x@localdomain.arpa ## format an address from scratch - cannonicalize then back through s0 S29 R$* $: $>3 $1 cannonicalize R$* $@ $>0 $1 ## Host dependent address cleanup ### S8 ## standard mailer definitions include(`mailers.m4') ## ... always define local and prog mailers local_mailer(local) prog_mailer(prog) SHAR_EOF cat << \SHAR_EOF > version.m4 # @(#)version.m4 4.7 8/31/83 DV4.7 SHAR_EOF cat << \SHAR_EOF > sample.mc dnl( # configuration macro definitions # * inner domain name define(`i_d', `my_inner_domain') # outer domain name ## define(`o_d', `my_outer_domain') # * officail SMTP host name define(official_name,`my_hostname') # * inner domain host names define(`inner_domain_hosts', `my_inner_domain_hosts') # non-uucp domain hosts ## define(`non_uucp_domain_hosts', `umich-mts') # * uucp host name define(`uucp_name', my_uucp_name_or_site_name) # inner/outer domain<->uucp host name conversion ## define(`uucp_hack') # use route-addr form return addresses ## define(`route_addr') # trusted users ## define(`trusted_users', `my_friends') # known mail networks and known hosts on mail networks # inner local area network ## define(`inner_lan_mail', `CA elvis madvax') # inner generic local mail ## define(`inner_local_mail', `CB') # outer local area network ## define(`outer_lan_mail', `CC') # outer generic local mail ## define(`outer_local_mail', `CD') # ** uucp mail ## define(`uucp_mail', `CE umich') # civilized uucp ## define(`muucp_mail', `CF umich') # arpanet ## define(`arpa_mail') # csnet ## define(`csnet_mail', `CH') # bitnet ## define(`bitnet_mail', `CI') # mailnet ## define(`mailnet_mail', `CJ') # fairy godmother mail ## define(`inner_domain_other_mail') ## define(`outer_domain_other_mail') ## define(`other_mail') # *** hosts that will relay mail for us ## define(`uucp_relay') ## define(`arpa_relay') ## define(`csnet-relay', `csnet-relay.CSNET') ## define(`bitnet_relay', `wiscvm.ARPA') ## define(`mailnet_relay') ## define(`inner_domain_other_relay') ## define(`outer_domain_other_relay') ## define(`other_relay') # * must be defined # ** if uucp mail is used, at least one host must be defined (eg. CE relayhost) # *** mail type must be defined, as well as rely name. If "other_mail" # is use, other_relay must be defined. ) include(`sm.m4') # Local mailer definitions ## uucp_mailer(uucp,0) ## ether_mailer(inner_lan,1) ## muucp_mailer(inner_local,4) ## muucp_mailer(outer_domain_other,4) ## muucp_mailer(other,4) ## ether_mailer(arpa,4) SHAR_EOF cat << \SHAR_EOF > umich.mc dnl( # configuration macro definitions # * inner domain name define(`i_d', `eecs') # outer domain name define(`o_d', `UMICH') # * officail SMTP host name define(official_name,`$w.eecs.UMICH') # * inner domain host names define(`inner_domain_hosts', `zippy ciprnet crim grim mingus') # non-uucp domain hosts define(`non_uucp_domain_hosts', `cc farg caen ccunix elvis iti itivax') # * uucp host name define(`uucp_name', `umich') # inner/outer domain<->uucp host name conversion define(`uucp_hack') # use route-addr form return addresses ## define(`route_addr') # trusted users define(`trusted_users', `postman lee doug') # name equivalences define(`name_equivalences', ` CNub ub-mts COca CA umich-ca uofm-ca umich-ciprnet UMICH-CIPRNET zippy CPra RA robot umich-ra uofm-ra crim CQcv CV umich-cv uofm-cv ciprnet CRrb RB umich-rb uofm-rb grim CSum um-mts umich-mts mts CTcaen umich-caen CUmingus umich-ai-lab R$*<$*$=O>$* $@ `$'1<`$'2zippy>`$'4 R$*<$*$=O.UMICH>$* $@ `$'1<`$'2zippy.i_d>`$'4 R$*<$*$=O.$=Y>$* $@ `$'1<`$'2zippy.`$'4>`$'5 R$*<$*$=P>$* $@ `$'1<`$'2crim>`$'4 R$*<$*$=P.UMICH>$* $@ `$'1<`$'2crim.i_d>`$'4 R$*<$*$=P.$=Y>$* $@ `$'1<`$'2crim.`$'4>`$'5 R$*<$*$=Q>$* $@ `$'1<`$'2ciprnet>`$'4 R$*<$*$=Q.UMICH>$* $@ `$'1<`$'2ciprnet.i_d>`$'4 R$*<$*$=Q.$=Y>$* $@ `$'1<`$'2ciprnet.`$'4>`$'5 R$*<$*$=R>$* $@ `$'1<`$'2grim>`$'4 R$*<$*$=R.UMICH>$* $@ `$'1<`$'2grim.i_d>`$'4 R$*<$*$=R.$=Y>$* $@ `$'1<`$'2grim.`$'4>`$'5 R$*<$*$=T>$* $@ `$'1<`$'2caen>`$'4 R$*<$*$=T.$=Y>$* $@ `$'1<`$'2caen.`$'4>`$'5 R$*<$*$=U>$* $@ `$'1<`$'2mingus>`$'4 R$*<$*$=U.$=Y>$* $@ `$'1<`$'2mingus.`$'4>`$'5 R$*<$*umich-mts.Mailnet>$* $@ `$'1<`$'2um.cc.UMICH>`$'3 R$*<$*$=S>$* $@ `$'1<`$'2um.cc.UMICH>`$'4 R$*<$*$=S.$=Y>$* $@ `$'1<`$'2um.cc.`$'4>`$'5 R$*<$*$=N>$* $@ `$'1<`$'2ub.cc.UMICH>`$'4 R$*<$*$=N.$=Y>$* $@ `$'1<`$'2ub.cc.`$'4>`$'5 #R$*<$*cc>$* $@ `$'1<`$'2cc>`$'3 #R$*<$*cc.$=Y>$* $@ `$'1<`$'2cc.`$'3>`$'4 ') # known mail networks and known hosts on mail networks # inner local area network define(`inner_lan_mail', `CA zippy ciprnet crim grim') # inner generic local mail define(`inner_local_mail', `CB mingus') # outer local area network define(`outer_lan_mail', `CC cc') # outer generic local mail define(`outer_local_mail', `CD farg caen iti elvis ccunix itivax') # ** uucp mail define(`uucp_mail', `FE/usr/local/lib/mail/palias') # civilized uucp define(`muucp_mail', `CF textset blue') # arpanet define(`arpa_mail', `CG') # csnet define(`csnet_mail', `FH/usr/local/lib/pmdf/pobox.names') # bitnet define(`bitnet_mail', `CI') # mailnet define(`mailnet_mail', `FJ/usr/local/lib/mail/mts.names') # fairy godmother mail ## define(`inner_domain_other_mail') ## define(`outer_domain_other_mail') ## define(`other_mail') # *** hosts that will relay mail for us ## define(`uucp_relay') define(`arpa_relay', `csnet-relay') ## define(`csnet-relay', `csnet-relay') define(`bitnet_relay', `um.cc') define(`mailnet_relay', `um.cc') ## define(`inner_domain_other_relay') ## define(`outer_domain_other_relay') ## define(`other_relay', `zippy') # * must be defined # ** if uucp mail is used, at least one host must be defined (eg. CE relayhost) # *** mail type must be defined, as well as rely name. If "other_mail" # is use, other_relay must be defined. ) include(`sm.m4') # Local mailer definitions pnet_mailer(inner_lan,1) chaos_mailer(inner_local,1) muucp_mailer(outer_local,4) smtp_mailer(outer_lan,4) smtp_mailer(mailnet,4) pmdf_mailer(csnet,4) pmdf_mailer(arpa,4) pmdf_mailer(bitnet,4) muucp_mailer(muucp,4) buucp_mailer(uucp,0) SHAR_EOF cat << \SHAR_EOF > cosi.mc dnl( # configuration macro definitions # * inner domain name define(`i_d', `COSI') # outer domain name ## define(`o_d', `UMICH') # * officail SMTP host name define(official_name,`$w.COSI') # * inner domain host names define(`inner_domain_hosts', `cosivax bugs daffy cecil waybk madvax') # non-uucp domain hosts ## define(`non_uucp_domain_hosts', `mts um ub umich-mts') # * uucp host name define(`uucp_name', `$w') # inner/outer domain<->uucp host name conversion define(`uucp_hack') # use route-addr form return addresses ## define(`route_addr') # trusted users ## define(`trusted_users', `postman') # name equivalences ## define(`name_equivalences', ` ') # known mail networks and known hosts on mail networks # inner local area network define(`inner_lan_mail', `CA cosivax madvax bugs daffy') # inner generic local mail define(`inner_local_mail', `CB cecil waybk') # outer local area network ## define(`outer_lan_mail', `CC') # outer generic local mail ## define(`outer_local_mail', `CD') # ** uucp mail ## define(`uucp_mail', `CE cosivax') # civilized uucp define(`muucp_mail', `CF umich') # arpanet define(`arpa_mail', `FG') # csnet ## define(`csnet_mail', `FH') # bitnet define(`bitnet_mail', `CI') # mailnet define(`mailnet_mail', `FJ') # fairy godmother mail ## define(`inner_domain_other_mail') ## define(`outer_domain_other_mail') define(`other_mail') # *** hosts that will relay mail for us define(`uucp_relay', `umich') define(`arpa_relay', `umich') ## define(`csnet-relay', `umich') define(`bitnet_relay', `umich') define(`mailnet_relay', `umich') ## define(`inner_domain_other_relay', `bugs') define(`outer_domain_other_relay', `bugs') define(`other_relay', `umich') # * must be defined # ** if uucp mail is used, at least one host must be defined (eg. CE relayhost) # *** mail type must be defined, as well as rely name. If "other_mail" # is use, other_relay must be defined. ) include(`sm.m4') # Local mailer definitions ether_mailer(inner_lan,1) muucp_mailer(muucp,1) muucp_mailer(other,1) uucp_mailer(uucp,0) SHAR_EOF # End of shell archive exit 0