The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] pathalias and sendmail experience?
@ 2017-03-18  3:40 Warren Toomey
  2017-03-18  4:34 ` Dave Horsfall
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Warren Toomey @ 2017-03-18  3:40 UTC (permalink / raw)


I know it's a long shot. Does anybody remember how to use the output
of pathalias in sendmail.cf? Specifically, we have set up 4.3BSD with
uucp-only e-mail, and we have a map file which pathalias digests and
outputs fine.

I can't find any useful documentation on putting this output into
sendmail. There's part of a book in Google books, but two pages
are hidden. I also threw out my old bat book ages ago. I have a
PDF of Sendmail_4th_Edition_Oct_2007.pdf but it doesn't mention
pathalias.

Thanks in advance! Warren
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170318/da2522af/attachment.sig>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [TUHS] pathalias and sendmail experience?
  2017-03-18  3:40 [TUHS] pathalias and sendmail experience? Warren Toomey
@ 2017-03-18  4:34 ` Dave Horsfall
  2017-03-18  7:09 ` Erik E. Fair
  2017-03-18  7:17 ` Erik E. Fair
  2 siblings, 0 replies; 4+ messages in thread
From: Dave Horsfall @ 2017-03-18  4:34 UTC (permalink / raw)


On Sat, 18 Mar 2017, Warren Toomey wrote:

> I know it's a long shot. Does anybody remember how to use the output of 
> pathalias in sendmail.cf? Specifically, we have set up 4.3BSD with 
> uucp-only e-mail, and we have a map file which pathalias digests and 
> outputs fine.

Gadzooks...  It uses those funny Sendmail maps, as I dimly recall, but my 
Sendmail-fu is a bit old (I just use it).

> I can't find any useful documentation on putting this output into 
> sendmail. There's part of a book in Google books, but two pages are 
> hidden. I also threw out my old bat book ages ago. I have a PDF of 
> Sendmail_4th_Edition_Oct_2007.pdf but it doesn't mention pathalias.

There seems to be "http://www.linuxjournal.com/article/2771", if that fits 
your needs.  Most of the rest of the references I've found seem to be 
crap.

-- 
Dave Horsfall DTM (VK2KFU)  "Those who don't understand security will suffer."


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [TUHS] pathalias and sendmail experience?
  2017-03-18  3:40 [TUHS] pathalias and sendmail experience? Warren Toomey
  2017-03-18  4:34 ` Dave Horsfall
@ 2017-03-18  7:09 ` Erik E. Fair
  2017-03-18  7:17 ` Erik E. Fair
  2 siblings, 0 replies; 4+ messages in thread
From: Erik E. Fair @ 2017-03-18  7:09 UTC (permalink / raw)


I still have the sendmail.cf construction kit that I put together in the 1980s
and used into the 1990s at Apple and which I made available for FTP long ago
at SRI-NIC.ARPA - I was amused to find it was in use at Microsoft also ...

Would that help?

The key lines from those cf files appear to be:

# our pathalias database
Op/usr/lib/mail/paths

IIRC, sendmail had a generic ${lookup-key$} based on dbm(3) added to it. Before
ndbm(3) which could handle multiple databases in the same program, dbm(3)
could only handle one. Which explains these old production rules:

S8
# magic UUCP shit
R$*<@$-.UUCP>		$:${$2$}!$1		look up UUCP site in maps
R$+!%s!$*		$:$1!$2			remove %s database cruft
R$-.$+!$+		$@$3<@$1.$2>		do.main!user
R$-!$+			$@$2<@$1.UUCP>		host!user

Again, IIRC, the dance was process the UUCP maps through pathalias, feed that
to a generic dbm(3) database constructor program (dbm(1)?), and give the base
filename of the resulting dbm database to the "p" option of sendmail(8) in
the cf file, as above, which then would process queries with ${key$} and
substituting the result of the lookup.

My kit has sendmail.cf for pure Internet-only, pure UUCP-only, and gateways
like Apple was when I ran it. The Apple one also has some hysterical ... I
mean historical stuff with how we handled BITNET and an early gateway to
AppleLink through DASNET if anyone remembers that gross hack.

It was fun to revisit this and read comments. Let me know if you want the full
kit, and I'll put it up in my web server.

	Erik Fair
	formerly postmaster at apple.com
	formerly {ucbvax,ihnp4,decwrl,amd70,seismo,zehntel}!dual!fair


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [TUHS] pathalias and sendmail experience?
  2017-03-18  3:40 [TUHS] pathalias and sendmail experience? Warren Toomey
  2017-03-18  4:34 ` Dave Horsfall
  2017-03-18  7:09 ` Erik E. Fair
@ 2017-03-18  7:17 ` Erik E. Fair
  2 siblings, 0 replies; 4+ messages in thread
From: Erik E. Fair @ 2017-03-18  7:17 UTC (permalink / raw)


In fact, my "mkglue" awk script explains that the dbm(3) hacks came from UUNET:

#!/bin/awk -f
# MKGLUE: UUCP map post processor
# Idea from Mel Pleasant via Eliot Lear
# Erik E. Fair <fair at apple.com>, August, 1988
#
# revised from domains.txt on December 31, 1990
#
# What we have here is a UUCP map postprocessor. To use:
#	pathalias uucpmaps > /tmp/paths.raw
#	mkglue /tmp/paths.raw > /tmp/glue
#	pathalias uucpmaps /tmp/glue > /tmp/paths.refined
#	do whatever you do with the maps here
#
# what this does is find Internet EQUIVALENCES for UUCP sites, e.g.
#
#	ucbvax=	ucbvax.berkeley.edu
#	apple= apple.com
#
# and then it reverses them, and puts all the domain names it finds into
# a completely connected network called "INTERNET", with COST defined
# below. That cost was determined experimentally on a Cray X/MP-48
# (pathalias will run on such a beast. It takes only 24 seconds to
# process all the maps and the glue file. It's amazing what you can do
# with a supercomputer). Your milage may vary.
#
# The effect of this is to cause nearly all your paths to take their
# first hop through the Internet. DO NOT USE THIS POSTPROCESSOR, unless
# you're actually on the Internet, or you have multiple UUCP neighbors
# who are on the Internet of equivalent call cost to you.
#
# This script will NOT do anything with domain gateway declarations, e.g.
#
#	foo	.bar.com
#
# because these do not provide a mapping between the Internet name and
# the UUCP name of the UUCP host involved. This script makes no
# distinction between "real" Internet hosts and "fake" (MX'd) ones (how
# can I? The information isn't there). Even with an MX host, someone on
# the Internet is accepting mail for them (that's what MX is all about).
#
# Encourage your Internet friends and neighbors to put all the right
# information into the UUCP maps.
#
# Also, your mailer must be able to transform thusly:
#
#	do.main!foo!bar!bazz -> foo!bar!bazz at do.main
#
# since that's what the database will generate. I do it with sendmail,
# and I installed the uunet hacks to 5.59 sendmail to look stuff up in a
# DBM database. I expect that the IDA sendmail stuff can be similarly
# coerced to do this.
#
# If nothing else, you might find the report at the end of the glue file
# interesting.
#
BEGIN{
	COST = "DEMAND+LOW";
#
	domain["arpa"] = 1;	domain["nato"] = 1;
	domain["com"] = 1;	domain["gov"] = 1;
	domain["mil"] = 1;	domain["org"] = 1;
	domain["edu"] = 1;	domain["net"] = 1;
	domain["int"] = 1;

	domain["ar"] = 1;
	domain["at"] = 1;
	domain["au"] = 1;
	domain["be"] = 1;
	domain["br"] = 1;
	domain["ca"] = 1;
	domain["ch"] = 1;
	domain["cl"] = 1;
	domain["cn"] = 1;
	domain["cr"] = 1;
	domain["cs"] = 1;
	domain["de"] = 1;
	domain["dk"] = 1;
	domain["eg"] = 1;
	domain["es"] = 1;
	domain["fi"] = 1;
	domain["fr"] = 1;
	domain["gr"] = 1;
	domain["hk"] = 1;
	domain["hu"] = 1;
	domain["ie"] = 1;
	domain["il"] = 1;
	domain["in"] = 1;
	domain["is"] = 1;
	domain["it"] = 1;
	domain["jp"] = 1;
	domain["kr"] = 1;
	domain["lk"] = 1;
	domain["mx"] = 1;
	domain["my"] = 1;
	domain["ni"] = 1;
	domain["nl"] = 1;
	domain["no"] = 1;
	domain["nz"] = 1;
	domain["ph"] = 1;
	domain["pl"] = 1;
	domain["pr"] = 1;
	domain["pt"] = 1;
	domain["se"] = 1;
	domain["sg"] = 1;
	domain["su"] = 1;
	domain["th"] = 1;
	domain["tr"] = 1;
	domain["tw"] = 1;
	domain["uk"] = 1;
	domain["us"] = 1;
	domain["uy"] = 1;
	domain["yu"] = 1;
	domain["za"] = 1;

	nbad = 0;
	imon_inet = 0;
}

# ignore domain gateways (no clean mapping - we must know the internet name)
/^\./ {next}

$2 == "%s" {
# hopefully only one of these
	if ( $1 !~ /\./ ) {
		localuucpname = $1;
		next;
	}
}

# here's the meat of the matter - find real domains and reverse the
# equivalences so that pathalias will give us paths with internet
# names in them.
$1 ~ /\./ {
	hostname= $1;
	curbad = 0;
# check top of domain name for validity
	i = split(hostname, parts, ".");
	top = parts[i];
	if (domain[top] != 1) {
		printf("# bad domain - %s\n", hostname);
		badtop[top]++;
		nbad++;
		curbad = 1;
	} else domtop[top]++;
	n = split($2, path, "!");
	if (n > 1) {
		uucpname= path[n - 1];
		if (hostname == uucpname)
			next;
# skip two sided dot aliases
		i = split(uucpname, parts, ".");
		if (i < 2) {
			if (! curbad) {
				print hostname "=" uucpname;
				internet[hostname]++;
			}
		} else if (domain[parts[i]] == 1) {
			print uucpname "=" hostname;
			internet[uucpname]++;
		}
	} else if ($2 == "%s") {
		if (imon_inet && localuucpname != "" && !curbad) {
			print localinetname "=" localuucpname;
			internet[localinetname]++;
		}
		if (!curbad) {
			localinetname= $1;
			internet[localinetname]++;
			imon_inet++
		}
	}
}

# now create a completely connected network of the domain names,
# with a low cost, so that we mostly use the Internet in preference
# to any other path
END{
	if (imon_inet) {
		print localinetname "=" localuucpname;
	}
	print "INTERNET={"
	for(hostname in internet) {
		printf("\t%s,\n", hostname);
	}
	printf("\t}(%s)\n", COST);
#
# report on what we found while perusing the map data
#
	printf("# top level domains\n");
	for(top in domtop) {
		printf("#\t%s\t%d\n", top, domtop[top]);
	}
#
	if (nbad > 0) {
		printf("\n# unrecognized summary:\n");
		for(dom in badtop) {
			printf("#\t%s\t%d\n", dom, badtop[dom]);
		}
	}
}


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-18  7:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-18  3:40 [TUHS] pathalias and sendmail experience? Warren Toomey
2017-03-18  4:34 ` Dave Horsfall
2017-03-18  7:09 ` Erik E. Fair
2017-03-18  7:17 ` Erik E. Fair

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).