From: heiby@mcdchg.chg.mcd.mot.com (Ron Heiby)
Newsgroups: news.software.b
Subject: C News ihave/sendme - Still Confused?
Date: 7 Apr 92 21:43:59 GMT
Organization: Motorola Computer Group, Schaumburg, IL

Well, I've read just about everything I could find in the distribution
documentation concerning ihave/sendme, and I'm still confused.  I'm
hoping to convert my news system to C News within the next few days,
and don't want to screw up my existing downstream sites.  Writing this
article has helped me a great deal in understanding how ihave/sendme
works.  If I'm still messed up, somebody please let me know.  If I'm
right, somebody please let me know.  I hope that this additional
wording ends up helping someone else understand what's going on.
Frankly, I think life just got a whole lot more complex.

Here is the sample ihave/sendme section of the default "sys" file.  It
seems to be essentially similar to the examples in the documentation.
I am adding my own "numbering" scheme to the active lines, so I know
what I'm talking about.  My "numbering" is the "[A]", "[B]", etc.  I
am assuming for purposes of this example, that site "louie" has a
similar set of lines, pointing at me, mcdchg.

# sample ihave/sendme link
# NOTE, this is the old ihave/sendme, not related to NNTP in any way.
# Send ihave telling louie what we have -- batcher turns the batch into a
# giant control message and posts it to "to.louie".  (#1)
louie:comp,news,sci,rec,misc,soc,talk,!to/all,!sendme,!ihave:I:louie.ihave/togo
# Previous line is [A].

# Send sendme in response to ihave from louie -- again, turned by batcher
# into giant control message posted to "to.louie".  (#3)
louie-send-ids:to.louie/ihave:I:louie.sendme/togo
# Previous line is [B].

# Transmit said giant control messages by normal batching.  (#2,#4)
louie-ctl:to.louie/all,!sendme,!ihave:f:louie/togo
# Previous line is [C].

# Send articles in response to sendme messages from louie. (#5)
louie-real:to.louie/sendme:f:louie/togo
# Previous line is [D].

# Actually the last two could be combined.
# also, since ihave/sendme is slow, send local postings to louie without
# waiting (beware ihave/sendme)
louie-local:comp,news,sci,rec,misc,soc,talk/all,!sendme,!ihave:L:
# Previous line is [E].

Ok.  Now, we're ready to begin as I try to explain, in my own words,
how ihave/sendme works in C News.  This explanation doesn't entirely
make sense to me.  However, what I write below is the only thing I
have come up with that assumes that the example is correct and
actually works.  I think that my main confusion was thinking that an
ihave or sendme article posted to to.louie would match a newsgroup
specification of to.louie.  Rather, an "ihave louie" article that
shows up, in whatever newsgroup, matches a newsgroup specification of
to.louie, if the distribution includes "ihave".

1.  I post an article to misc.misc.  This is a normal article, so it
hits line [A] and matches.  The "I" flag says that we're doing the
ihave trick here, so puts the Message-ID into louie.ihave/togo.  It
also matches line [E], because it is a local posting.  (I'd prefer to
ignore this case, so let's change the above statement to be, "mcdchg
receives an article from another system, posted to misc.misc."  This
way, we can pretend that louie doesn't have the article.)

2.  sendbatches runs.  It finds the louie.ihave/togo and runs batchih
to create an "ihave mcdchg" control article which is posted to the
to.louie newsgroup on the local machine.

3.  When relaynews is looking for a line to tell it what to do with
this ihave control article, it looks for a line that matches
"to.louie", because that is the newsgroup to which it was posted.
Line [A] doesn't match, because of the "!to" in the newsgroups
section.  Line [B] does not match, because the ihave is an "ihave
mcdchg", and this line will match only an "ihave louie" control
article.  It *does* match line [C], because it includes newsgroup
to.louie, and this is not a magic incoming ihave.  It's an outgoing
ihave, which has no magic.  It does not match line [D], because that
line is only for magic incoming sendme control articles.  The match on
line [C] causes the (control/NNN) pathname to be added to louie/togo.

4.  sendbatches finds the control/NNN line in louie/togo and adds the
article to an ordinary batch heading for louie in whatever way batches
go to louie.

5.  louie gets the batch and un-batches it.  It finds the "ihave
mcdchg" control message posted to "to.louie".  This article matches
louie's version of line [B], because that line has "to.mcdchg" in its
newsgroups portion, and is an incoming ihave, so relaynews puts the
message ids of needed articles onto mcdchg.sendme/togo, because of the
magic "I" flag, which says to put the message ids into the file,
instead of the pathname.

6.  sendbatches on louie finds the mcdchg.sendme/togo file and batchsm
is run to create a "sendme louie" control article, posted to the
to.mcdchg newsgroup on louie.

7.  relaynews on louie looks for a line to tell it what to do with
this sendme article, and finds louie's line [C], for the same reason
that my step 3 worked.  sendbatches on louie forwards the article to
mcdchg.

8.  mcdchg receives and unpacks the batch and finds the sendme article,
posted to "to.mcdchg".  relaynews looks for a match.  Since this is a
"sendme louie" article, relaynews is looking for a match on newsgroup
to.louie, with distribution "sendme", finding line [D], which tells
relaynews to put the path for the article (misc/misc/NNN) onto the
louie/togo file for normal batching, later.

One thing that still troubles me a bit is the comment after lines [C]
and [D], "Actually the last two could be combined."  I believe that I
understand this.  I believe that lines [C] and [D] were split to make
things more clear.  In real life, I believe that one could replace
them with a line that looked like:

louie-foo:to.louie/all,!ihave:f:louie/togo

Also, if I read things right, the trailing colon (:) in [E] is not
required.-- 
Ron Heiby, heiby@chg.mcd.mot.com	Moderator: comp.newprod
"Not having sendmail is like not having VD."
Newsgroups: news.software.b