🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #37807

Re: problem using score.spam in slrn

#37807
From: Sylvain Robitaille
Date: Tue, 30 Dec 1997 00:00
114 lines
4569 bytes
On 26 Dec 1997 11:42:30 GMT, *selah* <soma@nospam.dorsai.org> wrote:

> I read that to get slrn to use a spam filter you need to add "Include:
> /local/lib/slrn/Score.spam" to the News/Score file. But when I did that I
> got a fatal error message and slrn wouldn't start. It seems that our
> system doesn't have the Score.spam file.
> 
> I was wondering if the file is included with the slrn files after
> compiling or, if not, where to get it ? 

This is actually a "local" feature I added to our installation of the
newsreader, since we have a large community of users, many of whom were
asking for some sort of global killfile.

I'll append the patch to add this feature after my signature. Note that
you can include any file you wish, (you would need to create your own
spam score file, though, I'm afraid).

-- 
----------------------------------------------------------------------
Sylvain Robitaille                              syl@alcor.concordia.ca

Assistant to the System Managers                  Concordia University
Computing Services Department                 Montreal, Quebec, Canada
----------------------------------------------------------------------

From: Sylvain Robitaille <syl@alcor.concordia.ca>
(With minor changes by Anne Bennett)

*** src/score.c.original	Sat Jul 12 16:29:01 1997
--- src/score.c	Mon Aug 18 20:42:51 1997
***************
*** 793,802 ****
     unsigned long today;
     int start_new_score = 0, score_has_expired = 0;
     unsigned int pscore_flags = 0;
     
     today = get_today ();
!    
!    if (Group_Score_Root != NULL)
       {
  	free_group_scores ();
       }
--- 793,812 ----
     unsigned long today;
     int start_new_score = 0, score_has_expired = 0;
     unsigned int pscore_flags = 0;
+    static int numfiles = 0;
     
     today = get_today ();
! 
! /***
!  *** 1997/08/15  Sylvain Robitaille  (sp_robi@alcor.concordia.ca)
!  *** ------------------------------------------------------------
!  ***
!  *** Added keyword "Include" causes this function to re-call itself,
!  *** but we only want it to call free_group_scores() the first time
!  *** through, or else we lose what was set previously. numfiles
!  *** counts the number of times the function has recursed.
!  ***/
!    if ((Group_Score_Root != NULL) && (numfiles == 0))
       {
  	free_group_scores ();
       }
***************
*** 852,857 ****
--- 862,905 ----
  	     continue;
  	  }
  	
+ /***
+  *** 1997/08/17  Sylvain Robitaille  (sp_robi@alcor.concordia.ca)
+  *** ------------------------------------------------------------
+  ***
+  *** What we want is a way to permit users to include a "machine wide"
+  *** score file, where we can maintain a list of usenet spammers for
+  *** instance, and we can kill those out of local newsgroups. This will of
+  *** course permit other flexibility, but in my mind, this is the main
+  *** objective.
+  ***/
+ 	if (!slrn_case_strncmp (lp, (unsigned char *)"Include:", 8))
+ 	  {
+ 	    int success;
+ 	    char include_file[SLRN_MAX_PATH_LEN];
+ 	    unsigned char *filename = lp + 8;
+ 
+ 	    filename = (unsigned char *) slrn_skip_whitespace ((char *) filename);
+ 	    slrn_make_home_filename (filename, include_file);
+ 	    numfiles++;  /* ensure included files won't clear previous work done. */
+ 	    slrn_trim_string(include_file);
+ 
+ 	    success = slrn_read_score_file(include_file);
+           numfiles--;
+ 	    if (success > 0)
+ 	      {
+ 		continue;
+ 	      }
+ 	    else if (success == 0)
+ 	      {
+ 		score_error ("Can't include file.", line, linenum, file);
+ 	      }
+ 	    else /* success < 0 */
+ 	      {
+ 		score_error ("Error in include file.", line, linenum, file);
+ 	      }
+ 	    goto error_return;
+ 	  }
+ 
  	if (!slrn_case_strncmp (lp, (unsigned char *)"Score:", 6))
  	  {
  	     unsigned char *lpp = lp + 6;

Technical Details
Message-ID: <68ac0a$mbi$1@newsflash.concordia.ca>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
References: <slrn6a762f.sqk.soma@amanda.dorsai.org>

Show Full Headers
Complete Article Headers
Message-ID: <68ac0a$mbi$1@newsflash.concordia.ca>
Subject: Re: problem using score.spam in slrn
Date: Tue, 30 Dec 1997 00:00:00 +0000
From: syl@alcor.concordia.ca (Sylvain Robitaille)
References: <slrn6a762f.sqk.soma@amanda.dorsai.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 311277789
Organization: Concordia University, Montreal, Canada
NNTP-Posting-User: syl
Newsgroups: news.software.readers