More Newbie Help

Peter Bishop pgb at adelard.com
Thu Jul 3 10:33:17 CEST 2003


On 30 Jun 2003 at 12:41, Clark, Aaron wrote:

> I have bogofilter operating on a RedHat 8.0 box running Postfix. I want
> the
> server to receive all of the Internet email and then relay filtered
> content
> to exchange. However I'm having a problem figuring out how to redirect all
> SPAM to a specific mailbox/email address on the exchange server. Would
> this
> be done through my filter script or would this have to be setup in
> Postfix?

The normal way to do this is to use procmail
by setting up a file called
.procmailrc
in the $HOME directory of every user

I am pretty sure that Redhat postfix is configured to call
procmail automatically if .procmailrc exists. 
(It certainly does on Mandrake)

You then need to understand the procmail "recipe"
language. See

man procmailrc

Also look at the the setup help provided with bogofilter.

However here is an example procmail recipe where
every user account shares a common bogofilter database
and a common bogofilter configuration.

# file .procmailrc
# set up relevant environment variables

BOGOFILTER_DIR=/usr/local/home/admin/.bogofilter
SHELL=/bin/sh

# pipe the email through bogofilter
# (switches set to add the X-Bogosity label to the email header)

:0fw
| /usr/local/bin/bogofilter -p -e -c /usr/local/etc/bogofilter.cf

# if bogofilter failed, return the mail to the queue, the MTA will
# retry to deliver it later
# 75 is the value for EX_TEMPFAIL in /usr/include/sysexits.h

:0e
{ EXITCODE=75 HOST }

# Check the bogogsity result, if spam, redirect email to
# a special email account

:0H
* ^X-Bogosity: Yes
!  spam_archive

# If unsure, put email into a different mailbox file
# called "unsure"

:0H:
* ^X-Bogosity: Unsure
unsure

# Otherwise hand back to postfix
# remaining emails are stored in the standard email mailbox


-- 
Peter Bishop 
pgb at adelard.com
pgb at csr.city.ac.uk






More information about the Bogofilter mailing list