Re: [SLUG] Postfix+procmail+spamassassin

From: SpamFree (SpamFree@tampabay.rr.com)
Date: Thu May 22 2003 - 09:37:02 EDT


On Wednesday May 21 2003 07:42 pm, you wrote:
> 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

In the procmailrc above, your logfile is not spelled correctly. Double check
it for correctness, though this has nothing to do with your problem.

Put the Spamassassin script back to the way it was in the how-to, meaning to
remove the pipe to procmail and instead pipe it to sendmail. Then in your
/etc/postfix/main.cf change the mailbox command to mailbox_command =
/usr/bin/procmail. Then execute postfix reload. That should get it. Your
message flow should then be Postfix -> Spamassassin -> Postfix -> Procmail ->
user's mailbox.

If it still doesn't work send a snippet, for a delivered message, from your
/var/log/maillog and a relevant snippet from you /var/log/procmaillog.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:11:23 EDT