
"They mostly come at night. Mostly."
"They mostly come at night. Mostly."
How the hell do I get SpamAssassin to work properly with Postfix? I've been through this several times before, but as far as I can tell, it's never worked right. Here is what I want:
Sounds simple, right? Sounds like the setup everyone in the world must have, right?
I can't get it to ever read the user_prefs files. And my mail log is full of errors about not being able to write lock files in ~user/.spamassassin/.
<LJ-CUT text="What I've tried... --More--(31%) ">
What I've tried:
(I see a lot of pages saying to use master.cf for this instead, but as far as I can tell, that would preclude a per-user user_prefs file ever getting consulted. Also the various FAQs on that approach make it sound flaky as all hell.)
/etc/procmailrc:
DROPPRIVS=yes
:0fw
| /opt/local/bin/spamc -x -s 1000000
(I tried it with and without DROPPRIVS.)
spamd: I have tried launching it as either
/opt/local/bin/spamd
or
/opt/local/bin/spamd --user-config --username=postfix --groupname=mail
/Users/XX/.spamassassin/*: Owned by XX; I have also tried putting them in group "mail" and making them group-writable. Didn't help.
Here's the kind of crap that is getting logged:
(I'm especially impressed at the spurious \n on each line. Kwality.)
I have no idea how to tell what's running as who at the various stages of this pipeline.
Update: I think there were at least two missing pieces: spamd needed to be launched with -H, and procmailrc needed to both DROPPRIVS and run spamc with -u $LOGNAME. So my final, working config is:
/etc/procmailrc:
DROPPRIVS=yes
:0fw
| /opt/local/bin/spamc -u $LOGNAME -x -s 100000000
/opt/local/bin/spamd -H -s local7
/etc/syslog.conf:
local7.* /var/log/spamd.log
/Users/XX/.spamassassin/*: Owned by XX
/opt/local/etc/mail/spamassassin/local.cf:
bayes_path /var/spool/spamassassin/bayes
bayes_file_mode 0666