[news.admin] Internet + uucp

meissner@xyzzy.UUCP (Michael Meissner) (03/26/88)

I sent my reply to Robert, but I thought others might be interested,
since this seems to come up every so often.

In article <1103@uokmax.UUCP> rob@uokmax.UUCP (Robert K. Shull) writes:
> We just finished connecting to Midnet (which allows us Internet access.)
> Is there any good way to set up routing tables which include both uucp
> and the machines which we can connect to directly? I don't really want
> to create a huge local entry for pathalias to work on. Any suggestions
> would be much appreciated.
> 	Robert Shull

My solution was to do two things:

    1)	Use two /usr/lib/hosts.tcp and /usr/lib/hosts.uucp that contain
	the hostnames that my site knows is reachable via tcp/ip SMTP and
	uucp respectively.  These are specified with the F option:

		FT/usr/lib/hosts.tcp
		FU/usr/lib/hosts.uucp

	You specify in ruleset 0 to match against each of the two classes,
	if it matches the first class, you send it off to be delivered via
	TCP/IP, and uucico for the second.  You create an additional rule
	to match hostname.ETHER or some such, which smail spits out.  Any
	other hosts that aren't matched are delivered to smail.  See the
	sample smail sendmail.cf for ideas along this line.

	Note some [most?] versions of sendmail have a "feature" in that
	names matched must not have a period or other delimiter in it.
	This limits you to non-domain names, so I only list the local
	hosts in /usr/lib/hosts.tcp.

    2)	You add code to smail to look up a remote host first via the BSD
	gethostbyname routine, and if it's found, tack on a .ETHER to the
	name, and feed it back to sendmail.  This will mean that for
	internet hosts that you don't match, sendmail gets invoked twice.
	If this becomes a problem, you could remember which hosts mail gets
	sent to, and add them to /usr/lib/hosts.tcp (if sendmail allows
	matching delimiters in names), or to ruleset 0.  If the gethostbyname
	fails, smail would then do the normal lookup and talk directly to
	uucico.

I have tacked on the patch I created for smail3 from the comp.sources.unix
archives.  Apply with Larry Wall's patch program.

: ----------------------- Cut Here --------------------------

Description:
	This patch adds options to have smail look at the localhosts before
	checking the global map with gethostbyname (or scanning /etc/hosts).
	If a local host is found, it is formatted according to options (to
	use either DOMAIN or UUCP style addressing, and to add a domain or
	psuedo-domain such as ETHER).  This favors addressing to local hosts
	over external hosts with the same name, and sites don't have to keep
	a copy of all local hosts on every host in a format that sendmail
	can read.  At Data General, hosts are added/removed via the yellow
	pages, and we would have to have a cron job on every host to convert
	between ypcat's output and the single host per line that the F option
	in sendmail expects.

	A second change is to search for hostnames (without the dot) before
	searching for domain names.  The reason for this is to favor a specific
	hostname when it clashes with a domain name.  In particular we have a
	local host with the name "oz" that clashes with the Austrailian domain
	.oz (there is also a host in the UUCP maps with the name "oz" as well).

	A third (minor) change is to pass sendmail the -v flag if it was passed
	to smail (and sendmail is the local mailer).

	A fourth change is to allow GETHOSTNAME and UNAME to be set in the
	Makefile.  This is to allow hybrid hosts that are mostly system V
	but contain the Berkley networking calls.

	A fifth change is to ignore the "-i" flag in smail.  This is to allow
	smail be called directly from mailx/Mail if DELIVERMAIL was compiled
	in, rather than going through sendmail first.  Note, mailx/Mail some-
	times will pass "-r", "-h" (if set by user), or "-m" (if the variable
	metoo is set).

Index: defs.h
*** .orig/defs.h	Mon Apr  6 16:22:07 1987
--- defs.h	Mon Apr  6 16:21:20 1987
***************
*** 23,28
  
  # define SENDMAIL "/usr/lib/sendmail"	/* Turn off to use /bin/(l)mail only */
  
  /*
  **  The ALIAS definitions are used only if SENDMAIL is NOT defined.
  **  Sites using sendmail have to let sendmail do the aliasing.

--- 23,35 -----
  
  # define SENDMAIL "/usr/lib/sendmail"	/* Turn off to use /bin/(l)mail only */
  
+ # ifndef BSD
+ /*# define SV_USE_SMAIL			/* define if you want svbinmail (the */
+ 					/* /bin/mail replacement for Sys V   */
+ 					/* to call smail instead of sendmail */
+ # endif
+ 
+ 
  /*
  ** If SMTP is defined, a domain is first checked by looking in the current
  ** hosts database with gethostbyname, and if it is found, don't do any
***************
*** 24,29
  # define SENDMAIL "/usr/lib/sendmail"	/* Turn off to use /bin/(l)mail only */
  
  /*
  **  The ALIAS definitions are used only if SENDMAIL is NOT defined.
  **  Sites using sendmail have to let sendmail do the aliasing.
  **  ALIAS, must be defined, however, even if not used.

--- 31,89 -----
  
  
  /*
+ ** If SMTP is defined, a domain is first checked by looking in the current
+ ** hosts database with gethostbyname, and if it is found, don't do any
+ ** transformations on it.  Defining SMTP assumes SENDMAIL is defined.  The
+ ** intent is to allow the use of internal names that may clash with other
+ ** hosts.  In particular, at DG we have a private host called oz that
+ ** conflicts with the austrailian domain .oz, and smail reroutes all mail
+ ** down under.  We also have a private host godot, which conflicts with
+ ** another (better connected) host in North Carolina.  Note if the
+ ** gethostname system call on your system is implemented by linerly
+ ** scanning /etc/hosts, you might not want to use this option if you have
+ ** many hosts (particularly if you list hosts you don't connect too).
+ ** Similarly, if you are on a large network, such as ARPAnet, CSnet, etc.,
+ ** particularly if recursive nameservers are called, you might want to
+ ** ponder the use of this option.  The following defines are also used,
+ ** when SMTP is defined.
+ **
+ **  SMTP_FORM	is either DOMAIN, UUCP, depending on whether you want @ or !
+ **		used as the first address.  If DOMAIN, you run into the problem
+ **		of what happens if pathalias produces another route with @ in
+ **		it, but that is frowned upon.
+ **
+ **  SMTP_DOMAIN	is the domain to tack on to localhosts.  It may be our offical
+ **		domain name, an internal name like "ether", or nothing.
+ **
+ **  SMTP_HFILE	is a pathname if the system does not support the function
+ **		gethostbyname, but does have a sequential file (typically
+ **		/etc/hosts) that contain the hosts to check.
+ **
+ **  SMTP_ONLY	is a pathname, that if it exists contains a list of hosts
+ **		that is to be checked against instead of the full
+ **		gethostsbyname database.  This is for sites that still
+ **		have all the arpanet hosts defined in the BSD 4.2 /etc/hosts
+ **		file, even though they are not on the arpanet.  If this is
+ **		not defined, this check won't be made.
+ **
+ **  SMTP_EXCEPT	is a pathname, that if it exists contains a list of hosts
+ **		that are in the gethostbyname database, but don't run SMTP
+ **		for one reason or another.  If this is not defined, this
+ **		check won't be made.
+ **
+ **  meissner@dg_rtp	(probably meissner@DG.COM soon)
+ */
+ 
+ # ifdef  SENDMAIL
+ /*# define SMTP					/* Check local hosts */
+ /*# define SMTP_FORM	UUCP			/* Local hosts routing format*/
+ /*# define SMTP_DOMAIN	".ETHER"		/* domain to append to local */
+ /*# define SMTP_ONLY	"/usr/lib/hosts.only"	/* Only hosts to use SMTP */
+ /*# define SMTP_EXCEPT	"/usr/lib/hosts.except"	/* Hosts in database, no SMTP*/
+ /*# define SMTP_HFILE	"/etc/hosts"		/* host database */
+ # endif
+ 
+ /*
  **  The ALIAS definitions are used only if SENDMAIL is NOT defined.
  **  Sites using sendmail have to let sendmail do the aliasing.
  **  ALIAS, must be defined, however, even if not used.
***************
*** 37,42
  # endif
  
  
  # ifdef BSD
  # define GETHOSTNAME			/* use gethostname() */
  # else

--- 97,105 -----
  # endif
  
  
+ # ifndef GETHOSTNAME
+ # ifndef UNAME
+ 
  # ifdef BSD
  # define GETHOSTNAME			/* use gethostname() */
  # else
***************
*** 43,48
  # define UNAME 				/* use uname() */
  # endif
  
  /* if defined, HOSTNAME overrides UNAME and GETHOSTNAME */
  /* # define HOSTNAME   "host"		/* literal name */
  

--- 106,114 -----
  # define UNAME 				/* use uname() */
  # endif
  
+ # endif
+ # endif
+ 
  /* if defined, HOSTNAME overrides UNAME and GETHOSTNAME */
  /* # define HOSTNAME   "host"		/* literal name */
  
***************
*** 140,146
  # define HANDLE	JUSTUUCP	/* see HANDLE definition below */
  # define ROUTING JUSTDOMAIN	/* see ROUTING definition below */
  
! # define LMAIL(frm,sys) 	"%s -em -f%s",SENDMAIL,frm
  # define LARG(user)		" '%s'",postmaster(user)
  # define RLARG(sys,frm)		" '%s!%s'",sys,frm
  # define LFROM(frm,now,host)	"From %s %.24s\n",frm,now

--- 206,212 -----
  # define HANDLE	JUSTUUCP	/* see HANDLE definition below */
  # define ROUTING JUSTDOMAIN	/* see ROUTING definition below */
  
! # define LMAIL(frm,sys) 	"%s -em -f%s %s", SENDMAIL, frm, VFLAG
  # define LARG(user)		" '%s'",postmaster(user)
  # define RLARG(sys,frm)		" '%s!%s'",sys,frm
  # define LFROM(frm,now,host)	"From %s %.24s\n",frm,now
***************
*** 153,159
  #ifdef BSD
  # define LMAIL(frm,sys)		"/bin/mail"	/* BSD local delivery agent */
  #else
! # define LMAIL(frm,sys)		"/bin/lmail"	/* SV  local delivery agent */
  #endif
  
  # define LARG(user)		" '%s'",postmaster(user)

--- 219,225 -----
  #ifdef BSD
  # define LMAIL(frm,sys)		"/bin/mail"	/* BSD local delivery agent */
  #else
! # define LMAIL(frm,sys)		"/bin/lmail" 	/* SV  local delivery agent */
  #endif
  
  # define LARG(user)		" '%s'",postmaster(user)

Index: main.c
*** .orig/main.c	Mon Apr  6 16:22:13 1987
--- main.c	Mon Apr  6 16:21:21 1987
***************
*** 30,35
  **		-m number	limit on number of uux_noqueue jobs
  **		-u string	string of flags for uux
  **		-a aliasfile	aliases filename (not used with SENDMAIL)
  */
  
  #include	<stdio.h>

--- 30,37 -----
  **		-m number	limit on number of uux_noqueue jobs
  **		-u string	string of flags for uux
  **		-a aliasfile	aliases filename (not used with SENDMAIL)
+ **		-i		ignored to allow mailx/Mail use smail directly
+ **				instead of through sendmail.
  */
  
  #include	<stdio.h>
***************
*** 84,90
  	int nargc;
  	char **nargv, **alias();
  
! 	char *optstr = "dvrRlLH:h:p:u:q:a:m:f:";
  	extern char *optarg;
  	extern int optind;
  

--- 86,92 -----
  	int nargc;
  	char **nargv, **alias();
  
! 	char *optstr = "divrRlLH:h:p:u:q:a:m:f:";
  	extern char *optarg;
  	extern int optind;
  
***************
*** 106,111
  */
  	while ((c = getopt(argc, argv, optstr)) != EOF) {
  		switch ( c ) {
  		case 'd': debug      = YES; 		break;
  		case 'v': debug      = VERBOSE; 	break; 
  		case 'r': routing    = ALWAYS;		break;

--- 108,114 -----
  */
  	while ((c = getopt(argc, argv, optstr)) != EOF) {
  		switch ( c ) {
+ 		case 'i': ;				break;
  		case 'd': debug      = YES; 		break;
  		case 'v': debug      = VERBOSE; 	break; 
  		case 'r': routing    = ALWAYS;		break;

Index: resolve.c
*** .orig/resolve.c	Mon Apr  6 16:22:18 1987
--- resolve.c	Mon Apr  6 16:21:22 1987
***************
*** 18,23
  #include <string.h>
  #endif
  
  extern int exitstat;		/* set if address doesn't resolve 	*/
  extern enum ehandle handle;	/* what mail we can handle		*/
  extern enum edebug debug;	/* verbose and debug modes		*/

--- 18,31 -----
  #include <string.h>
  #endif
  
+ #ifdef  SMTP
+ int localhost();
+ int smtp_check();
+ 
+ #define	SMTP_FAIL	0	/* smtp_check failure code.		*/
+ #define SMTP_OK		1	/* smtp_check success code.		*/
+ #endif
+ 
  extern int exitstat;		/* set if address doesn't resolve 	*/
  extern enum ehandle handle;	/* what mail we can handle		*/
  extern enum edebug debug;	/* verbose and debug modes		*/
***************
*** 97,102
  DEBUG("resolve: parse address '%s' = '%s' @ '%s' (%s)\n",
  	temp,user,domain,sform(form));
  
  /*
  **  If we are looking at a substring (that's not the entire string)
  **  which parses to a LOCAL address, we skip to the next larger substring.

--- 105,112 -----
  DEBUG("resolve: parse address '%s' = '%s' @ '%s' (%s)\n",
  	temp,user,domain,sform(form));
  
+ #ifdef SMTP
+ 
  /*
  **  Check the local hosts before checking other hosts.  If a localhost is
  **  then check the files containing the only allowed hosts (SMTP_ONLY) and
***************
*** 98,103
  	temp,user,domain,sform(form));
  
  /*
  **  If we are looking at a substring (that's not the entire string)
  **  which parses to a LOCAL address, we skip to the next larger substring.
  */

--- 108,134 -----
  #ifdef SMTP
  
  /*
+ **  Check the local hosts before checking other hosts.  If a localhost is
+ **  then check the files containing the only allowed hosts (SMTP_ONLY) and
+ **  the hosts not allowed to mail to (SMTP_EXCEPT).  Typically one or both
+ **  will be missing.  If they are not defined, the corresponding check is
+ **  not done.  Since they are sequential files, it is assumed that they
+ **  contain very few entries.
+ */
+ 
+ 		if( i == 0 && domain[0] != '\0' ){
+ 			if( form == UUCP || form == DOMAIN ){
+ 				if( localhost( user, domain, temp )){
+ 					form = LOCAL;
+ 					break;
+ 				}
+ 			}
+ 		}
+ 
+ #endif	/* SMTP */
+ 
+ 
+ /*
  **  If we are looking at a substring (that's not the entire string)
  **  which parses to a LOCAL address, we skip to the next larger substring.
  */
***************
*** 126,131
  			}
  /*
  **  After routing, reparse the new route into domain and user. 
  */
  			form = parse( temp, domain, user );
  

--- 157,164 -----
  			}
  /*
  **  After routing, reparse the new route into domain and user. 
+ **  If we have SMTP and the host is accessable through SMTP, convert it
+ **  to the prefered format.
  */
  			form = parse( temp, domain, user );
  
***************
*** 129,134
  */
  			form = parse( temp, domain, user );
  
  DEBUG("resolve: parse route '%s' = '%s' @ '%s' (%s)\n",
  	temp,user,domain,sform(form));
  

--- 162,172 -----
  */
  			form = parse( temp, domain, user );
  
+ #ifdef SMTP
+ 			if( localhost( user, domain, temp ))
+ 				form = LOCAL;
+ #endif
+ 
  DEBUG("resolve: parse route '%s' = '%s' @ '%s' (%s)\n",
  	temp,user,domain,sform(form));
  
***************
*** 222,227
  **	uucp ( remember stripping top level? )
  **	SMARTHOST
  **  Returns with error if we find no path.
  */
  	for(step = 0; (step < domains); step++) {
  		if((getpath(domainv[step]-1, path, cost) == EX_OK) /* w/ dot */

--- 260,269 -----
  **	uucp ( remember stripping top level? )
  **	SMARTHOST
  **  Returns with error if we find no path.
+ **
+ **  To work around the problem of addressing a localhost that unfortunately
+ **  is spelled the same as a domain, the order of the two getpath's is
+ **  changed.		meissner@.DG.COM
  */
  	for(step = 0; (step < domains); step++) {
  		if((getpath(domainv[step]  , path, cost) == EX_OK) /* no dot */
***************
*** 224,231
  **  Returns with error if we find no path.
  */
  	for(step = 0; (step < domains); step++) {
! 		if((getpath(domainv[step]-1, path, cost) == EX_OK) /* w/ dot */
! 		|| (getpath(domainv[step]  , path, cost) == EX_OK))/* no dot */
  			break;
  	}
  

--- 266,273 -----
  **  changed.		meissner@.DG.COM
  */
  	for(step = 0; (step < domains); step++) {
! 		if((getpath(domainv[step]  , path, cost) == EX_OK) /* no dot */
! 		|| (getpath(domainv[step]-1, path, cost) == EX_OK))/* w/ dot */
  			break;
  	}
  
***************
*** 267,269
  	(void) sprintf(result, path, temp);
  	return( EX_OK );
  }

--- 309,502 -----
  	(void) sprintf(result, path, temp);
  	return( EX_OK );
  }
+ 
+ 
+ #ifdef	SMTP
+ 
+ /*
+ **  Support routine for SMTP to check if a host is really a local host or not.
+ */
+ 
+ #ifndef SMTP_HFILE
+ 
+ /*
+ **  We have gethostbyname, pull in the necessary declarations.
+ */
+ 
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netdb.h>
+ 
+ extern struct hostent *gethostbyname();
+ #endif
+ 
+ 
+ struct open_file {			/* cache of SMTP_<HFILE,ONLY,EXCEPT> */
+ 	FILE	*stream;		/* stream file is opened on */
+ 	int	 init;			/* true if initialized */
+ };
+ 
+ static struct open_file only;
+ static struct open_file except;
+ static struct open_file hostfile;
+ 
+ 
+ /*
+ **  localhost(): Return true if a host is available directly through sendmail.
+ **  Also if true transform the path into the final path used.
+ */
+ 
+ localhost( user, domain, temp )
+ 
+ char *user;				/* username to send to */
+ char *domain;				/* domain to check if localhost */
+ char *temp;				/* temporary array */
+ 
+ {
+ 
+ /*
+ **  Check if host is a localhost or not.  If not, return.
+ */
+ 
+ 
+ 
+ /*
+ **  Host was found, check if it's in the only list or exclusion list.
+ **  If there is an only list, check that and don't bother checking the
+ **  full host list.
+ */
+ 
+ #if defined(SMTP_ONLY)
+ 	if( smtp_check( domain, SMTP_ONLY, SMTP_OK, &only ))
+ 		return( 0 );
+ 
+ #else
+ #if !defined(SMTP_HFILE)
+ 
+ 	struct hostent *p;		/* check name with gethostbyname */
+ 
+ 	if((p = gethostbyname(domain)) == (struct hostent *)0 ||
+ 	    p->h_addrtype != AF_INET )
+ 		return( 0 );
+ #else
+ 					/* check name by scanning /etc/hosts */
+ 	if( !smtp_check( domain, SMTP_HFILE, SMTP_FAIL, &hostfile ))
+ 		return( 0 );
+ #endif
+ 
+ 
+ #if defined(SMTP_EXCEPT)
+ 	if( !smtp_check( domain, SMTP_EXCEPT, SMTP_FAIL, &except ) )
+ 		return( 0 );
+ #endif
+ #endif
+ 
+ 
+ /*
+ **  Host is indead a localhost, transform it to the specified format (add
+ **  any domains needed and use @ or ! notation.
+ */
+ 
+ #ifdef SMTP_DOMAIN
+ 	if( SMTP_DOMAIN[0] != '\0' ){
+ 		if( SMTP_DOMAIN[0] != '.' )
+ 			(void) strcat( domain, "." );
+ 
+ 		(void) strcat( domain, SMTP_DOMAIN );
+ 	}
+ #endif
+ 
+ DEBUG("localhost: found local host '%s', addressing via '%s'\n",
+ 	domain,sform(SMTP_FORM));
+ 
+ 	(void) strcpy( temp, user );
+ 	build( domain, temp, SMTP_FORM, user );
+ 	domain[0] = '\0';
+ 	return( 1 );
+ }
+ 
+ 
+ /*
+ **  smtp_check(): Check if host is in a special allowed/disallowed category.
+ **  This is in case a host is present in the gethostbyname database, but does
+ **  not talk SMTP for some reason.
+ */
+ 
+ smtp_check( domain, filename, not_found, cache )
+ 
+ char		 *domain;		/* hostname to check */
+ char		 *filename;		/* filename to check */
+ int		  not_found;		/* return code if file not found */
+ struct open_file *cache;		/* cache of open file */
+ 
+ {
+ 	register char	*p;		/* temp pointer to scan line */
+ 	register int	 ch;
+ 
+ 	FILE	*stream;		/* file to check against */
+ 	int	 ret;			/* return value */
+ 	char	 buffer[SMLBUF];	/* line from the line */
+ 
+ 					/* state machine for parsing line */
+ 	enum state { S_SPACE, S_NORM, S_COMMENT } state;
+ 
+ 
+ 	if( cache->init ){
+ 		if( cache->stream == (FILE *)0 )
+ 			return not_found;
+ 
+ 	} else {
+ 		cache->init++;
+ 		if( (cache->stream = fopen( filename, "r" )) == (FILE *)0 ){
+ 			DEBUG( "smtp_check: file %s could not be opened.\n",
+ 				filename);
+ 
+ 			return not_found;
+ 		}
+ 	}
+ 
+ 	ret   = SMTP_FAIL;
+ 	state = S_SPACE;
+ 	p     = buffer;
+ 
+ 	while( (ch = getc(cache->stream)) != EOF ){
+ 
+ 		if( state == S_COMMENT ){
+ 			if( ch == '\n' )
+ 				state = S_SPACE;
+ 		}
+ 
+ 		else if( isspace(ch) ){		/* end of field? */
+ 			if( state == S_NORM ){
+ 				*p = '\0';
+ 				if( strcmp( buffer, domain ) == 0 ){
+ 					ret = SMTP_OK;
+ 					break;
+ 				}
+ 				state = S_SPACE;
+ 			}
+ 
+ 		} /* end of isspace */
+ 
+ 		else if( ch == '#' )	/* comment character */
+ 			state = S_COMMENT;
+ 
+ 		else if( state == S_SPACE ){
+ 			state = S_NORM;	/* remember word start */
+ 			p     = buffer;
+ 			*p++  = ch;
+ 		}
+ 
+ 		else	*p++ = ch;	/* normal char */
+ 
+ 	} /* while to read file */
+ 
+ 
+ 	DEBUG( "smtp_check: '%s' was %sfound in %s\n", domain,
+ 		(ret == SMTP_FAIL) ? "not " : "", filename );
+ 
+ 	return ret;
+ 
+ } /* smtp_check */
+ 
+ #endif

Index: svbinmail.c
*** .orig/svbinmail.c	Mon Apr  6 16:22:19 1987
--- svbinmail.c	Mon Apr  6 16:21:23 1987
***************
*** 18,23
  #include <string.h>
  #endif
  
  #ifdef SENDMAIL
  #define SENDER	SENDMAIL
  #else

--- 18,27 -----
  #include <string.h>
  #endif
  
+ #ifdef SV_USE_SMAIL
+ #undef SENDMAIL				/* smail (aka /bin/rmail) as mailer */
+ #endif
+ 
  #ifdef SENDMAIL
  #define SENDER	SENDMAIL
  #else
***************
*** 50,56
  	if(argc == 1) {
  		reading = TRUE;
  	} else {
! 		while((c = getopt(argc, argv, "epqrtf:")) != EOF) {
  			switch(c) {
  			case 'e':
  			case 'p':

--- 54,60 -----
  	if(argc == 1) {
  		reading = TRUE;
  	} else {
! 		while((c = getopt(argc, argv, "epqrtfv:")) != EOF) {
  			switch(c) {
  			case 'e':
  			case 'p':
***************
*** 60,65
  				reading = TRUE;
  				break;
  			case 't':
  				sending = TRUE;
  				break;
  			default:

--- 64,70 -----
  				reading = TRUE;
  				break;
  			case 't':
+ 			case 'v':
  				sending = TRUE;
  				break;
  			default:
***************
*** 100,104
  usage()
  {
  	(void) fprintf(stderr, "usage:\t%s [ -epqr ] [ -f file ]\n", prog);
! 	(void) fprintf(stderr, "\t%s [ -t ] persons\n", prog);
  }

--- 105,109 -----
  usage()
  {
  	(void) fprintf(stderr, "usage:\t%s [ -epqr ] [ -f file ]\n", prog);
! 	(void) fprintf(stderr, "\t%s [ -tv ] persons\n", prog);
  }
-- 
Michael Meissner, Data General.		Uucp: ...!mcnc!rti!xyzzy!meissner
					Arpa/Csnet:  meissner@dg-rtp.DG.COM

mouse@mcgill-vision.UUCP (der Mouse) (04/06/88)

In article <35@mozart.UUCP>, rosalia@mozart.UUCP (Mark Galassi) writes:
> In article <1103@uokmax.UUCP> rob@uokmax.UUCP (Robert K. Shull) writes:
>> We just finished connecting to Midnet (which allows us Internet
>> access.)  Is there any good way to set up routing tables which
>> include both uucp and the machines which we can connect to directly?
>> I don't really want to create a huge local entry for pathalias to
>> work on. Any suggestions would be much appreciated.

If you come up with any good solutions I'd be interested in hearing
about them.  We are in the same situation - uucp connectivity, but also
on the Internet - and have all the attendant problems.  (See below for
how we handle them.)

> One good solution is to use the "sendmail.cf" file (I presume you
> have sendmail) that is provided with "smail".  It [...] allows you to
> have a "hosts.smtp" file which lists all the hosts you talk to
> directly via smtp.

Unfortunately....

In article <13527@uflorida.cis.ufl.EDU>, esj@beach.cis.ufl.edu (Eric S. Johnson) writes:
> You will not want to keep any kind of hosts table for this many
> hosts.

Nor could you if you did want to.  The thing would be perpetually
out-of-date, because FooBar U. isn't going to inform you every time
they add a new machine.

> Luckly, the friendly folks who put together the Internet thought of
> this, and developed the Domain Name Servers.  [Explanation of what
> this is, and how MX records help.]

> [MX-record capable sendmail] takes care of the true Internet domains,
> and most "registered" UUCP hosts.  As for unregistered UUCP hosts and
> "fake domains" (I.E. .UUCP) your best bet is to pass them on to your
> smart pathalias based mailer.

The problem is to tell the difference!

Someone just handed me big_bird@ihnp4; presumably I should send this to
pathalias.  Now, if someone hands me miss_piggy@uunet, how do I know to
do smtp to uunet.uu.net instead?

(Currently, we punt and give an error for both of the above.  Direct
uucp links of course get sent directly, bang notation and the fake
.uucp domain get sent through pathalias, and everything else must have
at least an MX record.  Full details available on request.)

I predict you will also find yourself cursing the fact that sendmail
won't let you rewrite the envelope addresses without rewriting the
header addresses.  Rewriting the header addresses is wrong (unless they
aren't in rfc822 form), but rewriting the envelope addresses is
necessary...sigh.

					der Mouse

			uucp: mouse@mcgill-vision.uucp
			arpa: mouse@larry.mcrcim.mcgill.edu

avolio@decuac.dec.com (Frederick M. Avolio) (04/06/88)

You should send all u@host.domain via the internet for any valid internet
domain.  Send via smail/pathaliase/whatever for everything else.  This
would include an address in the form h!u@uunet since uunet does not have
( in that address) a domain attached to it.  You can edit sendmail.cf for
other special cases if you want.

Fred