Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jun 2003 15:04:06 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Andreas =?iso-8859-1?Q?Wider=F8e?= Andersen <awand@pragma.no>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: spamass-milter questions
Message-ID:  <20030625140406.GH90078@happy-idiot-talk.infracaninophile.co.uk>
In-Reply-To: <5.2.0.9.0.20030625135621.02ffb030@mail.pragma.no>
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>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030625140406.GH90078>