Thread View: news.software.nntp
5 messages
5 total messages
Started by Lyle Scully
Fri, 25 Apr 1997 00:00
Limit crossposting to X amount (expire or channel)? & Expire Questions
Author: Lyle Scully
Date: Fri, 25 Apr 1997 00:00
Date: Fri, 25 Apr 1997 00:00
39 lines
1871 bytes
1871 bytes
First off I am using INN 1.5.1. Is there is a way to limit an article that is crossposted to X number of groups using either expire or a INN channel? I would like to figure out a way to either reject an article that has been posted to a specified number of groups or only let it post to the first X number of groups. I saw a different version of expire.c out there that let you do a -K# to kill any article that was posted to X# of groups. But I didn't have too much luck compiling it on my Solaris 2.4 system. My next question has to do with expire on a nightly or more than once a day basis. What is the best command line for a system that is only running about 12gb dedicated to news? I have tried: expire -p -v1 -e -s But it doesn't give me the results that I used to get under INN 1.4unoff4 (although I think the options have changed since then). I also tried it without the "-p" but that gave me even worse results. If I have two drives with one mounted in alt/binaries and the other taking care of everything else, what do I have to add to expire to make it expire correctly? I tried the "-l" but with limited success. Thanks for any help you can provide Lyle -- Lyle Scully AZLink Internet Services, Inc. lyle@azlink.com
Re: Limit crossposting to X amount (expire or channel)? & Expire Questions
Author: Todd C Miller
Date: Sat, 26 Apr 1997 00:00
Date: Sat, 26 Apr 1997 00:00
185 lines
5013 bytes
5013 bytes
From the keyboard of lyle@azlink.com:
>
> Is there is a way to limit an article that is crossposted to X number
> of groups using either expire or a INN channel? I would like to figure
> out a way to either reject an article that has been posted to a
> specified number of groups or only let it post to the first X number
> of groups.
Below is a hack I made to crosspost to do this. It's a bit
heavy handed but it gets the job done. The diffs include
changes to the man page that tell how to use it. You have
to be runing crosspost of course...
- todd
--- crosspost.c.DIST Tue Dec 17 07:40:40 1996
+++ crosspost.c Tue Feb 11 22:56:43 1997
@@ -28,9 +28,9 @@
STATIC char *Dir;
STATIC int debug = FALSE;
+STATIC int maxxpost = 256;
STATIC int syncfiles = TRUE;
-
-#define MAXXPOST 256
+STATIC int xunlink = FALSE;
/*
@@ -92,9 +92,14 @@
register int i;
int nxp;
int fd;
- int lnval ;
- char *names[MAXXPOST];
+ int lnval;
+ STATIC char **names;
+
+ if (names == NULL && (names = malloc(sizeof(char *) * maxxpost)) == NULL) {
+ perror("can't allocate buffer");
+ exit(1);
+ }
for ( ; ; ) {
/* Read the first line of data. */
@@ -106,7 +111,18 @@
break;
}
- for (i = 0; *p && (i < MAXXPOST); i++) { /* parse input into array */
+ for (i = 0; *p; i++) { /* parse input into array */
+ if (i >= maxxpost) {
+ if (debug)
+ (void)fprintf(stderr, "crosspost: too many crossposts %s\n",
+ names[0]);
+ if (xunlink) {
+ (void)unlink(names[0]);
+ i = 0;
+ }
+ break;
+ }
+
names[i] = p;
for ( ; *p; p++) {
if (*p == '.') *p++ = '/'; /* dot to slash translation */
@@ -119,6 +135,8 @@
}
}
}
+ if (i < 1)
+ continue; /* exceptional condition */
nxp = i;
if (debug) {
for (i = 0; i < nxp; i++)
@@ -126,7 +144,7 @@
i, names[i]);
}
- if(syncfiles) fd = open(names[0], O_RDWR);
+ if (syncfiles) fd = open(names[0], O_RDWR);
for (i = 1; i < nxp; i++) {
lnval = link(names[0], names[i]) ;
@@ -217,7 +235,8 @@
STATIC NORETURN
Usage()
{
- (void)fprintf(stderr, "usage: crosspost [-D dir] [files...]\n");
+ (void)fprintf(stderr,
+ "usage: crosspost [-d] [-D dir] [-m max] [-s] [-u] [files...]\n");
exit(1);
}
@@ -235,7 +254,7 @@
(void)umask(NEWSUMASK);
/* Parse JCL. */
- while ((i = getopt(ac, av, "D:ds")) != EOF)
+ while ((i = getopt(ac, av, "D:dm:su")) != EOF)
switch (i) {
default:
Usage();
@@ -246,8 +265,18 @@
case 'd':
debug = TRUE;
break;
+ case 'm':
+ if (atoi(optarg) > 0)
+ maxxpost = atoi(optarg); /* max number of crossposts */
+ else
+ (void)fprintf(stderr, "invalid max number of crossposts: %d\n",
+ atoi(optarg));
+ break;
case 's':
syncfiles = FALSE; /* do not fsync articles */
+ break;
+ case 'u':
+ xunlink = TRUE; /* unlink article if > maxxpost */
break;
}
ac -= optind;
--- crosspost.8.DIST Fri Jan 3 12:08:44 1997
+++ crosspost.8 Tue Feb 11 23:03:45 1997
@@ -5,12 +5,21 @@
.SH SYNOPSIS
.B crosspost
[
+.B \-d
+]
+[
.BI \-D " dir"
]
[
+.BI \-m " max"
+]
+[
.B \-s
]
[
+.B \-u
+]
+[
.I file...
]
.SH DESCRIPTION
@@ -67,17 +76,31 @@
.RE
.sp
(where the -F is followed by a tab character.)
-.PP
+.SH OPTIONS
+.TP
+.B \-d
+Print debugging information to ``stderr''.
+.TP
+.B \-D
The ``\-D'' flag can be used to specify where the article spool is stored.
The default directory is
.\" =()<.IR @<_PATH_SPOOL>@ .>()=
.IR /var/spool/news .
-.PP
+.TP
+.B \-m
+Sets the maximum number of crossposts allowed to the specified
+number. The default is 256.
+.TP
+.B \-s
By default
.I crosspost
will fsync(2) each article after updating the links. The ``\-s'' flag
can be used
to prevent this.
+.TP
+.B \-u
+The ``\-u'' flag will cause any article with more than the maximum
+allowed number of crossposts to be unlinked.
.SH HISTORY
Written by Jerry Aguirre <jerry@ATC.Olivetti.Com>.
.SH "SEE ALSO"
--
Todd C. Miller Sysadmin/Consultant Todd.Miller@courtesan.com
Re: Limit crossposting to X amount (expire or channel)? & Expire Questions
Author: Jeff Garzik
Date: Fri, 02 May 1997 00:00
Date: Fri, 02 May 1997 00:00
16 lines
1408 bytes
1408 bytes
Lyle Scully wrote: > Is there is a way to limit an article that is crossposted to X number > of groups using either expire or a INN channel? I would like to figure > out a way to either reject an article that has been posted to a > specified number of groups or only let it post to the first X number > of groups. Very easy. Use the Perl hooks, and grab a code of my Perl spam filter I posted on this newsgroup about a month ago. The filter includes a method of rejecting all articles crossposted to an excess number of groups. Jeff
Re: Limit crossposting to X amount (expire or channel)? & Expire Questions
Author: Jeff Garzik
Date: Fri, 02 May 1997 00:00
Date: Fri, 02 May 1997 00:00
16 lines
1165 bytes
1165 bytes
Lyle Scully wrote: > Is there is a way to limit an article that is crossposted to X number > of groups using either expire or a INN channel? I would like to figure > out a way to either reject an article that has been posted to a > specified number of groups or only let it post to the first X number > of groups. Very easy. Use the Perl hooks, and grab a code of my Perl spam filter I posted on this newsgroup about a month ago. The filter includes a method of rejecting all articles crossposted to an excess number of groups. Jeff
Re: Limit crossposting to X amount (expire or channel)? & Expire Questions
Author: Greg Earle
Date: Sat, 31 May 1997 00:00
Date: Sat, 31 May 1997 00:00
21 lines
1479 bytes
1479 bytes
In article <R3369A2F7.D5271A3@spinne.com>, Jeff Garzik <jeff.garzik@spinne.com> wrote: >Lyle Scully wrote: >> Is there is a way to limit an article that is crossposted to X number >> of groups using either expire or a INN channel? I would like to figure >> out a way to either reject an article that has been posted to a >> specified number of groups or only let it post to the first X number >> of groups. > > Very easy. Use the Perl hooks, and grab a code of my Perl spam filter I > posted on this newsgroup about a month ago. The filter includes a > method of rejecting all articles crossposted to an excess number of groups. Or, you could simply ask your feeds to add a "G<count>" field to the flags entry in their newsfeeds(5) entry for your site, so they don't get sent/offered to you in the first place.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads