Removing obsolete control messages in INN 2.7
Julien ÉLIE
julien at trigofacile.com
Sat Dec 4 13:41:02 UTC 2021
Hi Russ,
> send-ihave is the script that generates the ihave control message. Note
> this bit, buried down in the bottom of the script:
>
> ## Write out the batchfile as a control message, in clumps.
> export SITE PERMESSAGE BATCHFILE
> while test -s ${BATCHFILE} ; do
> (
> echo Newsgroups: to.${SITE}
> echo Control: ihave `innconfval pathhost`
> echo Subject: cmsg ihave `innconfval pathhost`
> echo ''
> ${SED} -e ${PERMESSAGE}q <${BATCHFILE}
> ) | ${INEWS} -h
> ${SED} -e "1,${PERMESSAGE}d" <${BATCHFILE} >${BATCHFILE}.tmp
> mv ${BATCHFILE}.tmp ${BATCHFILE}
> done
>
> Essentially, it transforms the batch for a site into an ihave control
> message and posts it to the to.* newsgroup for that peer.
I've just taken the time to test the whole thing.
Here is what I found out to work, and suggest for the man page.
Does it sound good to you?
"""
B<send-ihave> encapsulates Message-IDs in an ihave control message and uses
B<inews> to send the control message to a C<to.hostname> pseudo-newsgroup.
For instance, to generate ihave control messages for F<news.server.com>
when receiving articles in the comp.* hierarchy, just add the following
line in your F<newsfeeds> file (and reload it):
news.server.com.ihave:comp.*:Tf,Wm:
(Note that if you send C<*> to C<news.server.com>, you should add C<@to, at to.*>
to the end of the newsgroup pattern so as not to propose it twice the ihave
control message that will be generated by B<send-ihave>. You may also want
to add that pattern to the end of any entry processing control articles,
like B<controlchan>, or being fed a C<*> pattern.)
Then, periodically run out of cron(1) the following command:
send-ihave news.server.com
B<send-ihave> will then post to the C<to.news.server.com> pseudo-newsgroup
an ihave control article containing a list of Message-IDs. Several control
articles may be posted, each one containing up to 1000 Message-IDs.
Make sure the C<to.news.server.com> pseudo-newsgroup exists on your server (or
the C<to> pseudo-newsgroup if I<mergetogroups> is set to true in F<inn.conf>),
and that ihave control articles are not filtered (the default Cleanfeed
configuration rejects them). These control articles will be filed in the
C<control> pseudo-newsgroup (or C<control.ihave> if it exists), or C<to>
if I<mergetogroups> is set to true.
You now have to propagate them with any method you want to the remote server.
You probably already had one set up, in which case you only have to add
the C<to.news.server.com> newsgroup in the list of groups to feed it.
(See how send-uucp(8) works to set up a UUCP feed.)
"""
Also, the following behaviour in innd(8) does not seem to work. When I tested,
the ihave control article (as well as any regular article, not control ones)
is not sent to the given <sitename> in to.<sitename> but propagates according
to the rules in newsfeeds. All entries receive it, if configured to. Even
though there is an entry with the exact name.
Maybe it used to work but no longer is.
(innd man page)
"""
Finally, articles posted to newsgroups beginning with C<to.> are treated
specially. Provided that either that newsgroup exists in the F<active> file
or I<mergetogroups> is set in F<inn.conf>, the remainder of the newsgroup
is taken to be a site name, as configured in F<newsfeeds>, and the article
is sent to that site. If I<mergetogroups> is set, the article will be
filed in the group named C<to> (which must exist in the F<active> file). For
example, with I<mergetogroups> set, an article posted to C<to.uunet> will
be filed in C<to> and sent to the site C<uunet>.
"""
Unless I understand it wrong, only "uunet" should receive the article.
During my tests, all sites receive it.
I just suggest to reword the paragraph and say that normal newsfeeds rules
apply; "to" groups should be included or excluded in newsgroups patterns
according to what should be fed.
> There is obviously no signing on those messages, and I'm not sure if INN
> safely restricts who can send to the relevant to.* group and only honors
> control messages in that group correctly, which would be necessary. It
> might!
There is no such restriction by default. I managed to post to to.* groups
with my regular news client. One has to restrict the access with
readers.conf or add special rules in filter hooks.
As for ihave control messages, they are processed by controlchan if the
ihave rule in control.ctl matches.
--
Julien ÉLIE
« Bibere humanum est, ergo bibamus. »
More information about the inn-workers
mailing list