From owner-freebsd-questions@FreeBSD.ORG Wed Jun 25 07:04:24 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8FEAF37B401 for ; Wed, 25 Jun 2003 07:04:24 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F07A44013 for ; Wed, 25 Jun 2003 07:04:22 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [127.0.0.1]) h5PE461I094226 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 25 Jun 2003 15:04:18 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)h5PE46C0094225; Wed, 25 Jun 2003 15:04:06 +0100 (BST) (envelope-from matthew) Date: Wed, 25 Jun 2003 15:04:06 +0100 From: Matthew Seaman To: Andreas =?iso-8859-1?Q?Wider=F8e?= Andersen Message-ID: <20030625140406.GH90078@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Andreas =?iso-8859-1?Q?Wider=F8e?= Andersen , freebsd-questions@freebsd.org References: <5.2.0.9.0.20030619150558.029c9888@mail.pragma.no> <5.2.0.9.0.20030619141344.02971008@mail.pragma.no> <5.2.0.9.0.20030619150558.029c9888@mail.pragma.no> <5.2.0.9.0.20030625135621.02ffb030@mail.pragma.no> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="G3juXO9GfR42w+sw" Content-Disposition: inline In-Reply-To: <5.2.0.9.0.20030625135621.02ffb030@mail.pragma.no> User-Agent: Mutt/1.5.4i X-Spam-Status: No, hits=-11.4 required=5.0 tests=AWL,BAYES_00,EMAIL_ATTRIBUTION,IN_REP_TO,PGP_SIGNATURE_2, QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES, USER_AGENT_MUTT autolearn=ham version=2.55 X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: freebsd-questions@freebsd.org Subject: Re: spamass-milter questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jun 2003 14:04:25 -0000 --G3juXO9GfR42w+sw Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 25, 2003 at 02:05:04PM +0200, Andreas Wider=F8e Andersen wrote: > Hi all, > I have two questions releated to spamass-milter on my FreeBSD box: >=20 > 1. How do I get rid of these errors? >=20 > Jun 25 13:54:15 server sendmail[52687]: h5PBs8Xv052687: Milter=20 > (spamassassin): local socket name /var/run/spamass-milter.sock unsafe > Jun 25 13:54:15 server sendmail[52687]: h5PBs8Xv052687: Milter=20 > (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 wheel 0 Jun 23 12:26 /var/run/spamass-milter.so= ck =20 > spamass-milter is started by this line in my sendmail.cf (actually .mc=20 > before compile) file: >=20 > INPUT_MAIL_FILTER(`spamassassin', `S=3Dlocal:/var/run/spamass-milter.sock= ,=20 > F=3D, T=3DC:15m;S:4m;R:4m;E:10m') Looks fine to me. =20 > 2. How can I automatically delete messages that gets the X-Spam: Yes flag= =20 > set? I want to do this for messages I forward to other server etc. Ie.=20 > virtusertable: johnny@domain.com joh@nny.com 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=3D/var/spamassassin/%u -d Cheers, Matthew --=20 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 --G3juXO9GfR42w+sw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQE++avWdtESqEQa7a0RAlBDAJwI7uL4+ZsvnLhdpdmoKdl4RtDlTQCgm9iO bwdWcIxtmFeCWBTNjI1kUs8= =TUG7 -----END PGP SIGNATURE----- --G3juXO9GfR42w+sw--