From owner-freebsd-questions@FreeBSD.ORG Mon Jul 16 00:42:48 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B903716A401 for ; Mon, 16 Jul 2007 00:42:48 +0000 (UTC) (envelope-from jeffrey@goldmark.org) Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by mx1.freebsd.org (Postfix) with ESMTP id 7E38413C4A5 for ; Mon, 16 Jul 2007 00:42:48 +0000 (UTC) (envelope-from jeffrey@goldmark.org) Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 1B0A38C7E for ; Sun, 15 Jul 2007 20:42:47 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Sun, 15 Jul 2007 20:42:47 -0400 X-Sasl-enc: iQBu1E+jEyMZR5WM1EwYXfEBxjYGa/s778JKCWSgnnvu 1184546566 Received: from [10.1.10.136] (n114.ewd.goldmark.org [72.64.118.114]) by mail.messagingengine.com (Postfix) with ESMTP id B22B320446 for ; Sun, 15 Jul 2007 20:42:46 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: <01AA7EFC-C05E-4DFE-BD83-A176D5DF52F2@goldmark.org> References: <01AA7EFC-C05E-4DFE-BD83-A176D5DF52F2@goldmark.org> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <4392C8CA-FB7D-4E88-B541-71CD7762DAC9@goldmark.org> Content-Transfer-Encoding: 7bit From: Jeffrey Goldberg Date: Sun, 15 Jul 2007 19:42:44 -0500 To: FreeBSD Questions X-Mailer: Apple Mail (2.752.2) Subject: Re: postfix + spamassassin via milter X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2007 00:42:48 -0000 On Jul 15, 2007, at 10:39 AM, Jeffrey Goldberg wrote: > I running postfix from ports. I would like to block as much spam > as possible during the SMTP session. [...] > > I see that postfix now does sendmail style milters. Is that the > recommended way to go with this? I see that there is a mail/ > spamass-milter port. I anyone using that with postfix 2.4.3? Here is what I have working so far. Straight from ports p5-Mail-SpamAssassin-3.2.1 spamass-milter-0.3.1_3 postfix-2.4.3,1 To get postfix to use the milter, I added # milters for spam assassin milter_default_action = accept smtpd_milters = unix:/var/run/spamass-milter.sock to main.cf Note that the milter_default_action setting is so that if I mess up the milter, mail still goes through. I may set this to tempfail once I am more confident. Also to allow postfix to talk to the milter I added spamass_milter_socket_group="mail" spamass_milter_socket_mode="664" to /etc/rc.conf (in addition to the _enable variables). I will submit a PR with an addition to the documentation explaining how to do this with postfix. What I've been having the most difficulty with is spammassassin itself. It runs correctly as the spamd user (note that this is *not* the spamd which is the BSD tarpit, but is a daemonized spamassassin.) but it still seems to think that is also running as user root and so tries to write things in /root/.spamassassin Now if I change the ownership of that spamd then everything works fine, but I really don't want my bayes and whitelist database on the root filesystem. I can (and have) manually set the paths for the bayes data and the autowhitelist data to a more appropriate location, but the later path setting feature appears undocumented, and I still haven't figured out what path variable to set for the user preferences (so each time mail comes into the server, spamassassin, run as spamd, tries to read /root/.spamassassin/user_pref. I'm sure that I could probably trace out the separate configuration variable to set that to the right location, but I'm wondering why spamassassin is looking in root's home directory at all instead of the spamd home directory. -j -- Jeffrey Goldberg http://www.goldmark.org/jeff/