Re: [SLUG] Postfix+procmail+spamassassin

From: Doug Koobs (dkoobs@dkoobs.com)
Date: Wed May 21 2003 - 19:42:34 EDT


OK, thanks for the tips. I've made some progress using the link you posted...
Right now, my setup is like this:

postfix>spamc>spamd>sendmail

(Note: the sendmail above is just a part of postfix, not the sendmail smtp
server)

Actually, postfix sends the mail to a script, that calls spamc, which sends it
to spamd. The output is then piped into sendmail to send it on to the
original recipient. Here is the script, named postfixfilter:

#!/bin/bash
/usr/bin/spamc | /usr/sbin/sendmail -i "$@"
exit $?
 However, there is nothing in this setup that cannchange the recipient if
spamassassin labels a message as spam. That's what I need procmail for.

I tried to change the script to:
/usr/bin/spamc | /usr/sbin/procmail

and I set up /etc/procmailrc:

LOGFILE=/var/log/prcomaillog
VERBOSE=1

:0
* ^Subject.*\[!!THIS IS SPAM!!\]
! oma@dkoobs.com

Spamassassin is set to change the subject of spam to [!!THIS IS SPAM!!]
So, I though this would capture the spam, send it to oma@dkoobs.com. Anything
else would just be delivered normally. Well, that was my plan. In reality,
wehn I sent mail, wether spam or not, it just went into postfixfilter's
mailbox /var/spool/mail/postfixfilter)
How do I get this to go to the original recipient?

Disclaimer: I apologize for the length and incoherent nature of this
message... I claim the same shelter as another SLUGer... Too many Sam Adams
(Light for me:::)!!!

Doug

On Tuesday 20 May 2003 10:23 pm, you wrote:
> On Monday May 19 2003 10:42 pm, you wrote:
> > I apologize for bringing this up again, but I'm still having trouble
> > grasping this...
> >
> > I've got Postfix running on RH9, and imapd to give clients access to the
> > mail. I'd like to use SpamAssassin to filter spam by content. (I notice
> > that spamd starts at bootup, but I don't think it's actually doing
> > anything.) From earlier posts, I know I need Procmail to do this. But I'm
> > having trouble figuring out how to get the mail piped from one program to
> > another. From what I gather, this is the path that email should take in
> > my proposed setup:
> >
> > postfix>procmail>spamassassin>procmail>postfix>??????
> >
> > Can anyone point me in the right directoin for some good docs, or provide
> > stepson how to do this? Thanks,
> >
> > Doug
>
> Actually, procmail is not a requirement. Here is a step by step how-to for
> configuring Postfix to filter all mail through spamassassin.
> http://hints.linuxfromscratch.org/hints/postfix+spamassassin+razor.txt
>
> When you are done, you can test to see if it works by sending a Postfix
> user the sample message at /usr/share/doc/spamassassin-2.44/sample-spam.txt
>
> Using this method is rather simple and reliable.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:10:33 EDT