RE: spamass-milter questions

2003-06-25 Thread Chad Stalvey
I use mimedefang and get this error when it is not running. Its my
understanding that the definition in your .mc file is to tell sendmail where
to look to get a pid for the milter so that it can pipe a message through
it. The milter needs to be started before sendmail.


Try doing the following:

#killall sendmail
#spamass-milter -p var/run/spamass-milter.sock -f
#sendmail -bd

Check your log and see what you've got...

If that didn't work, you may have a permission problem on a related file or
folder.

As far as deleting messages if they are spam, with spamass, it looks like
there is a patch available to redirect messages to a different folder. I'm
assuming that you could hack that up a bit and send it to /dev/null, but I
haven't really looked at the patch.

I would suggest going to spamass home page at:

http://savannah.nongnu.org/projects/spamass-milt/

and browse through there support forums.

The easiest way I have used spamassassin for deleting or saving email to a
users folder is with procmail. You can send it to a folder in the users home
dir. named accordingly, or straight to /dev/null. I wouldn't suggest this
route on a high volume mail server though. If you go this route, *Make
sure you read about the procmail bug that will corrupt the mail file by
removing the 'F' from the first 'From' line of the message. There is however
a simple fix for this.

Mimedefang works awesome. Not only do you get the Spam filtering but you
also get an antivirus scanning as well. Plus the mailling lists are very
informational, and that is a big PLUS!!

Let me know if you want to go either of the other two routes and I can help
you out further with those as I have a first hand experience with them.


Hope this helps you out.

DEATH TO SPAM!!!

Chad Stalvey
Hayes E-Government Resources
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Andreas Widerøe
Andersen
Sent: Wednesday, June 25, 2003 8:05 AM
To: [EMAIL PROTECTED]
Subject: spamass-milter questions


Hi all,
I have two questions releated to spamass-milter on my FreeBSD box:

1. How do I get rid of these errors?

Jun 25 13:54:15 server sendmail[52687]: h5PBs8Xv052687: Milter
(spamassassin): local socket name /var/run/spamass-milter.sock unsafe
Jun 25 13:54:15 server sendmail[52687]: h5PBs8Xv052687: Milter
(spamassassin): to error state

spamass-milter is started by this line in my sendmail.cf (actually .mc
before compile) file:

INPUT_MAIL_FILTER(`spamassassin', `S=local:/var/run/spamass-milter.sock,
F=, T=C:15m;S:4m;R:4m;E:10m')

2. How can I automatically delete messages that gets the X-Spam: Yes flag
set? I want to do this for messages I forward to other server etc. Ie.
virtusertable: [EMAIL PROTECTED]   [EMAIL PROTECTED]

Thanks!


---
Andreas Widerøe Andersen [EMAIL PROTECTED]
Pragma AS

http://www.pragma.no

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: spamass-milter questions

2003-06-25 Thread Matthew Seaman
On Wed, Jun 25, 2003 at 02:05:04PM +0200, Andreas Widerøe Andersen wrote:
 Hi all,
 I have two questions releated to spamass-milter on my FreeBSD box:
 
 1. How do I get rid of these errors?
 
 Jun 25 13:54:15 server sendmail[52687]: h5PBs8Xv052687: Milter 
 (spamassassin): local socket name /var/run/spamass-milter.sock unsafe
 Jun 25 13:54:15 server sendmail[52687]: h5PBs8Xv052687: Milter 
 (spamassassin): to error state

Hmmm... Check the permissions on /, /var, /var/run and
/var/run/spamass-milter.sock -- there shouldn't be any group or world
write bits set, and all the files should be owned by root:wheel

% ls -lad / /var /var/run /var/run/spamass-milter.sock
drwxr-xr-x  20 root  wheel  512 Jun 21 22:46 /
drwxr-xr-x  30 root  wheel  512 Jun 13 08:08 /var
drwxr-xr-x   5 root  wheel  512 Jun 23 22:00 /var/run
srwxr-xr-x   1 root  wheel0 Jun 23 12:26 /var/run/spamass-milter.sock
 
 spamass-milter is started by this line in my sendmail.cf (actually .mc 
 before compile) file:
 
 INPUT_MAIL_FILTER(`spamassassin', `S=local:/var/run/spamass-milter.sock, 
 F=, T=C:15m;S:4m;R:4m;E:10m')

Looks fine to me.
 
 2. How can I automatically delete messages that gets the X-Spam: Yes flag 
 set? I want to do this for messages I forward to other server etc. Ie. 
 virtusertable: [EMAIL PROTECTED]   [EMAIL PROTECTED]

It's quite tricky to do that for just some of the e-mail passing
through your system.  You can tell spamass-milter to bounce e-mail if
it scores more than a certain amount using the '-r nn' flag, which is
good for getting rid of the most egregious spams.  However that
filtering occurs with all of the e-mail passing through your system,
including stuff you're sending out.  The problem with spamass-milter
is that it's an input mail filter (input from the p.o.v. of the
sendmail MTA process), and so doesn't have the natural connection to
the user receiving the mail (hence the ability to eg. look up
preferences in the user's home dir or the like) that a delivery filter
would.  There are some hacks with the '-u' option, but they can't
distinguish local and remote addresses that happen to have the same
username, they don't deal very well with delivery to multiple
recipients and I don't think they cope very well if you use
genericstable to make your e-mail address different from your login
name.

Probably your best bet is to install something like procmail as your
local delivery agent on the system where the mail gets finally
delivered.  You can send the objectionable stuff to /dev/null very
readily that way.  Even so, that won't save you the bandwidth required
to relay the spam from one of your mail servers to the other.

One thing I've found beneficial when running spamass-milter is to make
the spamd process it passes all the messages to run as a different
user than root/nobody.  This permits spamd and spamass-milter to use
the auto-whitelist and bayesian matching filters -- these require
write access to a chunk of disk space in order to keep previous
results.  I chose 'mailnull' as the UID to use as parts of the mail
system already run as that.  Since mailnull uses /var/spool/mqueue as
it's home dir I used the '--virtual-config-dir' option to get spamd to
keep it's working files in a different directory:

spamd -a -c -u mailnull --virtual-config-dir=/var/spamassassin/%u -d

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   26 The Paddocks
  Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey Marlow
Tel: +44 1628 476614  Bucks., SL7 1TH UK


pgp0.pgp
Description: PGP signature