Changi NNTP Server 1.0

[ Bottom of Page | Previous Page | Next Page | Table of Contents ]

Adding an Autoresponder

The file TestHandler.pl contains a test version of an autoresponder written in Perl for OS/2. To activate it, add the following line to the newsfeeds file:
test-message-handler:*.test:Tp:perl5.exe TestHandler.pl
perl5.exe needs to be on the path, and it is suggested that anyone wanting to use this scripts should preload perl into memory, as it's a pretty big interpreter that you don't want to have to load repeatedly.

To do this use the emxload function in one of the Emx packages, with the following line in startup.cmd:

g:\emx\bin\emxload -e g:\bin\sbin\perl5.exe

TestHandler.pl

#!/bin/perl5.exe
# Handle Usenet test messages by issuing the standard reply

require "ctime.pl" ;

$date = &ctime(time) ;

open (TESTMSG, ">test.temp") ;

print TESTMSG <<"EOIT" ;
Insert your server's response message here.

The posting was received by this server on $date
Your original article is reproduced below for your perusal:

EOIT

while (<>)
{
   print TESTMSG ">", $_ ;
   /^Reply-To: (.*)/ && ($replyto = $1) ;
   /^From: (.*)/ && ($from = $1) ;
   /^Subject: (.*)/ && ($subject = $1) ;
}

close (TESTMSG) ;

if ($subject =~ /.*ignore.*/)
{
   unlink "test.temp" ;
   exit 0 ;
}

open (TESTMSG, ")
{
   print MAILSEND ;
}

print MAILSEND ".\n" ;

close (MAILSEND) ;
close (TESTMSG) ;

unlink "test.temp" ;

[ Top of Page | Previous Page | Next Page | Table of Contents ]


URL: changi/manual/syslogd.html
Created: 5 December 1996
Revised: 5 December 1996
Author: Alistair J. R. Young <avatar@arkane.demon.co.uk>