[comp.mail.misc] Need Strategy For Sending UUCP Mail On SMTP System

Will@cup.portal.com (Will E Estes) (03/15/91)

I need help understanding how to send UUCP mail from a system whose
mailer apparently doesn't look into the UUCP maps when it sends UUCP
mail.  What I'm looking for is some help from a mail guru out there 
to develop an algorithm that will convert the UUCP addresses into 
form that sends to an intermediate site via SMTP and then to the
destination site via UUCP.  If this is just not possible, so be it 
and please tell me that.  But if there is some way that 
I could look at a simple UUCP address of form SITE!USER and convert
this into something that would first send to a site, via SMTP, and then
to the UUCP site from that SMTP site.  In other words, I need a way
to 1) identify intermediate nodes that my site knows about and that
know about my destination, and 2) to identify the address format
for sending the mail out from my site.

Can someone give me some hints about some ways this might be done?

Thanks,
Will Estes        (apple!cup.portal.com!Will)

mdb@ESD.3Com.COM (Mark D. Baushke) (03/15/91)

On 15 Mar 91 04:48:44 GMT, Will@cup.portal.com (Will E Estes) said:

Will> I need help understanding how to send UUCP mail from a system whose
Will> mailer apparently doesn't look into the UUCP maps when it sends UUCP
Will> mail.  

I would suggest that you get a version that can work with the UUCP
maps. This probably means either IDA Sendmail (my favorite choice) or
smail (whatever version happens to be popular).

The latest version of IDA Sendmail may be obtained from
uxc.cso.uiuc.edu:/pub/sendmail-5.65b+IDA-1.4.3.tar.Z .

Will> What I'm looking for is some help from a mail guru out there to
Will> develop an algorithm that will convert the UUCP addresses into
Will> form that sends to an intermediate site via SMTP and then to the
Will> destination site via UUCP.  

Given: 

	1) A current set of UUCP Maps (either by grabbing
	   ftp.uu.net:/uumap.tar.Z or using net.news to grab the maps
	   from comp.mail.maps)

	2) Source to pathalias (version 10 -- the latest may be
	   obtained via anonymous FTP from comp.sources.unix archives like
	   ftp.uu.net:/comp.sources.unix/volume22/pathalias10/part0[123].Z

	3) mkglue uucp map post processor (attached shar)

	4) If you do not have an entry for your host in the UUCP Maps,
	   add a local map (I call mine Paths.local) which will show
	   some kind of a connection to another internet host in the
	   maps.

Process: 

	I use a Makefile (similar to the one attached) to build a
	pathtable dbm file which in turn is used by IDA Sendmail for
	sending mail to uucp hosts.

Will> If this is just not possible, so be it and please tell me that.
Will> But if there is some way that I could look at a simple UUCP
Will> address of form SITE!USER and convert this into something that
Will> would first send to a site, via SMTP, and then to the UUCP site
Will> from that SMTP site.  In other words, I need a way to 1)
Will> identify intermediate nodes that my site knows about and that
Will> know about my destination, and 2) to identify the address format
Will> for sending the mail out from my site.

Typing 'make install' given the Makefile in the shar file below should
give your IDA Sendmail the ability to know how to route to random UUCP
hosts from the UUCP maps.

Will> Can someone give me some hints about some ways this might be done?

Will> Thanks,
Will> Will Estes        (apple!cup.portal.com!Will)

Everything else is handled by the IDA Sendmail templates found in
sendmail/ida/cf/Sendmail.mc 

Enjoy!
-- 
Mark D. Baushke
mdb@ESD.3Com.COM

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  Makefile rmvtoplevel.sed mkglue.awk
# Wrapped by mdb@ESD.3Com.COM on Fri Mar 15 00:27:06 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(2356 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X########################## -*- Mode: Fundamental -*- #########################
X# Makefile --- A makefile for generating a refined pathtable
X#
X# Author          : Mark D. Baushke <mdb@esd.3com.com>
X# Created On      : Fri Mar 15 00:06:46 1991
X# Last Modified By: Mark D. Baushke
X# Last Modified On: Fri Mar 15 00:25:43 1991
X# Update Count    : 1
X# Status          : Your mileage may vary.
X#
X###############################################################################
X
X# Makefile for UUCP map paths
X
X# If you have the uuhosts package you might want to add Index to all.
X# If you are using the DNS you want to build paths.inet, otherwise you
X# probably want to build paths or paths.raw depending on your view on
X# mail tunneling through the Internet. I use paths.inet .
Xall:		paths.inet
X
X# This is the refined paths table. Sorted for 'look' users.
Xpaths:		Path.local [du].* Path.fixes Path.glue
X		-/bin/rm -f $@
X		pathalias -i Path.local [du].* Path.fixes Path.glue | \
X		/bin/sort -f -T /tmp > $@
X
X# Folks directly on the internet can get smaller tables by removing
X# all of the entries for which the DNS will answer questions.
Xpaths.inet:	paths rmvtoplevel.sed
X		-/bin/rm -f $@
X		/bin/sed -f rmvtoplevel.sed paths > $@
X
X# This interesting bit of magic tells all of the Domainnames likely to
X# be found in the DNS that they all have direct connections with a
X# cost of DEMAND+LOW to each other.
XPath.glue:	Path.local Path.fixes [du].* paths.raw mkglue.awk
X		-/bin/rm -f $@
X		/bin/awk -f mkglue.awk paths.raw > $@
X
X# Vanilla paths information all a UUCP site really needs.
Xpaths.raw:	Path.local [du].* Path.fixes
X		-/bin/rm -f Path.local~ [du].*~ Path.fixes~ $@
X		pathalias -i Path.local [du].* Path.fixes  > $@ 
X
X# Optional. Index is useful for answering uuhosts queries.
XIndex:		[du].*
X		@/bin/date
X		-/bin/rm -f $@
X		uuhosts -i
X
X# remove all generated files if desired
Xclean:		FRC
X		-/bin/rm -f Path.local~ [du].*~ Path.fixes~ make.log \
X		paths.raw paths paths.inet Path.glue
X		
X# This will vary depending on where you keep your IDA Sendmail (or
X# smail) database files. I keep mine in /var/mail.  The dbm program
X# comes in IDA Sendmail in sendmail/ida/aux/dbm.c .
Xinstall:	paths.inet
X		dbm -R -d /var/mail/pathtable+ load < paths.inet
X		mv /var/mail/pathtable+.dir /var/mail/pathtable.dir
X		mv /var/mail/pathtable+.pag /var/mail/pathtable.pag
X
XFRC:
END_OF_FILE
if test 2356 -ne `wc -c <'Makefile'`; then
    echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'rmvtoplevel.sed' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rmvtoplevel.sed'\"
else
echo shar: Extracting \"'rmvtoplevel.s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^ 	]*\.uy	/d
X/^[^ 	]*\.yu	/d
X/^[^ 	]*\.za	/d
END_OF_FILE
if test 939 -ne `wc -c <'rmvtoplevel.sed'`; then
    echo shar: \"'rmvtoplevel.sed'\" unpacked with wrong size!
fi
# end of 'rmvtoplevel.sed'
fi
if test -f 'mkglue.awk' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mkglue.awk'\"
else
echo shar: Extracting \"'mkglue.awk'\" \(5349 characters\)
sed "s/^X//" >'mkglue.awk' <<'END_OF_FILE'
X#!/bin/awk -f
X# MKGLUE: UUCP map post processor
X# Idea from Mel Pleasant via Eliot Lear
X# Erik E. Fair <fair@apple.com>, August, 1988
X#
X# revised from domains.txt on December 31, 1990
X#
X# What we have here is a UUCP map postprocessor. To use:
X#	pathalias uucpmaps > /tmp/paths.raw
X#	mkglue /tmp/paths.raw > /tmp/glue
X#	pathalias uucpmaps /tmp/glue > /tmp/paths.refined
X#	do whatever you do with the maps here
X#
X# what this does is find Internet EQUIVALENCES for UUCP sites, e.g.
X#
X#	ucbvax=	ucbvax.berkeley.edu
X#	apple= apple.com
X#
X# and then it reverses them, and puts all the domain names it finds into
X# a completely connected network called "INTERNET", with COST defined
X# below. That cost was determined experimentally on a Cray X/MP-48
X# (pathalias will run on such a beast. It takes only 24 seconds to
X# process all the maps and the glue file. It's amazing what you can do
X# with a supercomputer). Your milage may vary.
X#
X# The effect of this is to cause nearly all your paths to take their
X# first hop through the Internet. DO NOT USE THIS POSTPROCESSOR, unless
X# you're actually on the Internet, or you have multiple UUCP neighbors
X# who are on the Internet of equivalent call cost to you.
X#
X# This script will NOT do anything with domain gateway declarations, e.g.
X#
X#	foo	.bar.com
X#
X# because these do not provide a mapping between the Internet name and
X# the UUCP name of the UUCP host involved. This script makes no
X# distinction between "real" Internet hosts and "fake" (MX'd) ones (how
X# can I? The information isn't there). Even with an MX host, someone on
X# the Internet is accepting mail for them (that's what MX is all about).
X#
X# Encourage your Internet friends and neighbors to put all the right
X# information into the UUCP maps.
X#
X# Also, your mailer must be able to transform thusly:
X#
X#	do.main!foo!bar!bazz -> foo!bar!bazz@do.main
X#
X# since that's what the database will generate. I do it with sendmail,
X# and I installed the uunet hacks to 5.59 sendmail to look stuff up in a
X# DBM database. I expect that the IDA sendmail stuff can be similarly
X# coerced to do this.
X#
X# If nothing else, you might find the report at the end of the glue file
X# interesting.
X#
XBEGIN{
X	COST = "DEMAND+LOW";
X#
X# removed arpa since only decwrl.arpa and ames.arpa have entries in
X# the UUCP maps and the DNS does not recognize them by those names anymore.
X#	domain["arpa"] = 1;
X
X	domain["com"] = 1;	domain["gov"] = 1;
X	domain["mil"] = 1;	domain["org"] = 1;
X	domain["edu"] = 1;	domain["net"] = 1;
X	domain["int"] = 1;	domain["nato"] = 1;
X
X	domain["ar"] = 1;
X	domain["at"] = 1;
X	domain["au"] = 1;
X	domain["be"] = 1;
X	domain["br"] = 1;
X	domain["ca"] = 1;
X	domain["ch"] = 1;
X	domain["cl"] = 1;
X	domain["cn"] = 1;
X	domain["cr"] = 1;
X	domain["cs"] = 1;
X	domain["de"] = 1;
X	domain["dk"] = 1;
X	domain["eg"] = 1;
X	domain["es"] = 1;
X	domain["fi"] = 1;
X	domain["fr"] = 1;
X	domain["gr"] = 1;
X	domain["hk"] = 1;
X	domain["hu"] = 1;
X	domain["ie"] = 1;
X	domain["il"] = 1;
X	domain["in"] = 1;
X	domain["is"] = 1;
X	domain["it"] = 1;
X	domain["jp"] = 1;
X	domain["kr"] = 1;
X	domain["lk"] = 1;
X	domain["mx"] = 1;
X	domain["my"] = 1;
X	domain["ni"] = 1;
X	domain["nl"] = 1;
X	domain["no"] = 1;
X	domain["nz"] = 1;
X	domain["ph"] = 1;
X	domain["pl"] = 1;
X	domain["pr"] = 1;
X	domain["pt"] = 1;
X	domain["se"] = 1;
X	domain["sg"] = 1;
X	domain["su"] = 1;
X	domain["th"] = 1;
X	domain["tr"] = 1;
X	domain["tw"] = 1;
X	domain["uk"] = 1;
X	domain["us"] = 1;
X	domain["uy"] = 1;
X	domain["yu"] = 1;
X	domain["za"] = 1;
X
X	nbad = 0;
X	imon_inet = 0;
X}
X
X# ignore domain gateways (no clean mapping - we must know the internet name)
X/^\./ {next}
X
X$2 == "%s" {
X# hopefully only one of these
X	if ( $1 !~ /\./ ) {
X		localuucpname = $1;
X		next;
X	}
X}
X
X# here's the meat of the matter - find real domains and reverse the
X# equivalences so that pathalias will give us paths with internet
X# names in them.
X$1 ~ /\./ {
X	hostname= $1;
X	curbad = 0;
X# check top of domain name for validity
X	i = split(hostname, parts, ".");
X	top = parts[i];
X	if (domain[top] != 1) {
X		printf("# bad domain - %s\n", hostname);
X		badtop[top]++;
X		nbad++;
X		curbad = 1;
X	} else domtop[top]++;
X	n = split($2, path, "!");
X	if (n > 1) {
X		uucpname= path[n - 1];
X		if (hostname == uucpname)
X			next;
X# skip two sided dot aliases
X		i = split(uucpname, parts, ".");
X		if (i < 2) {
X			if (! curbad) {
X				print hostname "=" uucpname;
X				internet[hostname]++;
X			}
X		} else if (domain[parts[i]] == 1) {
X			print uucpname "=" hostname;
X			internet[uucpname]++;
X		}
X	} else if ($2 == "%s") {
X		if (imon_inet && localuucpname != "" && !curbad) {
X			print localinetname "=" localuucpname;
X			internet[localinetname]++;
X		}
X		if (!curbad) {
X			localinetname= $1;
X			internet[localinetname]++;
X			imon_inet++
X		}
X	}
X}
X
X# now create a completely connected network of the domain names,
X# with a low cost, so that we mostly use the Internet in preference
X# to any other path
XEND{
X	if (imon_inet) {
X		print localinetname "=" localuucpname;
X	}
X	print "INTERNET={"
X	for(hostname in internet) {
X		printf("\t%s,\n", hostname);
X	}
X	printf("\t}(%s)\n", COST);
X#
X# report on what we found while perusing the map data
X#
X	printf("# top level domains\n");
X	for(top in domtop) {
X		printf("#\t%s\t%d\n", top, domtop[top]);
X	}
X#
X	if (nbad > 0) {
X		printf("\n# unrecognized summary:\n");
X		for(dom in badtop) {
X			printf("#\t%s\t%d\n", dom, badtop[dom]);
X		}
X	}
X}
END_OF_FILE
if test 5349 -ne `wc -c <'mkglue.awk'`; then
    echo shar: \"'mkglue.awk'\" unpacked with wrong size!
fi
# end of 'mkglue.awk'
fi
echo shar: End of shell archive.
exit 0

dpotter@xstor.com (Master Mail Mangler and Problem Provider) (03/22/91)

In article <40173@cup.portal.com> Will@cup.portal.com (Will E Estes) writes:
>I need help understanding how to send UUCP mail from a system whose
>mailer apparently doesn't look into the UUCP maps when it sends UUCP
>mail...
> [I want] an algorithm that will convert the UUCP addresses into 
>form that sends to an intermediate site via SMTP and then to the
>destination site via UUCP.  If this is just not possible, so be it 
>and please tell me that. 
>Can someone give me some hints about some ways this might be done?

Will,

I'm anything but a mail guru - but I know this *can* be done. 
We're doing it here regularly on our SCO Unix system.  The mailer is
mmdf which supports this type of thing automatically.  It defines
SMTP and UUCP as channels, and then routes the message via SMTP to our
central UUCP server.

If you have specific questions about our setup, or want to talk to one
of our gurus, send me some email.

David Potter :: Network Administrator, Storage Dimensions, Inc.
408/879-3368 :: San Jose, CA
dpotter@xstor.com    ..!xstor!stdim!dpotter