Usenet comp.os.linux.announce (1993-2013)
 help / color / mirror / Atom feed
* PATCH: Spam patch for suck-2.6.1
@ 1996-03-20  5:00 The Renaissance Man
  0 siblings, 0 replies; only message in thread
From: The Renaissance Man @ 1996-03-20  5:00 UTC (permalink / raw)


-----BEGIN PGP SIGNED MESSAGE-----


The following batch for Bob Yetman's very useful SUCK package adds the
ability to automatically kill articles crossposted to more than N groups,
by adding the command "SPAM=N" to your suck.killfile, where N is the maximum 
number of groups you want to allow articles to be crossposted to.


For example, if your suck.killfile contains the line:

SPAM=10

then any article posted to 11 or more newsgroups will be killed.


I have taken the liberty of tagging this, for my site, as suck-2.6.2. 
This patch is from suck-2.6.1.  The only files changed are killfile.c and
killfile.h.  I have not yet updated suck.1 to reflect these changes. 




diff -Bd suck-2.6.1/killfile.c suck-2.6.2/killfile.c
43c43,44
< 	"Multiple Matches/Tiebreaker Used"
- ---
> 	"Multiple Matches/Tiebreaker Used",
> 	"Excessive Crossposting"
46c47
< REASON_SUBJECT, REASON_FROM, REASON_NOKEEP, REASON_TIE};
- ---
> REASON_SUBJECT, REASON_FROM, REASON_NOKEEP, REASON_TIE, REASON_SPAM};
61c62,63
< 	{6, "QUOTE=", 0, ""}
- ---
> 	{6, "QUOTE=", 0, ""},
> 	{5, "SPAM=", 12, "Newsgroups: " }
63c65
< enum { PARAM_HILINE, PARAM_LOWLINE, PARAM_PATH, PARAM_SUBJ, PARAM_FROM, PARAM_GROUP, PARAM_QUOTE};
- ---
> enum { PARAM_HILINE, PARAM_LOWLINE, PARAM_PATH, PARAM_SUBJ, PARAM_FROM, PARAM_GROUP, PARAM_QUOTE, PARAM_SPAM};
465c467
< 			fprintf(fptr, "MESSAGE KILLED: %s - %s\n%s\n", group, Reasons[why], headerbuf);
- ---
> 			fprintf(fptr, "MESSAGE KILLED: %s - %s\n", group, Reasons[why]);
476c478
< 	char *startline;
- ---
> 	char *startline, *endline, *comma;
509a512,533
> 	/* check for spam */
> 	if(match == FALSE && killp->spam > 0) { 
> 		if((startline = strstr(headerbuf, Params[PARAM_SPAM].header)) != NULL)  {
> 			i = 1;	/* just in case */
> 			endline = strchr(startline, '\n');
> 			comma = NULL;  /* just in case */
> 			while ((comma = strchr(startline, ',')) != NULL)
> 			  {
> 			    startline = ++comma;
> 			    i++;
> 			  }
> #ifdef DEBUG2
> 			do_debug("Msg crossposted to %d newsgroups, max = %d\n", i, killp->spam);
> #endif
> 			if(i > killp->spam) {
> 				/* JACKPOT */
> 				match = TRUE;
> 				*why = REASON_SPAM;
> 			}
> 		}
> 		
> 	}
621c645
< 	mykill->hilines = mykill->lowlines = 0;
- ---
> 	mykill->hilines = mykill->lowlines = mykill->spam = 0;
695a720,725
> 						break;
> 					  case PARAM_SPAM:
> 						sscanf(&buf[Params[PARAM_SPAM].len], "%d", &(mykill->spam));
> #ifdef DEBUG2
> 						do_debug("Killfile max crossposts = %d\n", mykill->spam);
> #endif
diff -Bd suck-2.6.1/killfile.h suck-2.6.2/killfile.h
8a9
> 	int spam;       /* max nr of groups on newsgroups line */




Enjoy.



- -- 
 ****  Free Speech on the Internet!! Support the Blue Ribbon Protest!!  ****
 Yes, the Constitution is a radical  | Phil Stracchino : The Renaissance Man
 document.  It was SUPPOSED to be.   | Creator, alt.support.survivors.prozac
 A president who says that America   | Babylon Project System Administrator
 can no longer afford the freedoms   | Finger for PGP 2.6.x public key
 in the Constitution, is a President | http://www.babcom.com/
 that America can no longer afford.  | http://www.babcom.com/jwz/alaric/
 **** NRA : NRA-ILA : NRA-SATF : GOA : GOC : CRPA : CCRKBA : SAF : LEAA ****


-----BEGIN PGP SIGNATURE-----
Version: 2.6.2i

iQCVAwUBMVB65oQRll5MupLRAQHV5wQAy4D8/EGFndn0IagFIIcuwr29zlvdvXMS
MepMWmkCWbxk+pD6NR0X7EypKZ78Ftlqes6Tjxw6cKJ8gemXD/mtwIUAsFoAT4O6
5VcFF8M7gHgYEdDmG4bkXMDNwRlLV4BfmCKMnSMbhFN7ub6Yfo1ODRyQyuQYuz8n
U3ZIeKXT3YM=
=4mRT
-----END PGP SIGNATURE-----

-- 
This article has been digitally signed by the moderator, using PGP.
Finger wirzeniu@kruuna.helsinki.fi for PGP key needed for validating signature.
Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov
PLEASE remember a short description of the software and the LOCATION.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-03-20  5:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-03-20  5:00 PATCH: Spam patch for suck-2.6.1 The Renaissance Man

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox