User postfix refuses to run sa-learn

Martin Wickman martin.wickman at xms.se
Sun Sep 16 17:01:07 IST 2007


Glenn Steen wrote:
> On 16/09/2007, Martin Wickman <martin.wickman at xms.se> wrote:
>> Hi
>>
>> I'm running MailScanner with spamassassin and postfix. I have configured
>> postfix to execute a script which runs sa-learn on all new mails that
>> gets sent to the 'spam' user. The idea is to update the site-global
>> /var/spool/MailScanner/spamassassin/bayes.* database automatically when
>> my users forwards their spam.
>>
>> In postfix/master.cf I have this rule:
>>
>> spam unix -  n n -   -   pipe user=postfix:postfix
>>     argv=/usr/local/bin/sa-learn-wrapper.pl spam ${sender}
>>
>> That says that postfix should run a command which updates the bayes
>> database.
>>
>> BUT that fails horrible because postfix refuses to run commands as the
>> postfix user...
>>
>> 'Run As User' is postfix and thus /var/spool/.../bayes* is also owned by
>> postfix. Afaik I *need* to run sa-learn as postfix since the
>> bayes-database and spamassassin is owned and ran by postfix. Its some
>> kind of catch-22 here :(
>>
>> Apart from chmod 666 /var/spool/.../bayes* and using nobody:nobody, do
>> you guys have any ideas how to fix this?
>>
> 
> fisrt up... What is your bayessetup in SA? bayes_path ... etc...
> Second... When run like that, aren't you in the chroot jail? So paths
> etc would be "wrong", so to speak...?

It's a standard setup more or less. No chroot jail at the moment.
bayes_path is /var/spool/MailScanner/spamassassin/bayes

This is not a path problem, its a problem because SA runs as postfix and
I need sa-learn to run as postfix as well, since the bayes database in
bayes_path is postfix owned.


More information about the MailScanner mailing list