Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!caen!umich!sharkey!tygra!jp From: jp@tygra.Michigan.COM (John Palmer) Newsgroups: news.software.b Subject: How to Exclude All Posts from a Site Message-ID: <1991May11.045046.14148@tygra.Michigan.COM> Date: 11 May 91 04:50:46 GMT Organization: CAT-TALK Conferencing System, Detroit, MI Lines: 133 I need to find a way to exclude all posts from a particular site from even making it into my junk group let alone any other groups. The: sitea/siteb:groups,.... in "sys" wont't work because that excludes all articles that have been through siteb, not just those that have come from siteb. BNEWS had an "excluded user" file. I'm running CNEWS, March-25-1990. Does a newer version have such a feature? I hate hacking relaynews any more than I've already done, but have had to for the time being. Below is the modification (including a new function that I wrote for "procart.c") to take care of this one site. The name's hardwired into the function, as you can see. John Palmer /* This function, gets the name of the site from which the article came * from the Path: header. Didn't see anything like this in * libcnews/string.c, so I wrote it myself. */ /* * Return name of original site which sent this article * */ void senthost(path,host) char *path; char host[]; { char *p,*p2; if (strchr(path,'!') == NULL) { strcpy(host, hostname()); return; } p = path+(strlen(path)-1); while (*p != '!') p--; p2 = p-1; while ((*p2 != '!') && (p2 != path)) p2--; if (*p2 == '!') p2++; *p = '\0'; strcpy(host, p2); *p = '!'; } /* * Reject articles. This can be arbitrarily picky. * Only the headers are used to decide, so this can be called before * the article is filed. * Be sure to put the fastest tests first, especially if they often result * in rejections. * NOTE from John Palmer, 05-10-91: This function is in charge or rejecting * articles that fail several tests for validity (like duplication, etc) * I've just added another nested IF to test what senthost returns to * see if its the offending site. This is probably slowing relaynews down * quite a bit, but I see no choice. */ void reject(art) register struct article *art; { register char *msgid = art->h.h_msgid; register char *path = art->h.h_path; register char *ngs = art->h.h_ngs; register char *from = art->h.h_sender; char snthost[60]; senthost(path,snthost); /* extract name of sending host from Path: */ if (path == NULL) { prefuse(art); (void) printf("no Path: header\n"); } else if (msgid == NULL || msgid[0] == '\0') { prefuse(art); (void) printf("missing Message-ID\n"); } else if (strchr(msgid, ' ') != NULL || strchr(msgid, '\t') != NULL) { prefuse(art); (void) printf("whitespace in Message-ID\n"); } else if (!strcmp(snthost,"zorch")) { prefuse(art); /* Dump it: More of Kent's ravings */ (void) printf("whoops - caught one from zorch\n"); } else if (msgid[0] != '<' || msgid[strlen(msgid)-1] != '>') { prefuse(art); (void) printf("<> brackets missing in Message-ID\n"); } else if (alreadyseen(msgid)) { prefuse(art); (void) printf("duplicate\n"); } else if (path != NULL && hopcount(path) > 0 && !ngmatch(oursys()->sy_ngs, ngs)) { extern boolean histreject; /* * non-local article, with all bad groups. * (local articles with bad groups will be bounced * by fileart when the groups aren't in active.) */ if (histreject) history(art, NOLOG); prefuse(art); (void) printf("no subscribed groups in `%s'\n", ngs); } else if (art->h.h_approved == NULL && moderated(ngs)) { prefuse(art); (void) printf("unapproved article in moderated group(s) `%s'\n", ngs); } else return; /* art was accepted */ art->a_status |= ST_REFUSED; if (!okrefusal) art->a_status |= ST_DROPPED; } -- CAT-TALK Conferencing System | "Buster Bunny is an abused | E-MAIL: +1 313 343 0800 (USR HST) | child. Trust me - I'm a | jp@Michigan.COM +1 313 343 2925 (TELEBIT PEP) | professional..." | ********EIGHT NODES*********** | -- Roger Rabbit |