# NOTE: This file was automatically generated from an m4 specification # Built by dave on Sat Feb 8 17:24:14 EST 1992 # in /u/dave/Mail/cf on das13.snide.com # ########################################################################## ### The IDA-NIU Sendmail Configuration File ################## ########################################################################## ### The documentation in this file is deliberately minimal. For ### ### more complete documentation, look at the Master file ### ### (Sendmail.mc), or - define(M4COMMENTS) in your m4 source ### ### file and recreate the file. ### ########################################################################## ### Lennart_Lovstrand.EuroPARC@Xerox.COM ### ### Rank Xerox EuroPARC, 61 Regent St, Cambridge, England ### ### Copyright (c) 1984-88 -- Use it, abuse it, but don't sell it ### ########################################################################## ### Greatly modified, with changed internal canonical forms ### ### by Neil Rickert ### ### Northern Illinois University, DeKalb IL 60115 ### ########################################################################## # Current version DVIDA-1.4.4 ####### REWRITING STRATEGIES ############################################# # # Ruleset 3 completely canonicalizes addresses to an internal # format, which looks like a modified RFC822 source route. # The internal canonical form is documented in the comments # preceding Ruleset #7 which is called internally by Ruleset #3. # # The "domain" will be mapped to its full, official domain name # using the TCP/IP name server and a dbm domaintable. !- and # ::-style paths are rewritten into RFC822 routes internally. # Resonable mixtures of !-, %-, and RFC822 routes are resolved, # either using straight domain preference, or using heuristics. # Some effort is made to repair malformed addresses. # # This format is used in all internal rulesets until finally # rewritten by the mailer dependent rules or by ruleset #4, # where they are fully transformed into the mailer's preferred # address syntax. Three # kinds of mailers currently exist: # # [1] Domain based mailers, for which the official domain names # are used and routes are given in the %-format for header # addresses and envelope recipient addresses, while # envelope return paths are kept in RFC822 route syntax. # Typical examples of this type are the TCP/IP and LOCAL # mailers. # # [2] Domain based mailers with flat node name mappings. These # use full domain names in header addresses but translate # envelope domains to names relative the actual network's # name space. Two mailers fit into this category: The Dmail # mailer, which map domain names to DECnet names, and the # UUCP-A/B mailers, which map domains to UUCP node names. # Both the DECnet and the UUCP worlds use flat namespaces. # The Dmail and the UUCP-B mailers essentially uses type I # routes while the UUCP-A mailer uses type III routes (ie, # !-paths). # # [3] UUCP !-path based mailers. This mailer type rewrites all # addresses into !-paths, both header and envelope addresses. # Header addresses are made relative the remote node by # removing "remote!" from them or prefixing "localhost!" to # them. UUCP nodes with domain names are translated to their # UUCP equivlanents. ####### SENDMAIL CONFIGURATION EXTENSIONS ################################ # # This is a short table describing extensions to the configuration # language. See the reference guide for a detailed definition. # # Option "/" will turn on general envelope/header specific # rewriting. Mailer specific e/h rulesets are given as in # "R=14/15", where ruleset 14 is used for envelope recipient # addresses and ruleset 15 for header recipients. # # The M_FROMPATH (p) flag will work for mailers that use "From_" # line envelopes as well as SMTP mailers. # # The M_RELATIVIZE (V) flag has been added, which make all header # lines relative the recipient host by removing "remote!" or # adding "localhost!". # # TCP/IP nameserver lookups are extended with a default argument, # as in "$[ hostname $: default $]". The "default" string will be # returned if the host isn't known to gethostname(3). # # General dbm database functions have been added. The option "K" # will declare a dbm database and associate it with a letter, # which later on is used in constructs like: # "$(x key $@ arg $: default $)" # The "x" is the one-letter name of the database, the "key" is the # lookup string; the optional "arg" is then sprintf(3)'ed through # the result, if found. The whole expression evaluates to # "default", or "key" if "$: default" is not present, if the "key" # can't be found in the database. The "@" database is # automatically connected to the aliases(5) file. ####### CLASSES, DEFINITIONS, and DATABASES ############################## # # The following classes, macro definitions and keyed databases are # being used: # # CA An atsign (@), used in class membership negations # CI Isolated net names # CP Known top level pseudo domains # CT Known top level domains (global + local) # CU Directly connectable UUCP nodes # CX A set of chars that delimit the LHS of a domain (@ %) # CY A set of chars that delimit the RHS of a domain (, : !) # CZ RFC822 Source Route punctuation chars (, :) # # DV Configuration version number # # OK@ The aliases database (automatically defined) # OKM Special domain => mailer:host table ########################################################################## ## Default Definitions ################################################### ########################################################################## # ########################################################################## ## Domain Definitions #################################################### ########################################################################## ########################################################################## # Universally known top-level domains # Organizational domains CTarpa com edu gov int mil nato net org # National domains CTag ar at au bb be bo br bs bz ca ch cl cn cr cs de dk dm do ec eg CTes fi fr gr hk hu ie il in is it jp kn kr lc lk mx my na ni nl no CTnz ph pl pr pt se sg sr su th tn tr tt tw uk us uy vc ve yu za # Network based domains # NS records don't exist for these CTbitnet csnet #CTbitnet csnet uucp # Removed UUCP. The address shortening in ruleset 23 should not apply to # UUCP addresses since the addresses are relative - not absolute. ########################################################################## # Well-known pseudo domains # (that the resolver shouldn't be bothered with) CPBITNET UUCP ########################################################################## ## Misc Definitions ###################################################### ########################################################################## # This is the list of nets which may use TCP/IP delivery directly. CIMY_DOMAIN # This node's local host name DwMY_MACHINE.MY_DOMAIN CwMY_MACHINE.MY_DOMAIN # Other names for this node - localhost.your.domain may be needed among these. CwMY_MACHINE MY_MACHINE.uucp MY_MACHINE.MY_DOMAIN # We always want localhost to be considered local. Cwlocalhost # This node's official domain name Dj$w # Define a quote macro. This is the only way to put '"' into an address. # and even then we must use $&Q, not $Q (Use with caution). DQ\" # my name DnMAILER-DAEMON # UNIX header format DlFrom $g $d # delimiter (operator) characters Do".:;%@!=/[]?#^,<>" # Characters that mark the left (X) & right (Y) hand side of a domain CX@ % CY, : ! # Pure RFC822 route punctuation characters CZ, : # The atsign-in-a-class CA@ # Format of a total name: Personal Name # - now uses $f in place of the usual $g, to avoid envelope rewriting rules. Dq$?x$!x <$f>$|$f$. # SMTP login message De$j $v/$V Sendmail is ready at $b ########################################################################## # Options # set default alias file OA/usr/lib/aliases # time to look for "@:@" in alias file Oa15 # substitution for blank character OB. # checkpoint the queue after this many deliveries # OC10 # don't connect to "expensive" mailers Oc # delivery mode Odb # rebuild alias database as needed # OD # set error processing mode # Oe # temporary file mode OF0600 # save Unix-style From lines on front # Of # default gid Og1 # help file OH/usr/lib/sendmail.hf # force use of name server # OI # ignore dot lines in message # Oi # database files OKM/usr/lib/mailtable # log level OL9 # define macro # OM # send to me too Om # assume old style headers Oo # postmaster copy of returned messages OPPostmaster # queue directory OQ/usr/spool/mqueue # read timeout -- violates protocols Or30m # status file OS/usr/lib/sendmail.st # be super safe, even if expensive Os # queue timeout OT2d # time zone name # OtMET,MET DST # set default uid Ou1 # run in verbose mode # Ov # wizard's password OW* # load avg at which to auto-queue msgs Ox11 # load avg to auto-reject connections OX7 # fork when running the queue # OY # use separate envelope/header rewriting rulesets O/ ########################################################################## # Message precedences Pfirst-class=0 Pspecial-delivery=100 Pbulk=-100 Pjunk=-100 ########################################################################## # Trusted users Troot Tdaemon Tuucp ########################################################################## # Header Formats #HReceived: $?sfrom $s $.by $j; $b HReceived: $?sfrom $s $.by $j$?r with $r$. id $i ($v/$V$?m for $m$.); $b H?P?Return-Path: <$g> H?D?Date: $a H?F?From: $q H?x?Full-Name: $x H?M?Message-ID: <$t.$i@$j> # ########################################################################## ## Mailer Specifications ################################################# ########################################################################## ########################################################################## # # Local & Prog mailer definitions #Mlocal, P=/usr/bin/deliver, F=DFMlmns, R=25/10, S=10, A=deliver -r $g $u Mlocal, P=/bin/lmail, F=DFMlms, R=25/10, S=10, A=rmail $u Mprog, P=/bin/sh, F=DFMhlsu, R=10, S=10, A=sh -c $u # Add -p flag to phquery to copy postmaster on error bounces MPH, P=/usr/lib/phquery, F=DFMhnmur, A=phquery $u MPHF, P=/usr/lib/phquery, F=DFMhnmur, A=phquery -R $u MFAX, P=/usr/lib/phquery, F=DFMhnmur, A=phquery -x fax $u MNOVAM, P=/usr/lib/novamailer, F=DFMhnmu, A=novamailer $a $g $u ########################################################################## # # TCP/IP mailer specification # # The TCP mailer is the normal choice for SMTP/TCP delivery, but a # couple of variations exist for compatibility with mailers that # need special address formatting for indirect UUCP and DECnet # addresses. Both have to be explicitly mentioned in the mailertable # to be chosen as all normal mail will use the standard TCP mailer. # # TCP-A -- make sure address ends with a registered domain, ie. # strictly legal within the ARPA Internet. If it isn't, we'll # turn it into a path through ourselves. # # TCP-D -- will flatten envelope recipient DECnet domains for # messages destinated to our DECnet gateway. Unfortunately, our # (Linkoping) DECnet gateway is too dumb to do this itself. # # TCP-U -- is available for hosts which require hybrid addresses # for deliveries to UUCP destinations. Eg. "bar!foo@dest.host" # will be formatted as bar!foo@dest.host in the output mail, # whereas the regular TCP mailer will preserve the address in a # format more closely resembling the address it received. # # Both of the above only touch envelope addresses; header # addresses are still kept in our preferred format. Change the # R/S settings below if you don't like that. MTCP, P=[IPC], F=CDFMXhnmu, E=\r\n, R=10/11, S=11, A=IPC $h MTCP-A, P=[IPC], F=CDFMXhnmu, E=\r\n, R=12, S=12, A=IPC $h MTCP-D, P=[IPC], F=CDFMXhnmu, E=\r\n, R=24/25, S=0/25, A=IPC $h MTCP-U, P=[IPC], F=CDFMXhnmu, E=\r\n, R=17/11, S=17/11, A=IPC $h ######################################################################### # # # Rule set #10: For local mailers (headers only). # # # # Local recipients without attached domains have the # # default domain stripped off. Superfluous routing is # # removed. Otherwise there is an attempt to preserve as # # much of the original formatting as possible, provided # # that the resultant address will be correctly recognized # # if processed again by this mailer configuration. # # # # Also useful for envelope recipients of mailers such as # # the TCP mailer, where the address will not be local # # anyway. # # # ######################################################################### S10 R<>,$=X$+$=Y$+ <>,$4 Remove default host. R<$+>$*$=Y$~A$* $:<$1>$2$3?$4$5 Mark user portion. R<$+>$*!$+,$*?$+ <$1>$2!$3!$4?$5 ! is inferior to @ R<$+>$+,$*?$+ <$1>$2:$3?$4 Change src rte to % path R<$+>:$+ <$1>,$2 Change % to @ for immed. domain R<$=X$-.UUCP>!?$+ $@<$1$2.UUCP>!$3 Return UUCP R<$=X$->!?$+ $@<$1$2>!$3 Return unqualified R<$+>$+?$+ <$1>$2$3 Remove '?' R<$+.$+>$=Y$+ $@<$1.$2>,$4 Change do user@domain ######################################################################### # # # Rule set #11: General purpose output formatting. # # # # Uses a heuristic approach based on the input format of the # # address. A simple address is always formatted as # # user@dom.ain, unless the domain is a UUCP domain. For # # multi-level paths, uses either a ! path or a % path, or # # perhaps even a hybrid @/! path, depending on the format # # in which the original address is presented. # # # ######################################################################### S11 R<>,$=X$+$=Y$+ <$1$2>$3$4 Expand local domains. R<$+>$+ $:$>21<$1>$2 Provide route to neighbors R<$+>$*$=Y$~A$* $:<$1>$2$3?$4$5 Mark user portion. R<$+>$*!$+,$*?$+ <$1>$2!$3!$4?$5 ! is inferior to @ R<$+>$+,$*?$+ <$1>$2:$3?$4 Change src rte to % path R<$+>:$+ <$1>,$2 Change % to @ for immed. domain R<$+>$+?$+ $:<$1>$2$3 Remove mark R<$=X$-.UUCP>!$+ $@<$1$2.UUCP>!$3 Return UUCP R<$=X$->!$+ $@<$1$2>!$3 Return unqualified R<$+>$=Y$+ $:<$1>,$3 Else change do user@domain ######################################################################### # # # Rule Set #12: Make sure all domains RFC822 valid. # # # # This rule set is actually a compromize. Recipient # # addresses may not finish up being in a valid domain. # # They may possibly be better known in the receiving # # domain than in ours, so we should not hide them behind # # our domain. However if the recipients are local UUCP # # links, etc, we do hide behind our name. This presumes that # # the mailer is never used for such local links, so that any # # locally connected recipient is an alternate header recipient, # # and not an envelope recipient. # # # ######################################################################### S12 R<>,$=X$+$=Y$+ <$1$2>$3$4 Expand local domains. # First change to source route format. R<$+>$*$=Y$~A$* $:<$1>$2$3?$4$5 Mark user portion. R<$+>$=Y$+ $:<$1>,$3 Make first specifier @. R<$+>,@$+!$*?$+ <$1>,@$2:$3?$4 Change all '!' to '%'. R<$+>,$+:$+,$*?$+ <$1>,$2:$3:$4?$5 but no '@' after first %. R<$+>$+?$+ <$1>$2$3 Remove marker. # Next try to force address to be official domain name. R<@$+>$+ $@$>21<@$1>$2 Route local recipients. R<%$+.$=P>$+ $@$>20<%$1.$2>$3 Hide pseudo domain # Removed the validation and hiding code in order to avoid delays caused # by nameserver lookups. # If the domain is not a Pseudo-domain, we only know how to send to it if # it is know in the DNS anyway. It is silly to route an address through # us if we can't send to it. #R<%$+>$+ $:<%$[ $1 $: $1? $]>$2 Valid by name server? #R<$+?>$+ $@$>20<$1>$2 Invalid - hide. # Produce hybrid (brr) recipient addresses for unqualified or .UUCP hosts S17 R<>,$=X$+$=Y$+ <$1$2>$3$4 Expand local domains. R<$+>$+ $:$>19 <$1>$2 bangify. # Possibly produce addresses such as b!c!x@foo.bar.edu R<$=X$-.$+>!$+ $:<$1$2.$3>,$4 Use @ for qualified. R<$=X$-.UUCP>,$+ $:<$1$2.UUCP>!$3 but not for .UUCP R<%$+>$+ $:$>21<%$1>$2 Add route for local sender ########################################################################## # # (Pseudo)DECnet mailer specification # # Send all envelope recipients thru DECnet domain name flattener. ########################################################################## # # UUCP mailer definitions # Our UUCP name DkMY_MACHINE CUMY_MACHINE CwMY_MACHINE.UUCP # List of known UUCP nodes FU|uuname|sort -u MUUCP, P=/usr/bin/uux, F=DFMUVpu, S=13, R=19/13, A=uux - -r $h!rmail ($u) MUUCP-A, P=/usr/bin/uux, F=DFMmu, S=15/11, R=15/11, A=uux - -r $h!rmail ($u) MUUCP-B, P=/usr/bin/uux, F=BDFMXmpu, S=0/11, R=15/11, A=uux - -r $h!bsmtp ######################################################################### # # # Rule Set #13: UUCP Mailer header rules # # # # UUCP addresses are passed to ruleset 19. But domain # # addresses are retained in domain format where possible. # # # # Since the V flag in the mailer definition will always # # add or remove a 'host!' in front of the address, we ourselves # # add a 'destination!' in front, which should then be removed. # # If it is not removed, no great harm is usually done, since # # it is the correct host name for the recipient domain, and # # should be properly dealt with there. If we do not do this # # then user@dom.ain becomes ourselves!dom.ain!user which is # # unnecessarily superfluous. dom.ain!user should suffice. # # # ######################################################################### S13 R<$*>$+ $:$>19<$1>$2 Bangify address. R<>,$=X$+!$+ $@<>,$1$k!$3 Our uuname for locals R<$=X$=w>$+ $@<$1$k>$3 Our uuname on locals R<@$-.UUCP>$+ $@<@$1.UUCP>$2 Return UUCP host. R<@$+>$+ $:<@$1>$2?$&h Add recipient host. R<@$+.$=T>$+?$- $@<@$4>!@$1.$2$3 Add route to domain. R<@$+>$+?$* <@$1>$2 Remove mark. ######################################################################### # # # Rule Set #15: UUCP-A Mailer envelope rules. # # # # This UUCP-A mailer is designed to give address formats as # # close to Internet formats as possible. However robustness # # requirements, in the face of UUCP transport, place some # # limitations. # # # # Sender addresses are always formatted with !, but where the # # domain has both a fully qualified name and a UUCP name, we # # use the fully qualified name in the address. # # # # Recipient addresses of the form 'user@fully.qual.domain' are # # left in that form, but recipient addresses with UUCP origins # # or with multiple hosts are converted to a '!' path, again # # preserving the full domain name of the primary host where # # possible. # # # ######################################################################### S15 R<>,$=X$+$=Y$+ <$1$2>$3$4 Expand local domains. R<%$+>$+ $:$>21<%$1>$2 Route UUCP senders thru us. R<$=X$-.UUCP>$+ $@$>19<$1$2.UUCP>$3 If UUCP, bangify path. R<$=X$->$+ $@$>19<$1$2>$3 Bangify unqualified. R<>,$=X$+$=Y$+ <$1$2>$3$4 Show local domain. R<$+>:$+ <$1>,$2 Change u%d to u@d R<@$+>,$~A$* $@<@$1>,$2$3 Return u@d recipient address. # Bangify anything else. R<$+>$+ $:$>19<$1>$2 ########################################################################## ## Standard Rewriting Rules ############################################## ########################################################################## ######################################################################### # # # Rule Set #0: Mailer Resolving Ruleset # # # # This is rather straightforward. The code should say it all. # # # # We do make two special cases. Mail to 'user@localhost' # # is delivered directly. This is a way of bypassing the # # forwarding to a mail server (if that option is in use). # # # # If '$f' is not defined, mail routed through 'localhost' is # # also sent to the local mailer. This allows building of an # # alias file with non-local aliasing, simply by routing the # # address through 'localhost'. # # # ######################################################################### S0 # Force any routing thru localhost to be local. Used for alias building, # and to avoid sending to MAILSERVER. R$&f<@localhost>,@$+$=Y$+ ?$>29$>8<@$2>$3$4 Relativize R?<@$=w>$=Y$+ ?<>,$3 Remove local host R?<$*>$+ $#LOCAL$@$w$:$>25<$1>$2 and deliver. R<@localhost>,$~A$* $#LOCAL$@$w$:$1$2 Deliver forced local R$+ $:$>8$1 Fully qualify. # Digest routes through ourselves R<@$+>$+ $:$>29 <@$1>$2 remove routed self # Try immediate delivery R<$*>$+ $:$>26 <$1>$2 try to find mailer R$#$+ $# $1 found one, return it # Send known domains to TCP mailer (queue message in case nameserver fails) R<@$*$=I>$+ $#TCP $@$1$2 $:<@$1$2>$3 found, return it # If we have a RELAY_HOST/RELAY_MAILER, use it R<@$+>$+ $#UUCP-A $@SMART_HOST $:<@$1>$2 # Undeliverable recipients--complain loudly & return to sender R$*<@> $1 Remove unparseability marker. R<@$->$+ $#ERROR $:Host $1 not known--please specify domain R<@$-.$*$=T>$+ $#ERROR $:Host $1 not known within the $2$3 domain R<@$-.$*$=P>$+ $#ERROR $:Host $1 not known within the $2$3 domain R<@$+.$->$+ $#ERROR $:Domain $2 not known--please try to route manually R@$+ $#ERROR $:"Incomplete Source Route--use <...> format" R$* $#ERROR $:Could not parse $1 ######################################################################### # # # Rule Set #1: [Envelope] Sender Specific Rewriting # # # # There is an assumption by some software which may be used # # as a local mailer, that for a local sender '$f' is the # # actual sender login name. Ruleset 1 thus hides the domain # # of all local senders so that a mailer can easily recognize it # # as local, and if in the phase of determining a value for '$f' # # (as determined by '$f' being undefined), the hidden domain # # is then stripped off. # # # ######################################################################### S1 R<@$+>$+ $:<%$1>$2 Indicate a sender address. R$+ $:$>23$>8$1 Fully qualify domain. R$+<$=X$+>$+ $:$1<>,$2$3$4 Make locals recognizable. R$*<$*>$+ $:$1<$2>$3??$&f Append sender ID. R$+<$*>$+?? $@$1 No sender - return bare local. R$*<$*>$+?? $@<$2>$3 No sender - return. R$*<$*>$+??$* $:<$2>$3 Remove unneeded markers. R$+$=X$-$+ $:$1%$3$4 Mark as sender. ######################################################################### # # # Rule Set #2: [Envelope] Receiver Specific Rewriting # # # # Currently nothing. # # # ######################################################################### S2 R$#$+$:$+ $:$2 Strip mailer/host when debugging. ######################################################################### # # # Rule Set #3: Address Canonicalization # # # # Turns the address into the (internally) canonical format. # # See the documentation on ruleset #7 for a description of # # the internal canonical format. # # # # Input formats include the standard "mailbox@domain" format, # # RFC822 Source Routes, RFC822 Group Names, ARPAnet %-Kludges, # # UUCP !-Paths, the Berknet "host:user" format, the VAX/VMS # # "host::user" format and resonable mixtures of the above. # # # # The code even tries to clean up after various mistakes that # # other nodes has done when reformatting the addresses, such # # as mangled Xerox distribution lists or malformatted RFC822 # # Group Specifications. # # # ######################################################################### S3 # The first (experimental) rules deal with addresses processed in code # because of the C-mailer flag, and recycled into ruleset 3. R<>,$~A$*@$+ $1$2@$3 Clean up recycled address # The next four rules come from nahaj@cc.utah.edu. They are intended # to transform "Name" "Phone number" into just mailbox # But they must deal with extra level of that are sometimes # incorrectly added. They must also deal with the fact that sendmail # processes left to right, and becomes unhappy with anything not having # . R$*<$*>$*<$*>$* <$2>$3$4$5 Remove right branches. R$*<$*<$*>$*>$* <$3>$5 Trim left branches. R$*<>$* $n default user R$*<$*>$* $2 Last level # Fix group names and return them R$+:;@$+ $:$1:; remove host info R$+: $:$1:; missing semicolon R$+!; $:$1:; UUCP-style mangled group R$+!$+:; $2:; remove UUCP host info R$+:; $@$1:;<@> Finally return group # Miscellaneous cleanup (sigh) R$+!.$+ $1^.$2 fix mangled Xerox dList R$-::$- $1::$2?$(@$&Q$2$&Q$) Is this decnet quoted 822? R$-::$-?""$+@$+"" @$1.dnet:$3@$4 Convert quoted to source route. R$-::$-?$+ $1::$2 Else restore R$+::$+ $1.dnet!$2 Convert DECNET to bang path. R$+!:$+@$+ $1!$3!$2 scrambled source route R$+!:$+ $1!$2 mangled VAX/VMS address R$-:$- $1!$2 Berknet style address R$+:@$+ $1,@$2 slightly malformed src route R$*$~Z@$+@$+ $1$2%$3@$4 fix user@host@relay R$+@$+.$=T.UUCP $1@$2.$3 strip UUCP off foo@bar.EDU.UUCP R$+@$+.$=P.UUCP $1@$2.$3 strip UUCP off foo@bar.DNET.UUCP # Fix %-kludgified RFC822 source routes (double sigh) R$+!%$+:$+%$+ $1!%$2:$3@$4 change all %'s into @'s R$+!%$+,%$+ $1!%$2,@$3 R$+!%$+ $1!@$2 R$+ $:$>7$1 Canonicalize address. # We used '!' for DECNET '::' addresses. Now change it to '@'. R<@$+.dnet>!$+ <@$1.dnet>,$2 Change DECNET format to '@' # The address should now be in the format <@domain>,...,user # or, if there is no domain, in the format <>,user ######################################################################### # # # Rule Set #4: Address PrettyPrinter # # # # Does the final prettyprinting before the address is included # # in the message. (This is essentially a reformatting # # from internal to external format) # # # # More detailed documentation in the master configuration # # file. # # # # DO NOT ATTEMPT TO CHANGE S4 unless you fully understand it, # # as it is a critical part of the whole configuration setup. # # # ######################################################################### S4 R$*<@> $@$1 Return unparseables. # If missing domain, attach local. R<>,$=X$+$=Y$+ <@$2>$3$4 No host, add default. R<>,$+ $@$1 Plain name, without domain. R<$=X$+>$=Y$+ ?<@$2?$3$4> Insert marker # We start with source routes; they are somewhat tricky. R?$*<$+?,@$+$=Y$+>$* $1$6 Insert several markers R$+?:$+?,@$+$=Y$+?$+?$+ $1,$6?:@$3?$4$5?$2?$7 Process source rte R$+?:$+?,$+?$+?$+ $:$1,$4?:$3??$2?$5 Process user (no @) R$+?:$+?$*?$+?$+ ?$1:?$2$3?$4$5 Remove extra marks R?$*<$=Y$*?$+?$+>$* $:?$1$3<$4>$5$6 Remove extra , or : # The separator after "<@domain" cannot now be a comma, except in one case. R?$*<$+?,$+>$* $@$1$3$2$4 Return user@host # The <..> part may (no src rte) or may not contain a "?". Make it consistent. R?$+?$+ ?$1$2 Remove extra marks R?$*<@$+$=Y$+>$* $:?$1<@$2?$3$4>$5 Add mark for next step # Next process ! paths. These are more straight forward. R?$*<@$+?!$+>$* $:?$1?!<@$2?!$3>$4 Add mark for later use. R?$+<@$+?!@$+$=Y$+>$* ?$1$2!<@$3?$4$5>$6 Move UUCP host out R?$+<@$+?!$+>$* $:?$1$2!<$3>$4 host!user R?$*?$*!$-.UUCP!$+ ?$1?$2!$3!$4 Remove unneeded .UUCP R?$*?!$*<$+>$* ?$1$2<$3>$4 Remove extra markers. # The % paths are the easiest. R?$*<@$+?:@$+$=Y$+>$* ?$1<@$3?$4$5>%$2$6 Move %domain out R?$*<@$+?:$+>$* $@$1$3%$2$4 Return user%host # There might be more left. R?$*<@$+?$=Y$+>$* $@$>4?$1<@$2?$3$4>$5 Recurse for more # Finally, clean up R?$+?$+ ?$1$2 Remove extra marks R?$*<$+>$* $:$1$2$3 Remove ######################################################################### # # # Rule Set #5: [Header] Sender Specific Rewriting # # # # Set a flag to indicate that this is a sender address. # # # # There is an assumption by some mailers (notably ucbMail) # # that the 'From:' header will not have a domain for # # local senders. The sender domain, if local, is therefore # # squirreled away where the mailer specific ruleset can # # easily recognize and remove it if desired. # # # ######################################################################### S5 R<@$+>$+ <%$1>$2 Change mark to '%'. R$+ $:$>8$1 Fully qualify domains. R<%$+>$+ $:<@$1>$2 Change back to @. R<$*>$+ $:$>23<$1>$2 Remove unneeded routing R$+<$+>$+ $:$1<>,$2$3 Make local recognizable R$*<$*>$+ $:<$2>$3 Remove local indicator R$+$=X$-$+ $:$1%$3$4 Indicate sender. ######################################################################### # # # Rule Set #6: [Header] Receiver Specific Rewriting # # # # Fully qualify domain, but shorten route where possible. # # # ######################################################################### S6 R<@$+>$+ <%$1>$2 Change mark to '%'. R$+ $:$>8$1 Fully qualify domains. R<%$+>$+ $:<@$1>$2 Change back to @. R<$*>$+ $:$>23<$1>$2 Remove unneeded routing R$*<$*>$+ $:<$2>$3 Remove local user. ########################################################################## ## General rewriting subroutines ######################################### ########################################################################## ######################################################################### # # # Rule Set #7: Canonicalize address. # # # # This is a subroutine to S3. After S3 has done basic # # repairing of addresses it calls S7 to canonicalize. # # S7 may also be called to canonicalize internal addresses. # # DO NOT pass already canonical addresses to S7. However # # a semi-canonical address, beginning with @ (NOT %) may # # be totally enclosed in <> angle brackets and passed to # # S7 for re-canonicalization, although this should not # # normally be needed. Addresses canonicalized by S7 # # are not necessarily fully qualified (see rule set #8). # # # # The general internal form of an address is a modified # # RFC822 source route. An address will be converted first # # to the form: # # @host1,@host2,...@hostn,user (Note the ',' not ':' # # which precedes user). # # However, the ',' may not really be a ','. It could also be # # a ':' or a '!'. The choice of ',',':', or '!' serves to define # # how the host domain was delimited. A ',' represents an '@', # # a ':' represents a '%', and a '!' represents a '!'. # # # # Note also that the modified form ends with just 'user', not # # with 'user@domain'. This format is easier to use internally. # # After turning into a modified route, the immediate host is # # single out with angle brackets. This leaves an address of # # the form <@host1>,@host,....,@hostn,user. # # # # Finally ruleset's 1 and 5 convert the initial '@' into a # # '%'. This enables rewriting rules to more easily # # distinguish between sender addresses (with a %) or # # recipient addresses (with an @). # # # # Ruleset #7 calls ruleset #9 to isolate the user portion # # of an address. Most of #7 deals with addresses for which # # the user portion is enclosed in <>, and is already # # canonicalized. However it is possible to call #7 with the # # user portion already isolated and canonicalized. # # # # When processing an address with the user portion enclosed, # # ruleset #7 supports the following types of address: # # %b@a # # a!b!%c # # @a,@b:%d@c # # a!b!@c,@d:%f@e # # b!c!%d@a # # However it does not support an address of the form # # @a,@b:d!e!@c # # # # It should be pointed out that for a complete address with # # the user portion not yet isolated, there is no such # # restriction. In that case, ruleset #9 will convert # # @a,@b:d!e!x%f@c # # into # # @a,@b:@c (except that # # will be canonicalized. # # This is now in a form ruleset #7 can handle. # # # ######################################################################### S7 # We first isolate the user portion of the address. R$+ $:$>9$1 Isolate the user part. R$*<>$* $@$1$2<@> Missing user? give up. # Now we must canonicalize the address portion. Start with some checking. R$*%$*<$+>$* $@$1%$2$3$4<@> Should be no percent. give up. R$*<$+>$*$=Y$* $@$1$2$3$4$5<@> No ,:! in domain of user@domain R$*$~Y<$+>$* $@$1$2$3$4<@> Separator or nothing precede <. # Take care of a!b! or even a!b!@c,@d:@domain R$~A$*!@$*<$+>$* @$1$2!@$3<$4>$5 a!source-rte -> @a!source-rte R$~A$*!$*<$+>$*@$+ @$6,@$1$2!$3<$4>$5 b!%c@a -> @a,@b!%c R$~A$*!$*<$+>$* @$1$2!$3<$4>$5 domain! -> @domain! R$+!$~A$*!$*<$+>$* $1!@$2$3!$4<$5>$6 @a!b! -> @a!@b! R$~A$*<$+>$* $@$1$2$3$4<@> Route must begin with @. R$+:<$+>$* $1,<$2>$3 Use , not : for routes R$*<$+>$=X$+ $:?$1<$2>$3$4 Add marker. R$*?$*<$+>%$+$=X$+ @$4:$1?$2<$3>$5$6 Convert %path to source rte R$*?$*<$+>%$+ $:$2@$4:$1<$3> Convert last '%'. R$*?$*<$+>@$+ $:$2@$4,$1<$3> Convert last '@'. R$*<$+>$* $1$2$3 Remove brackets. # We should now have a modified route. Pick out immediate host. R@$+$=Y$+ $@<@$1>$2$3 If a host, select it. R$+ $@<>,$1 Else null host. ######################################################################### # # # Rule Set #8: Qualify primary domain. # # # # This rule set is called to fully qualify the domain of # # the immediate host. # # # ######################################################################### S8 # For local users, add a default domain. R<>,$~X$* $@$>20<>,$1$2 Add default domain. R<$=X$->!$+ $:<$1$2.UUCP>!$3 If !, add .UUCP R<$+>$+ ?<$1>$2 Add marker. R?<$=X[$+.$+]>$+ <$1[$2.$3]>$4 [1.2.3.4] is ok. R?<$=X$+.$=P>$+ <$1$2.$3??>$4 don't resolv pseudomain R?<$=X$+>$+ $:<$1$[ $2 $:$2? $]?>$3 First try resolver R<$=X$+.??>$+ <$1$2??>$3 Strip extraneuos '.' R<$=X$+?$*>$+ $:<$1$2$3>$4 One '?' is enough. R<$=X$w?>$+ <$1$w>$2 Accept official name. # Caution - next 3 rules MUST NOT apply to envelope recipients (mailing loops). R<$=X$-?>$+ $:<$1$2?$&r?$&s>$3 What is sender domain? # The $(@ $) in next line is a crude fix for the fact that $&s is not tokenized. R<%$-?SMTP?$+>,$+ <$(@%$2$)>,@$1:$3 Route unqualified. R$&f<@$-?SMTP?$+>,$+ <@$2>,$4 Remove markers. R<$=X$-?$+>$+ <$1$2?>$4 Remove extraneous data. R<$=X$=U?>$+ <$1$2.UUCP>$3 Local UUCP host? R<$=X$-?>$+ $:<$1$2?$(M $2.UUCP $: $)>$3 Known in mailertable? R<$+?$+>$+ <$1.UUCP>$3 Add .UUCP if known R<$*?$*>$* <$1$2>$3 Remove marker ######################################################################### # # # Rule Set #9: Isolate the user portion of an address # # # # Given an address like a@b return @b. For a route address # # of the form @a,@b,@c:x@d return @a,@b,@c:@d . The user # # portion may contain % and !, but will not contain any @ symbol. # # An address like a!b!x@c is ambiguous. # # Here it is resolved as @c giving the @ priority # # over the !, as required by RFC822. # # After isolating the user portion, that portion is finally # # converted to internal route form. Thus # # x%a%b@c becomes first @c, and then is reformatted to # # <@b:@a:x>@c. # # # ######################################################################### S9 R$*<$*>$* $@$1<$2>$3 Already isolated: return R$+ $:<$1> First try user only. R$*<$*@$+$=Y$*> $1$2@$3$4<$5> Skip past routing. R$*<$*$~Y@$+> $1<$2$3>@$4 user@domain R$*<$+>@$+$=X$+ $@$>9$1$2%$3@$5 Fix badly mixed @ and %. R$*<$*@$*>$* $@$1$2@$3$4<> Shouldn't happen. I give up. R$*<$*%$*!$*>$* $@$1$2%$3!$4$5<> This shouldn't happen either. # Uncomment the next line to give % higher precedence that ! in c!x%b@a #R$*<$+!$+%$+>$+ $1<$2!$3>%$4$5 If @ has precedence, move % out R$*<$+>$* $:$1$3 Add markers to convert %, ! R$*$* $:$1<@$3,?$2?>$4 Convert u@d to @d,u R$*<$*?$+!$+>$* $1<$2@$3!?$4>$5 Convert a!b to @a!b. R$+?$+%$+?$+ $:$1@?$3?:$2$4 Convert a%b to @b:a R$+@?$+%$+?$+ $1@?$3?:@$2$4 Completely convert % path R$+?$+ $1$2 Remove markers. ######################################################################### # # # Rule Set #19: Translate domain addresses to UUCP !-paths # # # # Takes an domain style address as input and transforms this # # into a !-path. There will be no atsign left in the address # # after this, but there may(?) still be a percent sign. # # # ######################################################################### S19 R<$+>$=Y$+ $:<$1>!$3 Force bang formatting. R<>,$=X$+$=Y$+ $:<>,$1$2!$4 Bang format for locals R<$+>$*$=Y$~A$* $:<$1>$2$3?$4$5 Mark user. R<$+>$+@$-.UUCP:$*?$+ <$1>$2@$3.UUCP!$4?$5 Change % to ! for .UUCP R<$+>$+@$-:$*?$+ <$1>$2@$3!$4?$5 Change to ! for unqual R<$+>$+@$+,$*?$+ <$1>$2@$3!$4?$5 Use ! for real domains R<$+>$+?$+ <$1>$2$3 Remove user mark. ######################################################################### # # # Rule Set #20: Route addresses through us. # # # # Route the address through us. Done where it is necessary # # for the address to use a registered domain. # # # ######################################################################### S20 R<$=X$=w>$=Y$+ $@<$1$w>,$4 Us? Use preferred name R<$=X$+>$+ $@<$1$w>,@$2$3 Else route thru us. R<>,$~X$* $@<>,@$w,$1$2 No domain, use our name ######################################################################### # # # Rule Set #21: Route local UUCP links, etc through us. # # # # Extend this rule set as needed for locally connected # # nodes which do not have internet addresses. # # # ######################################################################### S21 R<$=X$&h.UUCP>$+ $@<$1$2.UUCP>$3 Don't hide destination host R<$=X$=U.UUCP>$=Y$+ $@$>20<$1$2.UUCP>!$4 Route local UUCP node thru us ######################################################################### # # # Rule Set #23: Route prettyprinter & compressor. # # # # This code comresses "obvious" routes whenever considered # # necessary -- mostly just for aesthetical reasons, though. # # If you don't like this, feel free to disable it. Sendmail # # shouldn't break, anyway. (But there will probably be # # others...) # # # ######################################################################### S23 R<@$+>$*$=Y$~A$* $:<@$1?>$2$3?$4$5 Mark user portion of address R<$+?>$+.$=T$=Y$*?$+ <$1$2.$3?>$4$5?$6 Find last top level domain R$*<$+$=Y@$+>$+ $1$2$3<@$4>$5 Find begin of domain R@$+<$+?>$*?$+ $:$>8<$2>$3$4 Success - simplify. R<$+?>$*?$+ $:<$1>$2$3 Failure - remove markers. R<$=X$+>$+ $:$1$>29<@$2>$3 Strip routing. R$=X<@$+>$+ $:<$1$2>$3 and restore correct indicator R<$=X$+>$+ $:$2?<$1$2>$3 Move domain out front. R<>,$=X$+$=Y$+ $:$2?<>,$1$2$3$4 Move out in front here too. R$+?$*<>,$=X$+$=Y$+ $@$6<>,$3$4$5$6 Return with local marked. R$+?$*<$=X$+>$+ $:$4<$3$4>$5 Remove marker. R$+<>,$=X$+$=Y$+ $@$5<>,$2$1$4$5 Return with remapped domain. R$+<$=X$=w>$=Y$~A$* $@$5$6<$2$1>$4$5$6 Return with remapped domain. R$+<$=X$+>$+ $@<$2$1>$4 Non-local with remapped domain ######################################################################### # # # Rule Set #25: Translate RFC822 Source Routes into %-Paths # # # # This ruleset converts an address into a % route. # # # ######################################################################### S25 R<$+>$*$=Y$~A$* $:<$1>$2$3?$4$5 Mark start of user field R<$+>$=Y$+ $:<$1>,$3 No pure % paths please. R<$+>,$+,$*?$+ <$1>,$2:$3?$4 Change source rte to %. R<$+>,$+!$*?$+ <$1>,$2:$3?$4 Change ! format to %. R<$+>$+?$+ <$1>$2$3 Remove mark. ######################################################################### # # # Rule Set #26: Determine Mailer for Address # # # # Takes an address in canonical format as input and returns # # a complete mailer specification if a mailer is known for # # the supplied domain. Just returns the address otherwise. # # # ######################################################################### S26 # Reformat local addresses so easily recognized. R<@$=w>$+ <>,@$1$2 Reformat locals R<>,@$+$=Y$+ <>,$3 for easy recognition # Search for possible global alias R<$+>$=Y$~A$* $:<$1>$2$3$4?$>4$>25<$1>,$3$4 externalize R<$+>$+?$+ $:<$1>$2?$3?$(@ $3 $: $) search aliases R<$+>$+?$+?$+ <>,$3 Found, format as local R$+?$* $1 not found, remove marks # Deliver to locals right away R<>,$+ $#LOCAL $@$w $:$1 local user ### ### Determine delivery over specific media ### R<@$-$*>$+ $:<@$1?$2>$3?$(M$1$2$:$) search mailer table R<@$+?.$-$*>$+? <@$1.$2?$3>$4?$(M.$2$3$@$1$:$) Try partial domains. R<@$+?$*>$+?$-:$+ $#$4 $@$5 $:$>28 <@$1$2>$3 relativize & return R<@$+?$*>$+?$-,$+ $#$4 $@$5 $:<@$1$2>$3 return no-relativize R<$+>$=Y@$+$=Y$+?LOCAL!$+ $@$>26$>8$>7<@$3$4$5> Strip host from local R<$+>$=Y$+?$-!$+ $#$4 $@$5 $:$>7 <$3> relativize UUCP style R<@$+?$*>$+?:$* $@<@$1$2>$3 Null mailer, return. # Hint. Selecting Null mailer from mailertable forces pathalias lookup # even if there is a valid TCP or UUCP route. R<@$+?$*>$+?$+ $#ERROR $:$4 Bad entry - error. # Hint. Above rule can bounce mail to specific hosts or domains. R<@$+?$*>$+?$* $:<@$1$2>$3 no match, remove mark ### ### Determine delivery over TCP/IP ### R<@[$+.$+]>$=Y$+ $#TCP $@[$1.$2] $:$>7 <$4> Handle numeric IN addr. R<@$*$=I>$+ ?<@$1$2>$3?$1$2 Flag for TCP mailer. R?<@$*$=P>$+?$+ <@$1$2>$3 No TCP for pseudodomain R?<@$+>$+?$+ $:?<@$1>$2?$[$1$:$] Lookup nameserver R?<@$+>$+? <@$1>$2 Failed - remove mark R?<@$+>$+?$+ $#TCP $@$3 $:<@$1>$2 Success - send off. ### ### Determine delivery over UUCP ### (Can't use ruleset 28 since we need to relativize immediate users) ### R<@$=U.UUCP>$=Y$+ $#UUCP $@$1 $:$>7<$3> relativize & send. ######################################################################### # # # Rule Set #28: One-level route stripper # # # # Remove immediate host for routed addresses. Typically used # # in ruleset 26 to produce a recipient relative to the immediate # # host. Only to be used for routed full domains. # # # ######################################################################### S28 R<$=X$+>$=Y@$+$=Y$+ $:<$1$4>$5$6 relativize & return ######################################################################### # # # Rule Set #29: Multi-level self route stripper # # # # Remove immediate host for routed addresses if it is self. # # Typically used in ruleset 0 to remove superfluous routing # # info and produce a path relative to this host. # # # ######################################################################### S29 #R$*/$* $@$1/$2 Don't touch file name. R<$=X$=w>$=Y@$+$=Y$+ $>8<$1$4>$5$6 Strip this host. # Might be us as numeric internet [...] address. We only consider recipients. R<@[$+.$+]>$+ $:<@[$1.$2]>$3?$[ [$1.$2] $] Might be us numerically R<@$+>$=Y@$+$=Y$+?$=w $@$>29$>8 <@$3>$4$5 Remove routed [self] R<@$+>$=Y$+?$=w $:<>,@$1$2$3 move unrouted [self] R<$+>$+?$* <$1>$2 remove marker.