postfix + spamassassin via milter
jeffrey at goldmark.org
Mon Jul 16 00:42:48 UTC 2007
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
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
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
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
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.
Jeffrey Goldberg http://www.goldmark.org/jeff/
More information about the freebsd-questions