Hi Jason, My opinion only, but I would abandon this second method you are using and go back to the original single script that reinjected the mail using Postfix's sendmail binary (/usr/sbin/sendmail). It is better to use a simple method than this alternate method. If you go back to this method, you should not need step #6: content_filter=spamfilter: in main.cf. You should only need the modifications to the master.cf file. Also make sure your argv line mimics their setup.
Use this: argv=/usr/local/bin/spamfilter.sh ${sender} ${recipient} Not this: argv=/usr/local/bin/spamfilter.sh -f ${sender} -- ${recipient} I understand you had mail loop problems with that method but it would be better to solve that problem and have a more simple method. The first method should set you up for replacing with Procmail if you ever decide to go down that road. Just my opinion. ;) --Larry -----Original Message----- From: Jason Williams Thanks for the link. I'll take a look at it. Let me add some more info, in hopes of getting some help on this. I'm using two scripts for SA and postfix.. First script passes the mail to SA running in daemon mode Second script then passes the mail back to postfix. Here they are: First script: #!/bin/sh # spamfilter.sh by SecuritySage (http://www.securitysage.com) # SpamAssassin Only INSPECT_DIR=/var/spam SENDMAIL=/usr/sbin/sendmail SPAMASSASSIN=/usr/bin/spamc EX_TEMPFAIL=75 EX_UNAVAILABLE=69 cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; } trap "rm -f in.$$; rm -f out.$$" 0 1 2 3 15 cat | $SPAMASSASSIN -f > out.$$ #|| # { echo Message content rejected; exit $EX_UNAVAILABLE; } perl /usr/local/bin/reinject.perl "$@" < out.$$ exit $? Second script, which passes it back: #!/usr/bin/perl # Need to use socket services use IO::Socket; use strict; my($remote_host, $sender, $recipient, $remote_port, $line, $response, $socket, $flag); $remote_host = "127.0.0.1"; $remote_port = 10027; $socket = IO::Socket::INET->new(PeerAddr => $remote_host, PeerPort => $remote_port, Proto => "tcp", Type => SOCK_STREAM) or die "Couldn't connect to $remote_host:$remote_port : [EMAIL PROTECTED]"; ## print $socket "HELO localhost\n"; print $socket "HELO $remote_host\n"; $response = <$socket>; ##### ## split $ARGV on the commas... ## @pratip=split(/,/,@ARGV); ##### ## changed ARGV to pratip... $sender = shift(@ARGV); print "MAIL FROM: <$sender>\n"; print $socket "MAIL FROM: <$sender>\n"; $response = <$socket>; ##### ## With the $@ from procmailrc, there seems to be a comma at the ## end of the string. There may need to be an addition made to ## the while() loop that verifies that $recipient is not an ## empty string. while ($recipient = shift(@ARGV)) { print "RCPT TO: <$recipient>\n"; print $socket "RCPT TO: <$recipient>\n"; $response = <$socket>; } print $socket "DATA\n"; $response = <$socket>; while (defined($line = <STDIN>)) { print $socket "$line"; } print $socket "\n.\n"; $response = <$socket>; print $socket "QUIT\n"; close($socket); exit(0); Now, this could be completely off and not necessary. My main goal is to have incoming mail passed to SA for reviewing and tagged as it should be. Maybe I dont need a second script? I dunno. Im just guessing at this point. I appreciate everyones help and input. Jason At 01:36 PM 9/17/2003 -0400, you wrote: I've been working on an all-in-one server which includes postfix and spamassassin. Not sure if its complete enough to help you but you can find it at www.pfohlsolutions.com/projects/server Steve -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Jason Williams Sent: Wednesday, September 17, 2003 1:00 PM To: [EMAIL PROTECTED] Subject: [SAtalk] Trouble getting spamd working with postfix Good morning everyone. Well, im having a heck of a time trying to get spamd to work with my postifx mail relay box. I have installed SA correctly and started up spamd with the flags that I need. However, im having a hard time trying to configure postfix to work correctly with spamd. I read that you need to add a line to both the main.cf as well as add a entry to master.cf as well. For instance, I added the following to main.cf: content_filter=spamfilter: and in master.cf I added: spamfilter unix - n n - - pipe flags=Rq user=spam argv=/usr/local/bin/spamfilter.sh ${sender}${recipient} 127.0.0.1:10027 inet n - n - 100 smtpd -o content_filter= -o myhostname=blowfish.courtesymortgage.com -o mynetworks=127.0.0.0/8 -o smtpd_client_restrictions= -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o header_checks= -o body_checks= I also was using a script I found on a web page that contained the following: INSPECT_DIR=/var/spam SENDMAIL=/usr/sbin/sendmail SPAMASSASSIN=/usr/bin/spamc EX_TEMPFAIL=75 EX_UNAVAILABLE=69 cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; } trap "rm -f in.$$; rm -f out.$$" 0 1 2 3 15 cat | $SPAMASSASSIN -f > out.$$ #|| # { echo Message content rejected; exit $EX_UNAVAILABLE; } $SENDMAIL "$@" < out.$$ exit $? But this script causes a mail loop. Anyone have any suggestions or can help me out to correct my problem? I do appreciate it. Cheers, Jason ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk