I'm relatively new to qmail so please elaborate on any answers ;-)
I'm trying to run a perl script from .qmail file to filter out some
words before sending a message further. In the .qmail file I use
preline:
|preline /var/qmail/alias/forums.ezmlm/filter.pl
in the filter.pl file I tried reading the STDIN in two ways:
$text = <STDIN>;
while (<STDIN>)
then I use regex on the variable. The scripts exits either with 0 (ok)
or 100 (drop delivery).
I always get the following error: deferral:
ld.so.1:_/usr/bin/perl:_fatal:_/usr/lib/libc.so.1:_mmap_failed:
_Not_enough_space/preline:_fatal:_child_crashed/
The test message is really small (two lines of text), so I don't
understand why I get this error.
Any help appreciated.
Lidia
ps
here is the script (both versions):
#!/usr/bin/perl -w
$text = <STDIN>;
if ($text =~ /ILOVEYOU/)
{
#print "matched ILOVEYOU, exit 100\n";
exit 100;
}
exit 0;
#$count=0;
#while (<STDIN>)
#{
# if ($_ =~ /ILOVEYOU/)
# {
# #print "matched ILOVEYOU, exit 100\n";
# exit 100;
# }
# $count++;
#}
# print "count: $count\n";
# print "done, not matched, exit 0\n";
#exit 0;