HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   Postfix smtp relay with dspam as content filter re-train problem (http://www.howtoforge.com/forums/showthread.php?t=16993)

darklord3k 5th November 2007 23:43

Postfix smtp relay with dspam as content filter re-train problem
 
Please help, this is drive me crazy as this is my first time setup any server on linux.
setup as follow
postfix smtp relay to exchange server
dspam as content filter
tranportmap is create for user to retrain the email
spam@spam.com dspam-retrain:spam
ham@spam.com dspam-retrain:innocent

on master.cf
dspam-retrain unix - n n - 10 pipe
flags=Ru user=dspam argv=/usr/local/bin/dspam-retrain $nexthop $sender $recipient

dspam-retrain as follow:
#! /usr/bin/perl
# Get arguments
$class = $ARGV[0] || die; shift;
$sender = $ARGV[0] || die; shift;
$recip = $ARGV[0] || die; shift;

if ($recip =~ /^(spam|ham)-(\w+)@/) {
# username is part of the recipient
$user = $2;
} elsif ($sender =~ /^(\w+)@/) {
# username is in the sender
$user = $1;
} else {
print "Can't determine user\n";
exit 75; # EX_TEMPFAIL
}

# Pull out DSPAM signatures and send them to the dspam program
while (<>) {
if ((! $subj) && (/^Subject: /)) {
$subj = $_;
} elsif (/(!DSPAM:[a-f0-9]+!)/) {
#########alway failed at this point ##############
open(F, "|/usr/local/bin/dspam --source=error --class=$class --user $user") || die "retrain failed";
################################################3
print F "$subj\n$1\n";
close(F);
} elsif (/(X-DSPAM-Signature: [a-f0-9]+)/) {
open(F, "|/usr/local/bin/dspam --source=error --class=$class --user $user");
print F "$subj\n$1\n";
close(F);
}
}

It alway failed on this point from when I check the mail.log
open(F, "|/usr/local/bin/dspam --source=error --class=$class --user $user") || die "retrain failed";
I have try to retrain by calling the dspam-retrain from shell without any issue by "cat email | dspam-restrain spam any@test.com spam@spam.com"
For testing purpose I have give 777 permission for /usr/local/bin/dspam
Please help


All times are GMT +2. The time now is 00:32.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.