[news.software.nntp] "Path"

del@thrush.mlb.semi.harris.com (Don Lewis) (10/18/90)

In article <1990Oct3.145435.19729@wdl1.wdl.fac.com> wrl@wdl1.wdl.fac.com (Bill Lewandowski) writes:
>Hi,
>Have a question on path,
>our return paths look like this with Cnews (latest version):
>
>Path: wdl1.wdl.fac.com!wdl30!ronc
>From: ronc@wdl30.wdl.fac.com (Ron Coll)
>
>We do no get good responces from people because
>the return path should be:
>
>Path: wdl1.wdl.fac.com!wdl30.wdl.fac.com!ronc
>

If you are posting from the other hosts using the mini-inews supplied
with nntp and gethostbyname() does not return a fully qualified domain
name for the current host (as on Suns using YP/NIS), then the mini-inews
will append the configured value of DOMAIN to the From: header, but not
the Path: (and Originator: in 1.5.10) header.  A simple-minded patch (for
1.5.10) follows.

-----------------------------Cut Here---------------------------------
*** ORIGinews.c	Fri Aug 10 23:53:40 1990
--- inews.c	Wed Sep 19 01:43:15 1990
***************
*** 164,170 ****
--- 164,179 ----
  				if (!seen_fromline)
  					gen_frompath(FROM);
  				else
+ #ifdef DOMAIN
+ 				{
+ 					if (index( host_name, '.'))
  fprintf(ser_wr_fp, "Originator: %s@%s\r\n", passwd->pw_name, host_name);
+ 					else
+ fprintf(ser_wr_fp, "Originator: %s@%s.%s\r\n", passwd->pw_name, host_name, DOMAIN);
+ 				}
+ #else /* DOMAIN */
+ fprintf(ser_wr_fp, "Originator: %s@%s\r\n", passwd->pw_name, host_name);
+ #endif /* DOMAIN */
  			} else {
  			        continue;
  			}
***************
*** 350,357 ****
--- 359,375 ----
  	/* Only the login name - nntp server will add uucp name */
  		fprintf(ser_wr_fp, "Path: %s\r\n", passwd->pw_name);
  #else /* HIDDENNET */
+ #ifdef DOMAIN
+ 		if (index(host_name, '.'))
+ 			fprintf(ser_wr_fp, "Path: %s!%s\r\n", host_name,
+ 				passwd->pw_name);
+ 		else
+ 			fprintf(ser_wr_fp, "Path: %s.%s!%s\r\n", host_name,
+ 				DOMAIN, passwd->pw_name);
+ #else /* DOMAIN */
  		fprintf(ser_wr_fp, "Path: %s!%s\r\n", host_name,
  			passwd->pw_name);
+ #endif /* DOMAIN */
  #endif /* HIDDENNET */
  	}
  }
-----------------------------Cut Here---------------------------------
-- 
Don "Truck" Lewis                      Harris Semiconductor
Internet:  del@mlb.semi.harris.com     PO Box 883   MS 62A-028
Phone:     (407) 729-5205              Melbourne, FL  32901

leres@ace.ee.lbl.gov (Craig Leres) (10/23/90)

Don Lewis writes:
> If you are posting from the other hosts using the mini-inews supplied
> with nntp and gethostbyname() does not return a fully qualified domain
> name for the current host (as on Suns using YP/NIS), [...]

If this is your problem then the hosts file you're loading into the yp
map is wrong. The h_name field of the hostnet struct is supposed to be
the official (read canonical) name of the host. This means that you
really want the fully qualified domain name first:

	128.3.112.36    dog.ee.lbl.gov dog

it breaks more than the mini-inews if the "alias" appears first.

		Craig

del@thrush.mlb.semi.harris.com (Don Lewis) (10/23/90)

In article <7714@dog.ee.lbl.gov> leres@helios.ee.lbl.gov (ucbvax!leres for uucp weenies) writes:
>Don Lewis writes:
>> If you are posting from the other hosts using the mini-inews supplied
>> with nntp and gethostbyname() does not return a fully qualified domain
>> name for the current host (as on Suns using YP/NIS), [...]
>
>If this is your problem then the hosts file you're loading into the yp
>map is wrong. The h_name field of the hostnet struct is supposed to be
>the official (read canonical) name of the host. This means that you
>really want the fully qualified domain name first:
>
>	128.3.112.36    dog.ee.lbl.gov dog
>
>it breaks more than the mini-inews if the "alias" appears first.

Well, we've been running this way for several years now and mini-inews
is all that appears to be broken.

I agree that the h_name entry of the hostent struct should be the
official name of the host, i.e. it should match hostname(1), but
there are problems with making this a fully qualified domain name.

    Maintaining a host file with both the FQDN and the short version
    of the name is painful:
	x.x.x.x    thrush.mlb.semi.harris.com thrush
    Since we are using YP/NIS (no resolver search rules), the alias
    is necessary so that users don't always have to type the FQDN's.

    There are host name length restrictions scattered about, so
    host names get truncated, including all of our local host
    names.
	char ut_host[16]; in utmp
    Programs such as who, finger, and netstat only have a limited
    space in which to display host names.

    Putting FQDN's in .rhosts/hosts.equiv is a pain, and greatly
    adds to the bloat in netgroups.

All of the above are either esthetic problems or workarounds are
possible, but it was easier for me to just use short names and fix
mini-inews.

BTW, Sun's documentation only uses short names in /etc/hosts and
sunintall does not append the domain name when creating /etc/hosts.

Followup to comp.unix.admin.
-- 
Don "Truck" Lewis                      Harris Semiconductor
Internet:  del@mlb.semi.harris.com     PO Box 883   MS 62A-028
Phone:     (407) 729-5205              Melbourne, FL  32901

wrl@wdl1.wdl.fac.com (Bill Lewandowski) (10/23/90)

leres@ace.ee.lbl.gov (Craig Leres) writes:

>Don Lewis writes:
>> If you are posting from the other hosts using the mini-inews supplied
>> with nntp and gethostbyname() does not return a fully qualified domain
>> name for the current host (as on Suns using YP/NIS), [...]

>If this is your problem then the hosts file you're loading into the yp
>map is wrong. The h_name field of the hostnet struct is supposed to be
>the official (read canonical) name of the host. This means that you
>really want the fully qualified domain name first:

>	128.3.112.36    dog.ee.lbl.gov dog

>it breaks more than the mini-inews if the "alias" appears first.

>		Craig

Well Craig I have to differ from you. We have used the unqualified name
or aliases for all our YP domains with no problems. This actually has helped
us out. We identify each host by the alias for all YP functions. Using the
fully qualified name in the past had problems.

For mail, the sendmail.cf file qualifies the name when need be. No mail
can leave without being qualified.

Don Lewis was right that my problem is I dont use fully qualified
names and thus my return paths get screwwed up. Now, the return path should not
be used for replies via mail but some systems seem to use them. I have
not figured this one out yet. The originator shows the fully qualified
name of the sender (I guess that come from cnews and the config in
/usr/lib/news.

I guess I have to live with my unqualified names because we are not going to
redo our YP in 6 domains and over 300 hosts.

-- 
Bill Lewandowski		Ford Aerospace Corp. - San Jose
FORDNET II 473-4362		Internet: wrl@wdl1.wdl.fac.com
AT&T (408) 473-4362		UUCP: wdl1!wrl
FAX: (408) 473-7926		Pager: Upon Request

del@thrush.mlb.semi.harris.com (Don Lewis) (10/24/90)

In article <1990Oct23.152106.15465@wdl1.wdl.fac.com> wrl@wdl1.wdl.fac.com (Bill Lewandowski) writes:
>Don Lewis was right that my problem is I dont use fully qualified
>names and thus my return paths get screwwed up. Now, the return path should not
>be used for replies via mail but some systems seem to use them.

The Path: is also used to prevent articles from being sent through sites
that they have already been sent through.  For example, there is a well
known site called "mintaka".  We have a local host called "mintaka".  Before
I patched mini-inews to put the fully qualified host name in the Path:,
articles submitted by a user on our mintaka, would not be sent to the
well known mintaka because its neighbors saw "mintaka" in the Path: and
thought that the article had already passed through there.

>
>I guess I have to live with my unqualified names because we are not going to
>redo our YP in 6 domains and over 300 hosts.

If you are running DNS and YP (using makedbm -b), you can just link
mini-inews with -lresolv if you have an /etc/resolv.conf on each host.
Otherwise, you can fix mini-inews with the patch I posted earlier which
tacks on the #define'd domain name if none is present.
-- 
Don "Truck" Lewis                      Harris Semiconductor
Internet:  del@mlb.semi.harris.com     PO Box 883   MS 62A-028
Phone:     (407) 729-5205              Melbourne, FL  32901