More Newbie Help

Peter Bishop pgb at adelard.com
Wed Jul 9 10:35:27 CEST 2003


On 8 Jul 2003 at 14:21, Clark, Aaron wrote:

> Thanks for the response Peter. Will this work if the users do not have 
local
> mailboxes? This server is a gateway to filter mail and pass all good mail 
on
> to an Exchange 5.5 server where all of the users' mailboxes are located. 
> 
> I've tried the procmail setup and it does not seem to work. It looks like
> procmail is not even being called. Here are the steps I used to configure
> the server:
> 	- Install RH 8.0
> 	- Updated Postfix 2.0.13
> 	- Installed Bogofilter 0.13.7
> 	- trained bogofilter with 500 spam messages
> 	- changed /etc/bogofitler.cf.example to bogofitler.cf and
> uncommented the X-Bogosity headers
> 	- created /etc/procmailrc from the email below
> 	- added mailbox_command=/usr/bin/procmail -p /etc/procmailrc
> 	- sent email containing message contents from one spam message used
> in the spamlist.db from an outside account
> 	- email is relayed to Exchange server mailbox (I attached a tail of
> the maillog)
> 
> I've also tried to use the procmail.log setting to create a log in 
/var/log.
> The log is never created. I have also touched the file to create but it
> never updates, its empty. 
> 
> Thanks,
> Aaron Clark

I must admit this is a different setup to mine.
In the my case the  individual accounts are on the unix box
and there is a .procmailrc for each user
(handy if you want to experiment with procmailrc setups)

I think procmail might not work in your case as postfix invokes
procmail just before the mail is stored in the local account, i.e.
the user account must exist on the box and the email
must be addressed to that account. (You could test this by setting up a 
local account and sending an email to it and check if the log is updated)

In your postfix setup, I assume the mail is  being relayed to the Exchange 
server so procmail is bypassed.

 Possible options to fix this might be:
1) mirror Exchange email accounts on the box and use procmail scripts to 
apply bogofilter then forward the mail to the Exchange server.

2) mirror the Exchange accounts on the box, and get the mail clients to    
access your box rather than the Exchange server 
(who needs Exchange anyway? :-)

However, I am sure that other bogofilter users can think of more direct 
ways of doing what you want.


> 
> -----Original Message-----
> From: Peter Bishop [mailto:pgb at adelard.com] 
> Sent: Thursday, July 03, 2003 1:33 AM
> To: 'bogofilter at aotto.com'
> Subject: Re: More Newbie Help 
> 
> 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

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






More information about the Bogofilter mailing list