Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 5th November 2007, 23:43
darklord3k darklord3k is offline
Junior Member
 
Join Date: Nov 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Reply With Quote
Sponsored Links
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
postfix problems with smtp linkdeb Server Operation 13 15th March 2014 17:58
sending e-mail using mail() function linuxuser1 HOWTO-Related Questions 38 21st April 2009 12:20
Apache2 Freezes celtic Server Operation 31 28th May 2007 17:18
Centos 4.4 32bit Hangs, High Server load 3cwired_com Server Operation 11 16th November 2006 15:47
Verify email setup meekish Installation/Configuration 28 27th October 2006 15:36


All times are GMT +2. The time now is 17:30.


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