Article View: news.software.nntp
Article #68561Re: sample perl filters
From: Terminator
Date: Sun, 14 Mar 2004 03:37
Date: Sun, 14 Mar 2004 03:37
60 lines
2848 bytes
2848 bytes
# vi /usr/bin/filter/filter_nnrpd.pl
if ($hdr{"Control"}) {
$rval = "Control message is not allowed";
}
-------
if ($hdr{"Newsgroups"} =~ ",") {
$rval = "Crosspost is not allowed";
}
-------
if ($hdr{"Subject"} =~ /notallowedwords/i) {
$rval = "Spam is not acceptable here...";
}
-------
if ($body =~ /make.*money/i) {
$rval = "make money is reject here..." ;
}
if ($body =~ /www\.sex\.com|www\.xxx\.com/i) {
$rval = "make money is reject here..." ;
}
--------------------------
if ($body =~ /www.sex.com/i){
$rval = "spam is not allowed here..." ;
}
if ($body =~ /www\.sex\.com|www\.xxx\.com/i) {
---------------------------
my $val = "";
use POSIX;
$modify_headers = "true";
$hdr{"X-Date"} = $hdr{"Date"};
$hdr{"Date"} = strftime("%a, %e %b %Y %T +0800", localtime);
$hdr{"Date"} =~ s/^([A-Z][a-z][a-z], ) /$1/;
"toylet" <toylet_at_mail.hongkong.com> wrote in message news:40532dd6$1_1@rain.i-cable.com...
Anyone got a good site to recommend that contains loads of sample perl
codes for use with innd's filters?
--
.~. Might, Courage, Vision. In Linux We Trust.
/ v \ http://www.linux-sxs.org
/( _ )\ Linux 2.4.22-xfs
^ ^ 11:50pm up 1 day 3:15 load average: 0.00 0.24 0.59
~ Let us linux ~
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Technical Details
Message-ID:
<4054b477$1@lungfunggdn.org>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!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.kjsl.com!news-out.superfeed.net!corp.newsgroups.com!lungfunggdn.orgReferences:
<40532dd6$1_1@rain.i-cable.com>Show Full Headers
Complete Article Headers
Message-ID: <4054b477$1@lungfunggdn.org> Subject: Re: sample perl filters Date: Sun, 14 Mar 2004 03:37:27 +0000 From: "Terminator" <terminator@lisa.hk.com> References: <40532dd6$1_1@rain.i-cable.com> 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!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.kjsl.com!news-out.superfeed.net!corp.newsgroups.com!lungfunggdn.org Newsgroups: news.software.nntp Lines: 53 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Original-NNTP-Posting-Host: 192.168.123.132 X-Original-Trace: 14 Mar 2004 11:37:27 +0800, 192.168.123.132 NNTP-Posting-Host: 202.60.228.88 X-Trace: corp.newsgroups.com 1079235504 202.60.228.88 (13 Mar 2004 21:38:24 -0600) X-Comments: This message was posted through <A href X-Comments2: IMPORTANT: Newsfeed.com does not condone, X-Report: Please report illegal or inappropriate use to X-Comments3: <A href ="http://www.newsgroups.com">Visit Organization: Newsfeeds.com http://www.newsfeeds.com 100,000+ UNCENSORED Newsgroups.