sources-request@panda.UUCP (10/14/85)
Mod.sources: Volume 3, Issue 23 Submitted by: Gene Spafford <ihnp4!gatech!spaf> #! /bin/sh # Make a new directory for these sources, cd to it, and run kits 1 thru 3 # through sh. When all 3 kits have been run, read README. echo "This is GaTech Sendmail kit 1 (of 3). If kit 1 is complete, the line" echo '"'"End of kit 1 (of 3)"'" will echo at the end.' echo "" export PATH || (echo "You didn't use sh, you clunch." ; kill $$) echo Extracting PATCHES cat >PATCHES <<'!STUFFY!FUNK!' From: topaz!hedrick 17 Sept 1985 Here are some patches to SENDMAIL. 1) They allow us to handle an Arpanet host table containing names like topaz.rutgers.edu. The original version of sendmail, as well as sendmail.cf, assumed that all host names end in .arpa. Changes may also be needed in UUCP and net news if your site name does not end in .ARPA. 2) They allow you to translate all host names to their canonical forms, i.e. replace nicknames with the primary name. This is now considered the correct thing to do on the Arpanet. This adds an operator, $%, for doing the mapping. WARNING: $% uses a single fixed location for the translated address. Thus only one translated address may be active at a time. This is fine for foo@bar, but you could not normalize all of the host names in an address like @foo,@bar:bar@gorp. In practice I don't believe this is a problem. 3) They allow you to make processing depend upon whether mail arrived via UUCP or TCP. In addition to the patches here, you will need to modify rmail, or whatever program calls sendmail to delivery UUCP mail. It should call sendmail with an extra argument, -pUUCP. This adds an operator, $&, for evaluating macros at runtime instead of when sendmail.cf is loaded. It adds an option to sendmail, -p, to specify the protocol name. It implements $r, which is documented in the source but never actually implemented. It is the name of the protocol via which mail arrived. $r is set from the -p option, or by the SMTP daemon code, which automatically sets it to the value TCP. The code for reading and writing queue files saves the protocol in a line beginning with O. In case a message gets queued, this allows us to remember which way it arrived. Originally, SENDMAIL would tack .ARPA onto your host name. This is a bad idea, since not all host names end in .ARPA. The assumption was that your rc file said hostname foo and this would turn it into foo.arpa. We now do hostname foo.rutgers.edu and do not want .ARPA tacked on the end. *** daemon.c.ORIG Fri Feb 10 06:59:21 1984 --- daemon.c Sat Aug 3 07:49:46 1985 *************** *** 183,189 /* determine host name */ hp = gethostbyaddr(&otherend.sin_addr, sizeof otherend.sin_addr, AF_INET); if (hp != NULL) ! (void) sprintf(buf, "%s.ARPA", hp->h_name); else /* this should produce a dotted quad */ (void) sprintf(buf, "%lx", otherend.sin_addr.s_addr); --- 185,191 ----- /* determine host name */ hp = gethostbyaddr(&otherend.sin_addr, sizeof otherend.sin_addr, AF_INET); if (hp != NULL) ! (void) sprintf(buf, "%s", hp->h_name); else /* this should produce a dotted quad */ (void) sprintf(buf, "%lx", otherend.sin_addr.s_addr); *************** The following patches add two operators: $% and $&. $% is used to map host names into their canonical forms. Suppose a user sends mail to RED. This should be turned into the official name, RED.RUTGERS.EDU, in the headers. The fact that Unix does not do that causes problems to a number of mailers. It is a violation of the standards. $%n behaves like $n, i.e. it is replaced with the nth thing on the left hand side. However before doing the replacement, the thing is looked up in /etc/hosts. If it is a host name or nickname, the official form of the host name is used instead. $& is part of a change to allow us to differentiate between UUCP and TCP mail. What does foo!bar@baz mean? If the mail arrived via UUCP, it is probably foo!<bar@baz>. If it arrived via TCP, it is by definition <foo!bar>@baz. As we are a UUCP/TCP gateway, it is important for us to get these things right. In order to do so, we have done two things: - implemented $r. This is documented as being the name of the protocol via which the message arrived. However this was not implemented. I implement it as follows: - rmail calls sendmail with an option -pUUCP - the sendmail daemon code sets TCP automatically - everything else should be local mail, and does not set any value in this macro. - when a queue entry is written, the protocol name must be written out - implemented a new operator $& to allow us to use the value of $r in productions. You can't just use $r on the right side of a production. It will be evaluated when the freeze file is made. So $&r is equivalent to $r, but is evaluated when the rule is executed. This allows us to write rules that differentiate. Here is the part of sendmail.cf that uses it. It checks for foo!bar, but only if the message arrived via UUCP. Note the use of $&r to put the protocol name into the address, so we can match on it. R$-!$* $:<$&r>$1!$2 check arriving protocol R$-^$* $:<$&r>$1^$2 both syntaxes R<UUCP>$-!$* $@$>7$2<@$1.UUCP> if via UUCP, resolve R<UUCP>$-^$* $@$>7$2<@$1.UUCP> if via UUCP, resolve R<$*>$* $2 undo kludge *** main.c.ORIG Fri Feb 10 11:17:52 1984 --- main.c Mon Aug 26 04:10:51 1985 *************** *** 320,325 OpMode = MD_INITALIAS; break; # endif DBM } } --- 320,328 ----- OpMode = MD_INITALIAS; break; # endif DBM + case 'p': /* set protocol used to receive */ + define('r', &p[2], CurEnv); + break; } } *************** *** 538,543 /* at this point we are in a child: reset state */ OpMode = MD_SMTP; (void) newenvelope(CurEnv); openxscript(CurEnv); #endif DAEMON } --- 541,547 ----- /* at this point we are in a child: reset state */ OpMode = MD_SMTP; (void) newenvelope(CurEnv); + define('r',"TCP",CurEnv); openxscript(CurEnv); #endif DAEMON } *************** *** 701,706 /* and finally the conditional operations */ '?', CONDIF, '|', CONDELSE, '.', CONDFI, '\0' }; --- 705,716 ----- /* and finally the conditional operations */ '?', CONDIF, '|', CONDELSE, '.', CONDFI, + + /* now the normalization operator */ + '%', NORMREPL, + + /* and run-time macro expansion */ + '&', MACVALUE, '\0' }; *** parseaddr.c.ORIG Fri Feb 10 06:59:12 1984 --- parseaddr.c Mon Aug 26 04:44:15 1985 *************** *** 394,400 expand("$o", buf, &buf[sizeof buf - 1], CurEnv); (void) strcat(buf, DELIMCHARS); } ! if (c == MATCHCLASS || c == MATCHREPL || c == MATCHNCLASS) return (ONE); if (c == '"') return (QST); --- 394,401 ----- expand("$o", buf, &buf[sizeof buf - 1], CurEnv); (void) strcat(buf, DELIMCHARS); } ! if (c == MATCHCLASS || c == MATCHREPL || c == MATCHNCLASS || ! c == MACVALUE || c == NORMREPL ) return (ONE); if (c == '"') return (QST); *************** *** 446,451 # define MAXMATCH 9 /* max params per rewrite */ rewrite(pvp, ruleset) char **pvp; --- 447,453 ----- # define MAXMATCH 9 /* max params per rewrite */ + char hostbuf[512]; rewrite(pvp, ruleset) *************** *** 447,452 # define MAXMATCH 9 /* max params per rewrite */ rewrite(pvp, ruleset) char **pvp; int ruleset; --- 449,455 ----- char hostbuf[512]; + rewrite(pvp, ruleset) char **pvp; int ruleset; *************** *** 626,631 /* substitute */ for (avp = npvp; *rvp != NULL; rvp++) { register struct match *m; register char **pp; --- 629,635 ----- /* substitute */ for (avp = npvp; *rvp != NULL; rvp++) { + #include <netdb.h> register struct match *m; register char **pp; char **oldavp,**tavp; *************** *** 628,633 { register struct match *m; register char **pp; rp = *rvp; if (*rp != MATCHREPL) --- 632,640 ----- #include <netdb.h> register struct match *m; register char **pp; + char **oldavp,**tavp; + struct hostent *hostpt; + extern char *macvalue(); rp = *rvp; if ((*rp != MATCHREPL) && (*rp != NORMREPL)) *************** *** 630,636 register char **pp; rp = *rvp; ! if (*rp != MATCHREPL) { if (avp >= &npvp[MAXATOM]) { --- 637,643 ----- extern char *macvalue(); rp = *rvp; ! if ((*rp != MATCHREPL) && (*rp != NORMREPL)) { if (avp >= &npvp[MAXATOM]) { *************** *** 637,643 syserr("rewrite: expansion too long"); return; } ! *avp++ = rp; continue; } --- 644,655 ----- syserr("rewrite: expansion too long"); return; } ! if (*rp == MACVALUE) { ! if (macvalue(rp[1],CurEnv)) ! *avp++ = macvalue(rp[1],CurEnv); ! } ! else ! *avp++ = rp; continue; } *************** *** 642,647 } /* substitute from LHS */ m = &mlist[rp[1] - '1']; # ifdef DEBUG if (tTd(21, 15)) --- 654,660 ----- } /* substitute from LHS */ + m = &mlist[rp[1] - '1']; # ifdef DEBUG if (tTd(21, 15)) *************** *** 658,663 } # endif DEBUG pp = m->first; while (pp <= m->last) { if (avp >= &npvp[MAXATOM]) --- 671,677 ----- } # endif DEBUG pp = m->first; + oldavp = avp; while (pp <= m->last) { if (avp >= &npvp[MAXATOM]) *************** *** 666,671 return; } *avp++ = *pp++; } } *avp++ = NULL; --- 680,695 ----- return; } *avp++ = *pp++; + } + if (*rp == NORMREPL) { + hostbuf[0] = '\0'; + for (tavp = oldavp; tavp < avp; tavp++) + strcat(hostbuf,*tavp); + hostpt = gethostbyname(hostbuf); + if (hostpt) { + *oldavp = hostpt -> h_name; + avp = oldavp + 1; + } } } *avp++ = NULL; *** queue.c.ORIG Fri Feb 10 06:59:20 1984 --- queue.c Mon Aug 26 04:45:19 1985 *************** *** 105,110 /* output creation time */ fprintf(tfp, "T%ld\n", e->e_ctime); /* output name of data file */ fprintf(tfp, "D%s\n", e->e_df); --- 105,115 ----- /* output creation time */ fprintf(tfp, "T%ld\n", e->e_ctime); + /* output protocol */ + if (macvalue('r',e)) { + fprintf(tfp, "O%s\n", macvalue('r',e)); + } + /* output name of data file */ fprintf(tfp, "D%s\n", e->e_df); *************** *** 565,571 /* ** Open the file created by queueup. */ ! p = queuename(e, 'q'); f = fopen(p, "r"); if (f == NULL) --- 570,576 ----- /* ** Open the file created by queueup. */ ! p = queuename(e, 'q'); f = fopen(p, "r"); if (f == NULL) *************** *** 575,580 } FileName = p; LineNumber = 0; /* ** Read and process the file. --- 580,586 ----- } FileName = p; LineNumber = 0; + define('r',NULL,e); /* ** Read and process the file. *************** *** 595,600 (void) chompheader(&buf[1], FALSE); break; case 'M': /* message */ e->e_message = newstr(&buf[1]); break; --- 601,610 ----- (void) chompheader(&buf[1], FALSE); break; + case 'O': + define('r',newstr(&buf[1]),e); + break; + case 'M': /* message */ e->e_message = newstr(&buf[1]); break; *************** *** 628,634 break; } } - FileName = NULL; } /* --- 638,643 ----- break; } } FileName = NULL; } /* *** sendmail.h.ORIG Fri Feb 10 06:59:10 1984 --- sendmail.h Sat Aug 3 05:06:53 1985 *************** *** 290,295 # define CONDIF '\031' /* conditional if-then */ # define CONDELSE '\032' /* conditional else */ # define CONDFI '\033' /* conditional fi */ /* ** Symbol table definitions */ --- 290,300 ----- # define CONDIF '\031' /* conditional if-then */ # define CONDELSE '\032' /* conditional else */ # define CONDFI '\033' /* conditional fi */ + + /* normalize Internet address operator */ + # define NORMREPL '\034' /* normalized host replacement */ + # define MACVALUE '\035' /* run-time macro value */ + /* ** Symbol table definitions */ !STUFFY!FUNK! echo Extracting README cat >README <<'!STUFFY!FUNK!' The files in this package build the sendmail.cf files for machines at Georgia Tech. They are derived from the standard BSD 4.2 sendmail files, and form a set of sendmail files we received along with PMDF from the folks at CSNet. The CSNet set of files were put together by Ray Essick (essick@uiucdcs) and were a great help in putting this package together. Many of the individual rules were derived from various sources posted to the Usenet net.mail and net.sources newsgroups. Credit is also due Rick Adams at seismo.css.gov for his continued comments and help in debugging some of headers, and to Stuart Stirling at emory.CSNET for help with some of the initial debugging. Contained in this package are the following: 1) MANIFEST which lists each file in the package, along with a one line description of what it does; 2) KEY which describes macros used in the sendmail files; 3) source and Makefiles for building our various sendmail.cf files; 4) overview.ms, a paper describing how mail gets routed when mailed to or through gatech (nroff -ms overview.ms | more); 5) uumail.c, the source to our rerouting mailer ("pathalias", which is used to build the mailer database, has been posted multiple times to the net and is not included). See the comments at the beginning of the program before your try to install it; 6) PATCHES, which is a set of changes to the sendmail code, developed at Rutgers, and needed to be implemented to make these sendmail rules work optimally. Make sure to read about the corresponding change to "rmail" described in the comments. 7) Files, which is a brief list of the data files which are present to drive the sendmail on "gatech". The remainder of this file is an overview of the environment in which these files were developed and are used. The machines using "sendmail" at Georgia Tech fall into 3 basic categories: gateway ("gatech"), department machines on a common ethernet ("stratus", "nimbus", et.al.), and campus machines not on the same Ethernet as "gatech" (only "gt-cmmsr" so far). We have at least one Ethernet loop on campus which is separate from the ICS loop ("gtss", "gtqo", et. al.). "gatech" is intended to be the campus gateway machine. It is on the ICS common ethernet, has over 50 major uucp contacts known to the outside world, has a CSNet connection, a number of direct asynchronous links, and a set of rotored phone lines. Sometime in the not-too-distant future, it is possible that "gatech" will also be on the Arpanet and/or Bitnet. It is also the "traditional" mail address known to most outsiders. Thus, the machine is on 3 distinct networks, and has to be configured with the possibility of connecting to at least 1 other major international network in the near future. The department machines currently are comprised of the Clouds research machines "gt-stratus", "gt-cirrus", and "gt-nimbus", and the ICS/OCS Pyramid "gitpyr". They are connected via a common ethernet link, and they all can speak TCP at each other. Other machines are expected to be added to this group before long. Almost all of these machines have a single phone line and/or direct links for uucp to machines that can't speak TCP. (We are trying to keep a consistant naming scheme in use, and thus all campus machines will henceforth be named with the prefix "gt-" in the name. There are a few machines around which had established UUCP networks connections with different names before the decision to use this standard came into being, and their names will probably not change (e.g., "gitpyr").) The third class of machine on campus runs sendmail but has no TCP connection to the others because our Net/One bridge won't pass TCP packets across the backbone. These sites use a phone line or Net/One virtual circuit to connect to "gatech" and some of the other systems. Some of these machines may talk to each other via Ethernet, but there is no common connection amongst all of them. The basic idea in our configuration is for users to be able to use addresses of the forms: site!user, site!site2!user, user@site.UUCP user@site.CSNET, user@site.ARPA, user@site.MAILNET, user@site.BITNET user@site.DEC and the local case: user@site.GTNET, site:user, user%site We'd also like to be able to use just "user@site" and let the mailer figure it out. Here's how my sendmail files accomplish that: All of the internal machines are simple: they merely canonicalize the address according to standard rule, look to see if it is a GTNET host that they know and send the letter straight to that host. Local letters are handled appropriately. Any other address which looks like a network address is sent to the relay site, "gatech", except that each machine can have a small number of direct UUCP connections to outside machines. Ruleset zero for these systems check for these UUCP connections. Note that we use a file (/usr/lib/mail/uucp.local) to hold the UUCP connection list so that we don't have to play around with the actual sendmail configuration if we change contacts. The only thing one has to do to update the list of UUCP connections available on that host is update the file. If you run with a frozen sendmail.cf, you also have to type "/usr/lib/sendmail -bz". The "gatech" machine is the complex one. Any address that the internal machines are unable to handle gets bounced to this machine. The "gatech" machine speaks to a plethora of people. "gatech" should be able to recognize and route any (valid) address. The "gatech" machine compares UUCP addresses against a file similarl to the way the other machines handle them. Mail to the CSNET domain is sent to the PMDF mailer, which queues the letter for phone transmission to the CSnet-relay host. Mail to the ARPA domain, since we have no direct ARPA connection (yet), is handed to the PMDF mailer for transmission to the CSnet-relay, which is an ARPA host. Mail to the BITNET (IBM derivative) and MAILNET (through MIT-multics) machines are routed to the host defined by the $B and $M macros. Mail to the DEC E-net is routed to the site listed in the $E macro, currently "decwrl.arpa". Mail to the OZ network (Australia) is routed to munnari.uucp ($Z). Since we do not have connections to any of those networks, we instead append the address of a known gateway to the address forming something like: user@host.mailnet@mit-multics.arpa and then re-iterate through ruleset 0 to get from our machine to the gateway. Any address without a domain gets converted into an address of the form "user@site", and it makes an attempt to intuit the domain. This is done by checking (in order) the list of local sites, local uucp contacts (1 hop), CSNET, ARPA, BITNET, UUCP, and DEC E-net sites. In the event of a match, the proper domain name is appended to the address and we re-iterate through ruleset zero. This catches a fair number of missing domain problems and hasn't caused too much confusion about names in use in several domains. Finally, the "gatech" machine takes any left-over non-local names and returns them to the sender with a message about the fact that there is an unknown host/domain name in his letter. The UUCP mailer on "gatech" is a re-routing mailer. Any path or address handed to "uumail" gets an "optimal" path supplied to it. That is, the program steps through the address from ultimate destination to beginning, and if it knows a path to that site it will substitute that path for the remainder of the user-supplied path. For example, if the address "a!b!c!d!e!f" is provided to the mailer, and it knows how to get to site "d" via "z!y" (but no idea how to get to "e"), it will rewrite the path to be "z!y!d!e!f". The path database is built using "pathalias" on the uucp map data obtained from the Usenix machine ("gatech" is a regional repository of UUCP map information and gets near-synchronous copies of map updates). The ruleset along with "uumail" rewrites the "To:" field to look like "f@e.UUCP" since the user-supplied address-path is probably not the path that the mailer is going to use. Note that this means that "uumail.m4" and "uucpm.m4" are NOT identical in function -- beware if you decide to use one of them as a base in building your own files. "uucpm.m4" does not muck about with the "To:" field, nor does it reroute mail. This uucp mechanism allows any of our users to simply address mail to "foo@site.UUCP" and not worry about a path. It also optimizes message paths provided when answering news articles, and it allows our neighbors without mail routing software to address mail to "gatech!somesite!person" and expect the mail to get through, if possible. So far, no one has complained about not being able to force a particular path through our mailer. In the 6+ months this mechanism has been working, I've only discovered about 6 sites not registered with the map project and thus ccausing mail to them to fail. That's about it. If you find these useful in some way, great. If you should find bugs or possible enhancements to these files, I would greatly appreciate hearing about it. ---- Gene Spafford The Clouds Project, School of ICS, Georgia Tech, Atlanta GA 30332 CSNet: Spaf @ GATech ARPA: Spaf%GATech.CSNet @ CSNet-Relay.ARPA uucp: ...!{akgua,allegra,hplabs,ihnp4,linus,seismo,ulysses}!gatech!spaf !STUFFY!FUNK! echo Extracting Files cat >Files <<'!STUFFY!FUNK!' The following are the files that this particular sendmail configuration uses. These are in addition to the files /usr/lib/sendmail* and /usr/lib/aliases*. These files are normally set up in the directory /usr/lib/mail on each machine. The file uucp.local needs to be present on each machine, or else the declaration in gtbase.m4 changed so that the uucp neighbors are defined as a class macro in the individual .mc files. I chose the easy way out for here at GaTech. Each list is assumed to be one-per-line, unless otherwise stated. arpa.hosts -- a list of Arpa (EDU, DDN, etc.) hosts. This is derived from one of the hosts.txt file from the Arpa CIC. These also sometimes get posted to net.mail and/or sent out to CSNet sites from the CSNet NIC. bitnet.hosts -- a list of Bitnet hosts. This is obtained from some friendly Bitnet neighbor, or else taken from net.mail the next time it is posted there. csnet.hosts -- a list of CSNet hosts and acceptable nicknames. This can be obtained from the CSNet NIC. decnet.hosts -- a list of DEC network hostnames. This list is really a kludge and I am seriously considering removing it. DEC considers the actual list to be a company secret and so the list is by no means complete. I derived my copy from checking news paths and trading lists with other such watchers. Each entry is in the list twice -- once as "site" and once as "dec-site". This leads to some horrible name conflicts. mailnet.hosts -- a list of Mailnet hosts. I have no idea where you can get an up-to-date copy. Someone mailed me a copy a long time ago, and I haven't seen much mention since. I know next to nothing about it. uucp.hosts -- the output of pathalias when run on the uucp maps. This list is of all sites reachable via uucp, one per line, with a "sprintf" format string specifying the path on the same line, separated from the hostname by a tab. I sort mine, but I don't think it makes a difference. uucp.hosts.dir, uucp.hosts.pag -- the uucp.hosts file in dbm format after running makedb on them (makedb was part of the last pathalias release). uucp.local -- a list of all sites reachable directly via uucp from this site. That is, sites for which we have L.sys info. uumail -- the uumail program executable file. uumail.log -- a log of uucp mail passing through our site. Each line consists of the sender's address, followed by a tab, the destination address as it was presented to uumail from sendmail, a tab, and the actual path that uumail dispatched the mail along. This data can be analysed for traffic patterns, finding sites not listed in the uucp maps, and checking to see how well uumail is working. If the input to uumail generates an error, the third field is the error message generated by uumail and sent back to the "sender". !STUFFY!FUNK! echo "" echo "End of kit 1 (of 3)" cat /dev/null >kit1isdone config=true for iskit in 1 2 3; do if test -f kit${iskit}isdone; then echo "You have run kit ${iskit}." else echo "You still need to run kit ${iskit}." config=false fi done case $config in true) echo "You have run all your kits. Please read README." ;; esac : I do not append .signature, but someone might mail this. exit
sources-request@panda.UUCP (10/14/85)
Mod.sources: Volume 3, Issue 24 Submitted by: Gene Spafford <ihnp4!gatech!spaf> #! /bin/sh # Make a new directory for these sources, cd to it, and run kits 1 thru 3 # through sh. When all 3 kits have been run, read README. echo "This is GaTech Sendmail kit 2 (of 3). If kit 2 is complete, the line" echo '"'"End of kit 2 (of 3)"'" will echo at the end.' echo "" export PATH || (echo "You didn't use sh, you clunch." ; kill $$) echo Extracting overview.ms cat >overview.ms <<'!STUFFY!FUNK!' .TL Mail Handling at Gatech .br Revision II .AU Gene Spafford .AI School of Information and Computer Science Georgia Institute of Technology 23 September 1985 .PP Site "gatech" is running a "smart" version of sendmail. I have hacked at the sendmail configuration files extensively, and although they are not yet doing 100% of what I want, they seem to work pretty well and handle our many (sometimes unusual) mail needs. What follows are brief descriptions of what happens to various bits of mail passing through our site. .PP There have been some changes since the last time I circulated this document. Most of the changes have been inspired (?) by the changes to sendmail done at Rutgers which allow "sendmail" to distinguish the source of incoming mail with mixed syntax addresses (e.g., a!b@c), and which rewrite the names of Internet hosts into the preferred form (as given in the /etc/hosts table, derived from NIC data). .NH 1 Why .PP Site "gatech" is directly on the uucp network (with over 75 contacts and acting as a de facto name server for a "southeast US domain"), the CSNet, and we serve as gateway for our local networks. We also have network traffic with some other major networks, and we might possibly get BITNET and ARPA access in the not-too-distant future, from "gatech" or some other campus machines. We'd like to have as complete and robust a mailing environment as possible. At the same time, we'd like to minimize our current phone bills as they are related to UUCP mail traffic. .NH 1 Routing .NH 2 Known Domains .PP Currently, there is considerable effort going on to identify and establish domains for mailing. Some of these domains are already established, if only in a de facto manner. Our sendmail currently recognizes the following well-known domains: ARPA, CSNET, GOV, EDU, COM, MIL, ORG, NET, UUCP, BITNET, DEC, and MAILNET. The following are also recognized when used as top-level domains: GTNET (local to Georgia Tech), OZ (the Australian network), TEK (recognized internal to Tektronix), and SDC (with sdcrdcf as the gateway). .PP There are a number of other "domains" that are recognized when used in a second-level position within a uucp address. That is, we recognize person@site.ATT.UUCP as something that should be directed to cbosgd via uucp for further resolution. This recognition is done by building psuedo-sites into the uucp routing database based upon the data distributed by the uucp map project. Among domains recognized like this are NCAL, SCAL, ATL, ATT, UK, and so on; the list may change based on updates to the map. (As an aside, at the time of this writing, "gatech" is one of the regional repositories of the current map, and we get automatic updates whenever the "real" map gets changed.) .PP In the following descriptions, any of the above can be used in place of a "DOMAIN" specifier. .NH 2 user@host[.DOMAIN] -and- user%host[.DOMAIN] .PP If mail comes in addressed specifically to one of the known domains, it is routed as described in the next section without any further changes. If the domain is not given, an attempt is made to derive the domain based on available lists of host names and aliases, and then routed as described in the next section. If no host/domain match can be found, the mail is returned with an error stating this. .NH 3 Domain Derivation .PP Host derivation is attempted in the following order: First, the host is checked to see if it is in the GTNET domain. Next, the host is checked to see if it is a host one hop away via UUCP. Next, the host is checked against all CSNET sites. Then it is checked against all Arpa/Internet sites. Next, it is checked against the list of known MAILNET hosts. Then it is checked against the list of all (other) known UUCP sites. Then it is checked against the list of known BITNET hosts. Finally, it is checked against the list of known DEC E-net sites. .PP This kind of checking is not 100% accurate because our lists are not always up-to-date. In particular, the Arpa list is updated infrequently due to the fact that we aren't actually on the Arpanet, and there is no list of DEC net sites available outside of DEC (we make due with gleaning names from posted news articles and exchanges with other sites interested in compiling such a list). .NH 3 Collisions .PP If the same hostname exists in more than one domain, the first match found will be the one used. Qualification of the address with an explicit domain specifier will ensure that the mail goes to the correct host (when routed through gatech). That is, the domain is considered to be the specifer for routing and if one is not explicitly provided (or implicitly, as in the case of "!" notation), then an attempt to made to guess a domain. .NH 2 host1!host2!host3...!hostn!user .PP Starting with "hostn" and working backwards to "host1" our mailer will attempt to find a host listed in our master UUCP path database. This database is generated using pathalias at least weekly based on the latest version of the uucp maps. If a match is found at "hostk", then the address is rewritten to be "<path to hostk>!hostk!...hostn!user" and then mailed via UUCP. Such addresses are NEVER routed over any other network, unless "hostn" is recognized to be a GTNET host, in which case our internal transport mechanism is invoked. .PP There is NO way at present to force a path on UUCP mail through "gatech". This is perhaps a "not very good thing" but I can't come up with a good way to work in explicit paths. The map data is generally very good and I have observed very, very few failures since we first started doing this rewriting about 6 months ago. If this presents a major problem for someone, let me know and I'll see what I can work out. .NH 2 host1!host2!host3...!hostn!user@site[.DOMAIN] .br host1!host2!host3...!hostn!user%site[.DOMAIN] .PP This one diverges somewhat from the standard (RFC822 et.al.). The way these addresses get treated is based on the way the mail gets into our "sendmail." If the message originates on any of the local (GTNET) machines, or if it comes in via PMDF from CSNet, then the mail is routed to "site" for eventual delivery to host1!...hostn!user. Mail coming in via a UUCP link with a mixed-mode address like this will have the mail routed via uucp to hostn for eventual delivery to user@site. Thus, if one of our neighbors, such as someone at akgua, were to send mail to us addressed as seismo!person@ucbvax.ARPA, we would send the mail to seismo via uucp and present it to their "rmail" program as "rmail person@ucbvax.ARPA". .PP On the other hand, should someone on gitpyr send mail addressed as seismo!person@ucbvax.ARPA, it would arrive at Gatech via SMTP and then be sent to CSNet-relay via PMDF for delivery to site "ucbvax" with a request to be delivered to "seismo!person" relative to that site. In most cases, depending on the sites involved, this kind of treatment would result in the mail failing. The sendmail configurations I have created for all the local GTNET sites are such that it should not be required to specify such an address. Simply mailing to person@site should see the correct address and network transport mechanism chosen. The Usenet "news" programs on most of these sites have been built to use the Internet-style of address when mailing replies, so there should be few cases of users even seeing mixed mode addresses presented to them (mail passing through any of the mailers gets rewritten to show a consistent format). .NH 2 user%site1%site2%site3 .PP Addresses of this format get turned into user%site1%site2@site3, and an appropriate routing is provided to "site3," if known. .NH 2 Other network characters .PP The ":" delimiter gets turned into "!" symbols in any address presented to our sendmail. The "^" delimiter gets turned into "!" also. Addresses of the form "site=user" get turned into "user@site.BITNET" by convention. .NH 1 Errors .PP I have tried to trap all possible errors and generate return mail with meaningful messages. If you get errors you don't know how to interpret, please contact me. .NH 1 Source .PP I posted an ancestor of my current sendmail files to "mod.sources" a few months ago. If these latest versions appear stable, I will post them to the same place. If you'd like a copy right away, let me know. This includes the sendmail files for all the local GTNET machines, and the source for my "uumail" program which sits between sendmail and uux. !STUFFY!FUNK! echo Extracting uumail.c cat >uumail.c <<'!STUFFY!FUNK!' /* uumail.c --- uucp remailer * EHS 4/2/85 * Added rebuild sentinel and better error handling 10/13/85 * * Compile as: * cc -O -s uumail.c -ldbm -o uumail * * Usage: * usually called from sendmail in the following form: * uumail -f from addr < message * "from" is the address of the sender, and is passed to "uux" * in case of a remote error * "addr" is an address in the following form: * site!site!site!user * and "user" can take on any form not containing a "!" * * If a "-D" is used instead of a "-f", no mail will be sent * and various bits of diagnostic info will be printed to the * standard error output. Messages that would normally be * printed at the console are also printed to stderr, in this * case. The body of the message is also dumped to stderr. * * At least one "!" MUST be present in the address or else it will * be considered an error. * * The address is rewritten for the first applicable site * found in the database. If the path cannot be rewritten, * an error code is returned along with a message indicating * the problem. * * If the special sentinel value of @@@ is not present in the * database, then it is assumed that the database is being * rebuilt and the requesting process is blocked for TIMEOUT * (default = 180) seconds. If, after 5 such blocks, the * sentinel is not present, an error message is logged to * the console, and the error code EX_TEMPFAIL is returned. * The same is true if the dbm files cannot be initialized. * * Note: * The "uux" flags given below are for 4.3 BSD uucp and * may not exist for your version of uucp. Note especially * that the "-L" flag may not be present in earlier versions * (meaning to crank up uucico for a local call, otherwise * just queue it). * * Special defines: * PATHFILE is the basename of the dbm path database. * LOGF if defined is where a log of uucp mail is kept * TIMEOUT is the sleep(2) time, in seconds, to wait * if the database is unavailable or incomplete. * CONSOLE is the pathname of the file to report major errors * MYSITE is the site name to be used in reporting errors * via returned mail; if not defined, the sitename is * derived from a call to gethostname(2) * UUX is a sprintf(3) format string used to remotely execute * the rmail command on the next system. * SENTINEL is the special "sitename" to look for in the * path database to indicate a complete database */ #include <ctype.h> #include <dbm.h> #include <stdio.h> #include <sysexits.h> #ifndef PATHFILE #define PATHFILE "/usr/lib/mail/uucp.hosts" #endif PATHFILE #ifndef CONSOLE #define CONSOLE "/dev/console" #endif CONSOLE FILE *console; #ifndef TIMEOUT #define TIMEOUT ((unsigned) 180) #endif TIMEOUT #ifndef UUX #define UUX "/usr/bin/uux -p -a%s -L -gM %s!rmail \\(%s\\)\n" #endif UUX #ifndef SENTINEL #define SENTINEL "@@@" #endif SENTINEL extern char *malloc (), *rindex (), *index (); extern char *strcpy (), *strcat (); extern int strlen (); extern FILE *popen (); datum key, result; char workbuf[512]; char *destination, *sender; int debug; #ifdef LOGF FILE *logfile; #endif LOGF main (argc, argv) int argc; char **argv; { register char *stp, *rtp; int indx, retval; extern void die (), checkpath (); destination = argv[3]; /* given destination (and user) */ sender = argv[2]; /* given sender */ if (argc != 4) die ("called with incorrect number of arguments.", EX_USAGE); debug = (argv[1][1] == 'D'); console = fopen (CONSOLE, "a"); if ((console == NULL) || debug) console = stderr; #ifdef LOGF logfile = fopen (LOGF, "a"); if (logfile == NULL) { fprintf (console, "\n*** uumail: Unable to open logfile %s\n", LOGF); logfile = console; } fprintf (logfile, "%s\t%s\t", sender, destination); #endif LOGF for (indx = 0; indx < 5; indx++) { if ((retval = dbminit (PATHFILE)) >= 0) break; if (debug) fprintf (stderr, "Database unavailable. Sleeping.\n"); sleep (TIMEOUT); } if (retval < 0) die ("could not open routing database files.", EX_TEMPFAIL); key.dptr = SENTINEL; key.dsize = strlen (SENTINEL) + 1; for (indx = 0; indx < 5; indx++) { result = fetch (key); if (result.dsize > 0) break; if (debug) fprintf (stderr, "Database incomplete. Sleeping.\n"); sleep (TIMEOUT); } if (result.dsize <= 0) die ("routing database files incomplete or truncated.", EX_TEMPFAIL); /* Now we back up through the address until we find a site we * know how to reach. If we don't find any, it's an error. */ strcpy (workbuf, destination); if (!(rtp = rindex (workbuf, '!'))) die ("address in improper format.", EX_DATAERR); *rtp = '\0'; while (stp = rindex (workbuf, '!')) { checkpath (rtp + 1, stp + 1, (int) (rtp - stp)); *rtp = '!'; rtp = stp; *rtp = '\0'; } checkpath (rtp + 1, workbuf, (int) (rtp - workbuf) + 1); /* If we got to here, we don't have a path */ *rtp = '!'; die ("Unable to find path to any host in pathname.", EX_NOHOST); } /* This routine does all the work. If it finds a path it immediately * will go ahead and do the mailing and exit. */ void checkpath (user, site, len) char *user, *site; int len; { FILE * pipfd; int comlen; char *address, *restol, *command; key.dptr = site; key.dsize = len; result = fetch (key); if (result.dsize <= 0) return; /* result <= 0 implies no match */ /* rewrite here */ comlen = strlen (user) + result.dsize; address = malloc ((unsigned) comlen); if (address == NULL) die ("malloc cannot get memory for new address.\n", EX_SOFTWARE); sprintf (address, result.dptr, user); #ifdef LOGF fprintf (logfile, "%s\n", address); #endif LOGF comlen = strlen (address) + strlen (UUX) + 4; command = malloc ((unsigned) comlen); if (command == NULL) die ("malloc cannot get memory for uux command line.\n", EX_SOFTWARE); if ((restol = index (address, '!')) != NULL) *restol++ = '\0'; sprintf (command, UUX, sender, address, restol); if (debug) { fprintf (stderr, "Command that would be executed: %s\n", command); pipfd = stderr; } else { pipfd = popen (command, "w"); if (pipfd == NULL) die ("cannot open pipe with popen(3).", EX_SOFTWARE); } while (fgets (workbuf, sizeof (workbuf), stdin)) fputs (workbuf, pipfd); comlen = debug == 0 ? pclose (pipfd) : 0; if (comlen) { sprintf (workbuf, "execution of uux returned with error status %d", comlen); die (workbuf, EX_UNAVAILABLE); } exit (EX_OK); } void die (message, errcode) char *message; int errcode; { #ifdef MYSITE char *mysite = MYSITE; #else char mysite[64]; gethostname (mysite, 64); #endif #ifdef LOGF fprintf (logfile, "Error: %s\n", message); #endif LOGF fprintf (console, "\n\07*** Error in uumail!\n"); fprintf (console, " %s\n", message); fprintf (console, " Mail from %s to %s being returned.\n\n", sender, destination); fprintf (stderr, "Mailer at \"%s\": %s\n", mysite, message); exit (errcode); } !STUFFY!FUNK! echo Extracting base.m4 cat >base.m4 <<'!STUFFY!FUNK!' ############################################################ # # General configuration information # # This information is basically just "boiler-plate"; it must be # there, but is essentially constant. # # Information in this file should be independent of location -- # i.e., although there are some policy decisions made, they are # not specific to Gatech per se. # # $Header: base.m4,v 5.1 85/10/13 20:45:34 spaf Release $ # ############################################################ include(version.m4) ########################## ### Special macros ### ########################## # my name DnMAILER-DAEMON # UNIX header format DlFrom $g $d # delimiter (operator) characters Do.:%@!^=/[] # format of a total name Dq$?x$x $.<$g> # 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 OL2 # 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 OT5d # time zone names (V6 only) OtEST,EDT # default UID Ou1 # wizard's password OWa/FjIfuGKXyc2 ############################### ### Message precedences ### ############################### Pfirst-class=0 Pspecial-delivery=100 Pjunk=-100 ######################### ### Trusted users ### ######################### Troot Tdaemon Tuucp Tnetwork ############################# ### 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: HPosted-Date: $a # H?l?Received-Date: $b # H?M?Resent-Message-Id: <$t.$i@$j> H?M?Message-Id: <$t.$i@$j> ########################### ### Rewriting rules ### ########################### ################################ # Sender Field Pre-rewriting # ################################ S1 ################################### # Recipient Field Pre-rewriting # ################################### S2 ################################# # Final Output Post-rewriting # ################################# S4 R@ $@ handle <> error addr # externalize local domain info R$*<$*LOCAL>$* $1<$2$D>$3 change local info R$*<$+>$* $1$2$3 defocus R$*$=S:$* $1$2!$3 R@$+:$+:$+ $@@$1,$2:$3 <route-addr> canonical # delete duplicate local names -- mostly for arpaproto.mc R$+%$=w@$=w $1@$3 u%UCB@UCB => u@UCB R$+%$=w@$=w.$=D $1@$3.$D u%UCB@UCB => u@UCB # clean up uucp path expressions (some) R$*!$*@$*.UUCP $3!$1!$2 ########################### # Name Canonicalization # ########################### S3 # handle "from:<>" special case R<> $@@ turn into magic token R$*$=S:$=S$* $1$3$4 R$*$=S!$=S$* $1$3$4 # 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 # Handle special case of received via uucp R$-!$* $:<$&r>$1!$2 check arriving protocol R$-^$* $:<$&r>$1!$2 both syntaxes R<UUCP>$-!$* $@$>6$2<@$1.UUCP> if via UUCP, resolve R<$*>$* $2 undo kludge 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 R$+<@$+%$+> $1%$2<@$3> fix user%host1%host2 R$+<@$+> $@$>6$1<@$2> leave R$-:$+ $@$>6$2<@$1> host:user R$-.$+ $@$>6$2<@$1> host.user R$+^$+ $1!$2 convert ^ to ! R$-!$+ $@$>6$2<@$1.UUCP> resolve uucp names R$-=$+ $@$>6$2<@$1.BITNET> resolve bitnet names !STUFFY!FUNK! echo Extracting MANIFEST cat >MANIFEST <<'!STUFFY!FUNK!' After all the sendmail kits are run you should have the following files: Filename Kit Description -------- --- ----------- Files 1 Description of auxillary files in /usr/lib/mail KEY 3 Describes some of the macros and classes we use. MANIFEST 2 This file: directory of files. Makefile 3 Processes all our files. PATCHES 1 Some source code changes for sendmail and rmail README 1 Description of what files are and what they do. base.m4 2 "basic" information included with all configurations. cirrus.mc 3 Master configuration file for gt-cirrus Clouds machine. csether.m4 3 ICS ethernet definitions. etherm.m4 3 Actual definition of the Ethernet mail "channel". gatech.mc 3 Master configuration file for our main relay machine. gitpyr.mc 3 Master configuration file for ICS/OCS Pyramid. gt-cmmsr.mc 3 Master configuration file for MMR Vax. gtbase.m4 3 Specifics for GT mail. gtqo.mc 3 Master configuration for Physics Sun. gtss.mc 3 Master configuration for Physics Sun. localm.m4 3 Actual definition of the "local" mail channel. nimbus.mc 3 Master configuration for gt-nimbus Clouds machine. overview.ms 2 A description of mail routing and address munging pmdfm.m4 2 Definition of the pmdf mail "channel". short2.m4 3 Short ruleset 0 used by non-ICS sites. short3.m4 3 Short ruleset 0 used by Physics sites (Suns on ethernet). shortzero.m4 3 Short ruleset 0 used in ICS department sites. stratus.mc 3 Master configuration file for gt-stratus Clouds machine. uucpm.m4 3 Definition of the uucp mail "channel". uumail.c 2 Source for the uumail program (read the comments at the top) uumail.m4 3 Definition of the uucp optimizing mailer used on "gatech" version.m4 3 Define the sendmail version. zerobase.m4 3 Machine independent preamble for ruleset 0. !STUFFY!FUNK! echo Extracting pmdfm.m4 cat >pmdfm.m4 <<'!STUFFY!FUNK!' ############################################################ ############################################################ ##### ##### PMDF Phonenet Channel Mailer specification ##### ##### $Header: pmdfm.m4,v 5.1 85/10/13 20:46:01 spaf Release $ ##### ############################################################ ############################################################ Mpmdf, P=/usr/local/lib/pmdf/pmdf-submit, F=mDsFSn, S=17, R=17, M=65535, A=pmdf-submit -f $g $u # # Notice that the PMDF mailer DOES NOT USE the host field. We # set this host field to "CSNET-RELAY" in all instances where # we call the PMDF mailer so as to be able to send one copy # of a letter with a number of recipients. # S17 # pass <route-addr>'s through R<@$+>$* $@<@$1>$2 resolve <route-addr> # map colons to dots everywhere..... R$*:$* $1.$2 map colons to dots # handle the simple case.... R$+<@$+.$=K> $@$>18$1<@$2.$3> user@host.ARPA R$+<@$-.CSNET> $@$1<@$2.CSNET> user@host.CSNET R$+<@LOCAL> $@$1<@$R.CSNET> local names R$+<@$+.LOCAL> $@$1%$2<@$R.CSNET> local notes R$+<@$*$=S> $@$1%$2$3<@$R.CSNET> more local hosts # handle other external cases R$+<@$=X> $@$1<@$2.UUCP> R$+<@$-> $@$1<@$2> R$+<@$+.$-.$=T> $@$1%$2<@$3.$4> approximate something R$+<@[$+]> $@$1<@[$2]> already ok # convert remaining addresses to old format and externalize appropriately # We try to do nifty things to uucp addresses first R$+<@$-.UUCP> $2!$1 R$+!$+!$+ $2!$3 R$+!$+ $@$2@$1.UUCP R$-:$+ $@$1.$2<@$A> convert berk hosts R$+<@$+> $@$1%$2<@$A> pessmize R$+ $:$1<@$R.CSNET> tack on our hostname R$+%$=A<@$A> $1<@$2> strip out unneeded relay S18 R$*<$+>$* $@$1<$%2>$3 !STUFFY!FUNK! echo "" echo "End of kit 2 (of 3)" cat /dev/null >kit2isdone config=true for iskit in 1 2 3; do if test -f kit${iskit}isdone; then echo "You have run kit ${iskit}." else echo "You still need to run kit ${iskit}." config=false fi done case $config in true) echo "You have run all your kits. Please read README." ;; esac : I do not append .signature, but someone might mail this. exit
sources-request@panda.UUCP (10/14/85)
Mod.sources: Volume 3, Issue 25 Submitted by: Gene Spafford <ihnp4!gatech!spaf> #! /bin/sh # Make a new directory for these sources, cd to it, and run kits 1 thru 3 # through sh. When all 3 kits have been run, read README. echo "This is GaTech Sendmail kit 3 (of 3). If kit 3 is complete, the line" echo '"'"End of kit 3 (of 3)"'" will echo at the end.' echo "" export PATH || (echo "You didn't use sh, you clunch." ; kill $$) echo Extracting gatech.mc cat >gatech.mc <<'!STUFFY!FUNK!' ############################################################ ############################################################ ##### ##### SENDMAIL CONFIGURATION FILE FOR GATECH ##### ##### This one is the big daddy. There is no "upstairs" ##### to bounce a message to -- except perhaps the CSnet ##### ##### $Header: gatech.mc,v 5.1 85/10/13 20:38:16 spaf Release $ ##### ############################################################ ############################################################ ############################################################ ### local info ############################################################ # internet hostname Cwgatech ga-tech georgia-tech # override SMTP hostname to match Arpanet name Dj$w.CSNET # Our UUCP hostname(s) DUgatech CUgatech GATech GaTech include(csether.m4) # Defined Gateway sites and so on. Hosts are listed in files. # # ARPA Gateway DAcsnet-relay FA/usr/lib/mail/arpa.hosts %s # # BITNET gateway DBwiscvm.arpa FB/usr/lib/mail/bitnet.hosts %s # # CSNET gateway DCcsnet-relay FC/usr/lib/mail/csnet.hosts %s # # Gateway to Dec E-Net DEdecwrl.arpa FE/usr/lib/mail/decnet.hosts %s # # Gateway to Mailnet. DMmit-multics.arpa FM/usr/lib/mail/mailnet.hosts %s # # UUCP network # (no gateway host) FX/usr/lib/mail/uucp.hosts %s # # OZ gateway # (no list of sites) DZmunnari.uucp # we have full sendmail support here Oa include(gtbase.m4) ################################################ ### Machine dependent part of ruleset zero ### ################################################ # Resolve names that can go via the ethernet R$*<@$*$=S.LOCAL>$* $#ether$@$3$:$1<@$2$3.$D>$4 user@etherhost # Resolve local UUCP links (all others) 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 # # Resolution of the CSNET, ARPA, BITNET and MAILNET domains should really # have some sort of provision for addresses of the form: # "@domain.XXX:rest-of-address" similar to the UUCP stuff # # Resolve ARPA names - these go by way of the PMDF mailer. # If we had an Arpa link, we'd use the TCP mailer instead. R$+<@$*.$=K> $#pmdf$@$A$:$1<@$2.$3> user@site.ARPA # Current: send BITNET mail to a known gatewaying host (wiscvm.arpa) R$+<@$*.BITNET> $@$>0$1%$2.BITNET<@$B> user@site.BITNET # Resolve mail to the CSNET domain # make sure to leave the "csnet" in the address R$+<@$*.CSNET> $#pmdf$@$C$:$1<@$2.CSNET> user@site.CSNET # Resolve addresses to the MAILNET domain - these are handled # by the site in the $M macro. We merely re-iterate rule 0 # to get to the site specified by $M. R$+<@$*.MAILNET> $@$>0$1%$2.MAILNET<@$M> user@site.MAILNET # Resolve DEC E-Net addresses R$+<@$*.DEC> $@$>0$1%$2.DEC<@$E> user@site.DEC # Resolve OZ addresses R$+<@$*.OZ> $@$>0$2.OZ!$1<@$Z> user@site.OZ # At this point we look for names of the form # user@site and see if we can intuit a domain for # "site". If so, we append the domain and try all over again. R$+<@$*$=S> $@$>0$1<@$2$3.$D> Local host R$+<@$*$=W> $@$>0$1<@$2$3.UUCP> (local) UUCP host R$+<@$*$=C> $@$>0$1<@$2$3.CSNET> CSnet host R$+<@$*$=A> $@$>0$1<@$2$3.ARPA> Arpanet host R$+<@$*$=M> $@$>0$1<@$2$3.MAILNET> Mailnet host R$+<@$*$=X> $@$>0$1<@$2$3.UUCP> (other) UUCP host R$+<@$*$=B> $@$>0$1<@$2$3.BITNET> BITNET host R$+<@$*$=E> $@$>0$1<@$3.DEC> DEC E-Net host # Error on any names with a network in them here since we couldn't # figure out where to send them. R$*<@$+>$* $#error$:Unknown host or domain in address # remaining names are local (since they aren't on any of our networks) R$+ $#local$:$1 everything else ######################################## ### Host dependent address cleanup ### ######################################## S8 R$*$=U!$+@$+ $3@$4 drop uucp forward include(uumail.m4) include(pmdfm.m4) include(etherm.m4) !STUFFY!FUNK! echo Extracting Makefile cat >Makefile <<'!STUFFY!FUNK!' ###################################################################### # # Makefile for Sendmail GaTech configuration files # # $Header: Makefile,v 5.5 85/10/13 21:17:06 spaf Release $ # ###################################################################### M4 = base.m4 csether.m4 etherm.m4 gtbase.m4 localm.m4 shortzero.m4 \ uucpm.m4 uumail.m4 version.m4 zerobase.m4 pmdfm.m4 short2.m4 \ short3.m4 MC = gatech.mc stratus.mc nimbus.mc gitpyr.mc cirrus.mc gt-cmmsr.mc \ gtss.mc gtqo.mc SRCS= $(MC) $(M4) CSALL = gatech.cf gitpyr.cf stratus.cf nimbus.cf cirrus.cf ALL = $(CSALL) gt-cmmsr.cf gtss.cf gtqo.cf GET= co .SUFFIXES: .mc .cf .mc.cf: m4 $*.mc > $*.cf all: $(ALL) shar: co -q -sRelease $(SRCS) Makefile MANIFEST README KEY PATCHES \ uumail.c overview.ms Files shar -v -pX `sed -n '5,$$s/ .*//p' MANIFEST | tr '\12' '\40'` > sendmail.shar compress -c < sendmail.shar > sendmail.shar.Z cs: $(CSALL) ############################ # special dependencies # ############################ # all computer science department hosts.... $(CSALL): csether.m4 # pessimize -- basic dependencies $(ALL): base.m4 localm.m4 uucpm.m4 version.m4 zerobase.m4 gtbase.m4 # hosts using MMDF/PMDF gatech.cf: pmdfm.m4 # Hosts using Ethernet/SMTP $(CSALL): etherm.m4 gtss.cf gtqo.cf: etherm.m4 # Hosts using optimized uucp mailer gatech.cf: uumail.m4 # Hosts using short definition stratus.cf: shortzero.m4 nimbus.cf: shortzero.m4 cirrus.cf: shortzero.m4 gitpyr.cf: shortzero.m4 # Other cases gt-cmmsr.cf: short2.m4 gtss.cf gtqo.cf: short3.m4 # Specifics on hosts gatech.cf: gatech.mc gitpyr.cf: gitpyr.mc stratus.cf: stratus.mc nimbus.cf: nimbus.mc cirrus.cf: cirrus.mc gt-cmmsr.cf: gt-cmmsr.mc gtss.cf: gtss.mc gtqo.cf: gtqo.mc ##################### # administrivia # ##################### sources: $(SRCS) $(SRCS): $(GET) $@ README MANIFEST overview.ms KEY Makefile Files: $(GET) $@ clean: rm -f *.cf a.out core make.out Make.errs !STUFFY!FUNK! echo Extracting gtbase.m4 cat >gtbase.m4 <<'!STUFFY!FUNK!' ################################################# # # General configuration information and so on # Specific to GaTech sites # # $Header: gtbase.m4,v 5.1 85/10/13 20:45:55 spaf Release $ # ################################################# ###################### # General Macros # ###################### # local domain names DDGTNET CDgtnet GTNET GTNet GtNet GTnet # My "top-level" domain (seen on Gatech) DTCSNET # major relay host DRgatech CRgatech GATECH GATech Gatech GaTech GAtech # and forwarding host for ether mail DFgatech # my official hostname Dj$w.$D # known top-level domains CTARPA UUCP BITNET CSNET MAILNET DEC EDU GOV MIL COM ORG NET OZ # known Internet domains (we send on as if ARPA) CKARPA EDU GOV MIL COM ORG NET # UUCP hosts that we talk to FW/usr/lib/mail/uucp.local include(base.m4) ####################### # Rewriting rules # ####################### ##### special local conversions S6 # Recognize "old" syntax mistakes, like UUCP specifications of Ethernet # hosts R$*<@$=W>$* $1<@$2.UUCP>$3 R$*<@$=S.UUCP> $1<@$2.$D> uucp-isms # R$*<@$*$=D>$* $1<@$2LOCAL>$4 convert local domain R$*<@$=S>$* $1<@$2.LOCAL>$3 user@localhost R$*<@$+$=S>$* $1<@$2$3.LOCAL>$4 user@host.subdomain R$*<@$*$=D.$=T>$* $1<@$2LOCAL>$4 catch "gtnet.csnet" R$*<@LOCAL> $1 degenerate case R$+%$+<@$R.LOCAL> $1<@$2.LOCAL> hacks for % syntax R$+%$=S<@$=S.LOCAL> $1<@$2.LOCAL> relayed internally R$*<@$+.$=D.$=D>$* $1<@$2.$3>$5 make gtnet top level include(localm.m4) include(zerobase.m4) !STUFFY!FUNK! echo Extracting KEY cat >KEY <<'!STUFFY!FUNK!' USES FOR MACROS AND CLASSES MACROS CLASSES ====== ======= A arpanet relay known arpanet hosts B Bitnet relay (wiscvm.arpa) known BITNET hosts C CSnet-relay known CSnet hosts - - - - - - - - - - - - - - - - - - - - - - - - - - D full local domain name (bottom) local domain names E Decwrl.arpa list of DEC E-net sites F forwarding host, $R default hosts that we cannot talk directly to - - - - - - - - - - - - - - - - - - - - - - - - - - G H internet name all names this host is known by I - - - - - - - - - - - - - - - - - - - - - - - - - - J K all known Internet domains L - - - - - - - - - - - - - - - - - - - - - - - - - - M Mailnet relay site known Mailnet hosts N O - - - - - - - - - - - - - - - - - - - - - - - - - - P Q R Relay-host Relay-host nicknames - - - - - - - - - - - - - - - - - - - - - - - - - - S known SMTP partners T Outside domain Top level domains U (local) uucp name (local) uucp nicknames - - - - - - - - - - - - - - - - - - - - - - - - - - V Version number W Local machine with UUCP links uucp sites on $W machine X Known UUCP hosts - - - - - - - - - - - - - - - - - - - - - - - - - - Y other machine with UUCP links UUCP hosts connected to $Y machine Z OZ gateway (munnari) !STUFFY!FUNK! echo Extracting zerobase.m4 cat >zerobase.m4 <<'!STUFFY!FUNK!' ############################################################ ############################################################ ##### ##### RULESET ZERO PREAMBLE ##### ##### The beginning of ruleset zero is constant through all ##### configurations. ##### ##### $Header: zerobase.m4,v 5.1 85/10/13 20:46:24 spaf Release $ ##### ############################################################ ############################################################ S0 # first make canonical R$*<$*>$* $1$2$3 defocus R$+ $:$>3$1 make canonical # handle special cases..... R@ $#local$:MAILER-DAEMON handle <> form #R$*<@[$+]>$* $#tcp$@[$2]$:$1@[$2]$3 numeric internet spec # arrange for local names to be fully qualified R$*<$*$=S>$* $1<$2$3.LOCAL>$4 user@etherhost # now delete the local info R$*<$*$=w.LOCAL>$* $1<$2>$4 thishost.LOCAL R$*<$*$=w.$T>$* $1<$2>$4 thishost.ARPA R$*<$*$=w>$* $1<$2>$4 thishost R$*<$*.>$* $1<$2>$3 drop trailing dot R<@>:$* $@$>0$1 retry after route strip R$*<@> $@$>0$1 strip null trash & retry ################################## # End of ruleset zero preamble # ################################## !STUFFY!FUNK! echo Extracting uumail.m4 cat >uumail.m4 <<'!STUFFY!FUNK!' ############################################################ ############################################################ ##### ##### UUCP Mailer specification ##### This is for the rerouting mailer on Gatech ##### ##### $Header: uumail.m4,v 5.1 85/10/13 20:46:17 spaf Release $ ##### ############################################################ ############################################################ # use fancy path expanding UUCP frontend. Muucp, P=/usr/lib/mail/uumail, F=sCDFMSU, S=13, R=23, M=65535, A=uumail -f $g $h!$u S13 R$+ $:$>5$1 convert to old style R$=w!$+ $2 strip local name R$*<@$->$* $1<@$2.UUCP>$3 resolve abbreviations R$*<@$*.UUCP>$* $:$>5$1<@$2.UUCP>$3 R$+ $:$U!$1 stick on our host name R$=w!$=R$+ $:$2$3 R$*$=w!$=w$* $1$U$4 S23 R$*<@$-.LOCAL>$* $1<@$2.UUCP>$3 R$*<@$=S>$* $1<@$2.UUCP>$3 resolve abbreviations R$*<@$R.$D.UUCP>$* $1<@$2.UUCP>$3 R$+!$+!$+<@$*.UUCP>$* $2!$3<@$4.UUCP>$5 strip leading sites R$+!$+<@$*.UUCP>$* $:$2<@$1.UUCP>$4 put in right sitename S5 R$+<@$-.LOCAL> $2!$1 u@h.LOCAL => u%h R$+<@$-.UUCP> $2!$1 u@host.UUCP => host!u !STUFFY!FUNK! echo Extracting uucpm.m4 cat >uucpm.m4 <<'!STUFFY!FUNK!' ############################################################ ############################################################ ##### ##### UUCP Mailer specification ##### ##### $Header: uucpm.m4,v 5.1 85/10/13 20:46:14 spaf Release $ ##### ############################################################ ############################################################ Muucp, P=/usr/bin/uux, F=sDFMuU, S=13, R=23, M=65535, A=uux - -L -a$f -gC $h!rmail ($u) S13 R$+ $:$>5$1 convert to old style R$=w!$+ $2 strip local name R$*<@$->$* $1<@$2.UUCP>$3 resolve abbreviations R$*<@$*.UUCP>$* $:$>5$1<@$2.UUCP>$3 R$+ $:$U!$1 stick on our host name R$=w!$=R$+ $:$2$3 R$*$=w!$=w$* $1$U$4 S23 R$+ $:$>5$1 convert to old style R$*<@$=S>$* $1<@$2.$D.UUCP>$3 resolve abbreviations R$*<@$R.$D.UUCP>$* $1<@$2.UUCP>$3 S5 R$+<@$-.LOCAL> $1%$2 u@h.LOCAL => u%h R$+<@$-.UUCP> $2!$1 u@host.UUCP => host!u R$+@$+.$=T $1@$2 u@host.ARPA => u@host !STUFFY!FUNK! echo Extracting short3.m4 cat >short3.m4 <<'!STUFFY!FUNK!' ################################################ ### Machine dependent part of ruleset zero ### ### Short version for non-ICS machines on their own common ### ethernet. Forwarding host is "gatech" ### ### $Header: short3.m4,v 5.1 85/10/13 20:46:08 spaf Release $ ################################################ # resolve names that we can handle locally R<@$=W.UUCP>$+ $#uucp$@$1$:$2 @host.UUCP: ... R$+<@$=W.UUCP> $#uucp$@$2$:$1 user@host.UUCP # resolve names that can go via the ethernet R$*<@$*$=S.LOCAL>$* $#ether$@$3$:$1<@$2$3.$D>$4 user@etherhost # other non-local names will be kicked upstairs R$*<@$+>$* $#uucp$@$F$:$1<@$2>$3 user@some.where # remaining names must be local R$+ $#local$:$1 everything else include(uucpm.m4) include(etherm.m4) !STUFFY!FUNK! echo Extracting shortzero.m4 cat >shortzero.m4 <<'!STUFFY!FUNK!' ################################################ ### Machine dependent part of ruleset zero ### ### Short version for ICS machines on common ### ethernet. (NOT "gatech") ### ### $Header: shortzero.m4,v 5.1 85/10/13 20:46:11 spaf Release $ ################################################ # resolve names that we can handle locally R<@$=W.UUCP>$+ $#uucp$@$1$:$2 @host.UUCP: ... R$+<@$=W.UUCP> $#uucp$@$2$:$1 user@host.UUCP # resolve names that can go via the ethernet R$*<@$*$=S.LOCAL>$* $#ether$@$3$:$1<@$2$3.$D>$4 user@etherhost # other non-local names will be kicked upstairs R$*<@$+>$* $#ether$@$F$:$1<@$2>$3 user@some.where # remaining names must be local R$+ $#local$:$1 everything else include(uucpm.m4) include(etherm.m4) !STUFFY!FUNK! echo Extracting cirrus.mc cat >cirrus.mc <<'!STUFFY!FUNK!' ############################################################ ############################################################ ##### ##### SENDMAIL CONFIGURATION FILE FOR CIRRUS ##### ##### $Header: cirrus.mc,v 5.1 85/10/13 20:38:11 spaf Release $ ##### ############################################################ ############################################################ ############################################################ ### local info ############################################################ # internet hostname Cwgt-cirrus cirrus Cirrus CIRRUS GT-Cirrus GT-CIRRUS GT-cirrus # UUCP name DUgt-cirrus CUgt-cirrus cirrus include(csether.m4) include(gtbase.m4) include(shortzero.m4) !STUFFY!FUNK! echo Extracting nimbus.mc cat >nimbus.mc <<'!STUFFY!FUNK!' ############################################################ ############################################################ ##### ##### SENDMAIL CONFIGURATION FILE FOR NIMBUS ##### ##### $Header: nimbus.mc,v 5.1 85/10/13 20:38:35 spaf Release $ ##### ############################################################ ############################################################ ############################################################ ### local info ############################################################ # internet hostname Cwgt-nimbus nimbus NIMBUS Nimbus GT-Nimbus GT-nimbus GT-NIMBUS # UUCP name DUgt-nimbus CUgt-nimbus nimbus include(csether.m4) include(gtbase.m4) include(shortzero.m4) !STUFFY!FUNK! echo Extracting stratus.mc cat >stratus.mc <<'!STUFFY!FUNK!' ############################################################ ############################################################ ##### ##### SENDMAIL CONFIGURATION FILE FOR STRATUS ##### ##### $Header: stratus.mc,v 5.1 85/10/13 20:38:39 spaf Release $ ##### ############################################################ ############################################################ ############################################################ ### local info ############################################################ # internet hostname Cwgt-stratus stratus STRATUS GT-Stratus GT-STRATUS # UUCP name DUgt-stratus CUgt-stratus stratus include(csether.m4) include(gtbase.m4) include(shortzero.m4) !STUFFY!FUNK! echo Extracting gtqo.mc cat >gtqo.mc <<'!STUFFY!FUNK!' ############################################################ ############################################################ ##### ##### SENDMAIL CONFIGURATION FILE FOR GTQO ##### ##### $Header: gtqo.mc,v 5.1 85/10/13 20:38:28 spaf Release $ ##### ############################################################ ############################################################ ############################################################ ### local info ############################################################ # internet hostname Cwgtqo # UUCP name DUgtqo CUgtqo gt-qo # Ethernet stuff CS gtss gtqo gt-ss gt-qo include(gtbase.m4) DRgtss CR CRgtss gt-ss DFgtss include(short3.m4) !STUFFY!FUNK! echo Extracting gtss.mc cat >gtss.mc <<'!STUFFY!FUNK!' ############################################################ ############################################################ ##### ##### SENDMAIL CONFIGURATION FILE FOR GTSS ##### ##### $Header: gtss.mc,v 5.1 85/10/13 20:38:32 spaf Release $ ##### ############################################################ ############################################################ ############################################################ ### local info ############################################################ # internet hostname Cwgtss # UUCP name DUgtss CUgtss gt-ss # Ethernet stuff CS gtss gtqo gt-ss gt-qo include(gtbase.m4) include(short3.m4) !STUFFY!FUNK! echo Extracting gt-cmmsr.mc cat >gt-cmmsr.mc <<'!STUFFY!FUNK!' ############################################################ ############################################################ ##### ##### SENDMAIL CONFIGURATION FILE FOR GT-CMMSR ##### ##### $Header: gt-cmmsr.mc,v 5.1 85/10/13 20:38:25 spaf Release $ ##### ############################################################ ############################################################ ############################################################ ### local info ############################################################ # internet hostname Cwgt-cmmsr cmmsr gtcmmsr # UUCP name DUgt-cmmsr CUgt-cmmsr cmmsr gtcmmsr include(gtbase.m4) include(short2.m4) !STUFFY!FUNK! echo Extracting gitpyr.mc cat >gitpyr.mc <<'!STUFFY!FUNK!' ############################################################ ############################################################ ##### ##### SENDMAIL CONFIGURATION FILE FOR GITPYR ##### ##### $Header: gitpyr.mc,v 5.1 85/10/13 20:38:21 spaf Release $ ##### ############################################################ ############################################################ ############################################################ ### local info ############################################################ # internet hostname Cwgitpyr Gitpyr GITPYR # UUCP name DUgitpyr CUgitpyr include(csether.m4) include(gtbase.m4) include(shortzero.m4) !STUFFY!FUNK! echo Extracting short2.m4 cat >short2.m4 <<'!STUFFY!FUNK!' ################################################ ### Machine dependent part of ruleset zero ### ### Short version for non-ICS machines not on ### common ethernet. (e.g., gt-cmmsr) ### ### $Header: short2.m4,v 5.1 85/10/13 20:46:05 spaf Release $ ################################################ # resolve names that we can handle locally R<@$=W.UUCP>$+ $#uucp$@$1$:$2 @host.UUCP: ... R$+<@$=W.UUCP> $#uucp$@$2$:$1 user@host.UUCP # other non-local names will be kicked upstairs R$*<@$+>$* $#uucp$@$F$:$1<@$2>$3 user@some.where # remaining names must be local R$+ $#local$:$1 everything else include(uucpm.m4) !STUFFY!FUNK! echo Extracting csether.m4 cat >csether.m4 <<'!STUFFY!FUNK!' ############################################################ ############################################################ ##### ##### ICS Etehernet based hosts using SMTP ##### ##### $Header: csether.m4,v 5.1 85/10/13 20:45:48 spaf Release $ ##### ############################################################ ############################################################ # known SMTP/ethernet hosts (this domain only) -- only $R need be complete CSgatech Gatech CSgitpyr Gitpyr CSgt-nimbus nimbus GT-Nimbus Nimbus CSgt-cirrus GT-Cirrus cirrus Cirrus CSgt-stratus stratus GT-Stratus Stratus !STUFFY!FUNK! echo Extracting localm.m4 cat >localm.m4 <<'!STUFFY!FUNK!' ############################################################ ############################################################ ##### ##### Local and Program Mailer specification ##### ##### $Header: localm.m4,v 5.1 85/10/13 20:45:58 spaf Release $ ##### ############################################################ ############################################################ Mlocal, P=/bin/mail, F=rlsDFMmn, S=10, A=mail -d $u Mprog, P=/bin/sh, F=lsDFMe, S=10, A=sh -c $u S10 R@ MAILER-DAEMON errors to mailer-daemon !STUFFY!FUNK! echo Extracting etherm.m4 cat >etherm.m4 <<'!STUFFY!FUNK!' ############################################################ ############################################################ ##### ##### Ethernet Mailer specification ##### ##### $Header: etherm.m4,v 5.1 85/10/13 20:45:52 spaf Release $ ##### ############################################################ ############################################################ Mether, P=[IPC], F=msDFIMuCX, S=11, A=IPC $h S11 R$*<@$+>$* $@$1<@$2>$3 already ok R$+ $@$1<@$w.LOCAL> tack on our hostname !STUFFY!FUNK! echo Extracting version.m4 cat >version.m4 <<'!STUFFY!FUNK!' # $Header: version.m4,v 5.1 85/10/13 20:46:20 spaf Release $ DV5.8.GaTech !STUFFY!FUNK! echo "" echo "End of kit 3 (of 3)" cat /dev/null >kit3isdone config=true for iskit in 1 2 3; do if test -f kit${iskit}isdone; then echo "You have run kit ${iskit}." else echo "You still need to run kit ${iskit}." config=false fi done case $config in true) echo "You have run all your kits. Please read README." ;; esac : I do not append .signature, but someone might mail this. exit