Article View: news.software.nntp
Article #24365Another control-article filing patch
From: Kenneth Herron
Date: Mon, 15 Dec 1997 00:00
Date: Mon, 15 Dec 1997 00:00
102 lines
3835 bytes
3835 bytes
The following patch changes the method for finding a group to file
control articles; instead of trying "control.<word>" followed by
"control", it builds "control.<word>.group.article.was.posted.to" and
then removes name components until it finds something that exists in
the active file. E.g., given a cancel posted to
alt.sex.fetish.pocket-protectors, inn tries
control.cancel.alt.sex.fetish.pocket-protectors
control.cancel.alt.sex.fetish
control.cancel.alt.sex
control.cancel.alt
control.cancel
control
filing the article in the first group that actually exists. The group
name used is the first group in the article's newsgroup list that
exists on the local system; if there are none, it uses the group being
created/removed for newgroup/rmgroup messages, otherwise "junk".
Since these are "real" groups, all semantics of real groups are
retained: You can set expirations, feed the articles, enter & read the
groups, etc.
Let me humbly suggest that you start with at least the following
groups:
control.cancel.alt
control.cancel.alt.binaries
control.cancel.alt.sex
control.cancel.alt.sex.bondage
control.cancel.alt.sex.erotica
control.cancel.alt.sex.fetish
control.cancel.alt.sex.pictures
control.cancel.alt.sex.stories
control.cancel.tw.bbs
The patch is for innd/art.c, version INN 1.7.1 with the insync patches;
as far as I can tell the patch should apply to non-insync source, but
you'll get some complaints about line offsets.
---clip here----
*** art.c 1997/12/15 00:12:20 1.1
--- art.c 1997/12/15 01:15:25
***************
*** 1755,1760 ****
--- 1755,1761 ----
#if defined(DO_PERL)
char *perlrc;
#endif /* DO_PERL */
+ char *cgbackup;
/* Preliminary clean-ups. */
article = &cp->In;
***************
*** 1983,1988 ****
--- 1984,1990 ----
Approved = *p != '\0';
ngptr = GroupPointers;
j = 0;
+ cgbackup = ARTjnk;
for (GroupMissing = Accepted = FALSE; (p = *groups) != NULL; groups++) {
if (!RCcanpost(cp, p))
continue;
***************
*** 1995,2000 ****
--- 1997,2003 ----
* would or would have had the group if it were created. */
ARTsendthegroup(*groups);
Accepted = TRUE;
+ cgbackup = *groups;
}
ARTpoisongroup(*groups);
***************
*** 2066,2073 ****
/* Control messages not filed in "to" get filed only in control.name
* or control. */
if (ControlHeader >= 0 && Accepted && !ToGroup) {
! FileGlue(buff, "control", '.', ControlWord);
! if ((ngp = NGfind(buff)) == NULL)
ngp = NGfind(ARTctl);
ngp->PostCount = 0;
ngptr = GroupPointers;
--- 2069,2080 ----
/* Control messages not filed in "to" get filed only in control.name
* or control. */
if (ControlHeader >= 0 && Accepted && !ToGroup) {
! (void)sprintf(buff, "control.%s.%s", ControlWord,
! (ngptr != GroupPointers ? GroupPointers[0]->Name : cgbackup));
! while ((NULL == (ngp = NGfind(buff))) &&
! (NULL != (p = strrchr(buff, '.'))))
! *p = '\0';
! if (NULL == ngp)
ngp = NGfind(ARTctl);
ngp->PostCount = 0;
ngptr = GroupPointers;
---clip here----
--
Kenneth Herron kherron@campus.mci.net +1 916 649 6142
Technical Details
Message-ID:
<673t12$6ik$1@news.campus.mci.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <673t12$6ik$1@news.campus.mci.net> Subject: Another control-article filing patch Date: Mon, 15 Dec 1997 00:00:00 +0000 From: kherron@campus.mci.net (Kenneth Herron) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 298434193 Organization: CampusMCI Newsgroups: news.software.nntp X-Newsposter: trn 4.0-test54 (18 Feb 97)