Mailinabox: spampd cannot open bayes databases

Created on 28 Aug 2015  路  13Comments  路  Source: mail-in-a-box/mailinabox

I get these errors from time to time. I did not change any permissions on the /home/user-data directory.

Aug 27 09:41:49 mail spampd[1516]: processing message (unknown) for <[email protected]>
Aug 27 09:41:49 mail spampd[1516]: bayes: cannot open bayes databases /home/user-data/mail/spamassassin/bayes_* R/O: tie failed: Permission denied#012
Aug 27 09:41:50 mail spampd[1516]: clean message (unknown) (0.55/5.00) from <> for <[email protected]> in 0.22s, 6630 bytes.

Is this a bug?

bug

Most helpful comment

+1 fixed with
cd /home/user-data/mail/spamassassin/
chown spampd:spampd bayes_toks
service spampd restart

All 13 comments

+1 fixed with
cd /home/user-data/mail/spamassassin/
chown spampd:spampd bayes_toks
service spampd restart

That did the trick! But according to the setup/spamassassin.sh script it should have already been owned by spampd. Weird...

I suggest this is re-opened as on my default install it is owned by the mail user

ls -al /home/user-data/mail/spamassassin
drwxrwx--- 2 spampd spampd 4096 Sep 4 10:24 .
drwxrwxr-x 7 root www-data 4096 Apr 9 12:44 ..
-rw-rw---- 1 spampd spampd 647168 Aug 25 19:57 bayes_seen
-rw------- 1 mail mail 4317184 Aug 25 19:57 bayes_toks

I just upgraded to 13b and it has changed

ls -al /home/user-data/mail/spamassassin
total 4604
drwxrwx--- 2 spampd spampd 4096 Sep 4 16:41 .
drwxrwxr-x 7 root www-data 4096 Sep 4 15:54 ..
-rw-rw---- 1 spampd spampd 647168 Sep 4 16:41 bayes_seen
-rw-rw---- 1 spampd spampd 4317184 Sep 4 16:41 bayes_toks

This is a long-standing problem that I haven't been able to track down. I think the permissions get reset when the antispam plugin spawns spamassassin when moving mail in/out of the Spam folder.

@JoshData Did you already try setting bayes_file_mode=0660 in /etc/spamassassin/local.cf ? I am giving that a go.

I have created a branch with the setting above and haven't seen the problem in 3 days. I have a cronjob monitoring this.

Examining the logs showed it came back after a reinstall every few days. So I will test it for a few more days.

Heya,

This still occurs.

root@box:~# ls -al /home/user-data/mail/spamassassin
total 5176
drwxrwx--- 2 spampd spampd      4096 Aug  1 15:14 .
drwxrwxr-x 7 root   www-data    4096 Jul 30 21:00 ..
-rw-rw---- 1 spampd spampd   2625536 Jul 29 13:03 bayes_seen
-rw-rw---- 1 mail   mail     4825088 Jul 29 13:03 bayes_toks

Do you also see the log messages?

Yep:

Aug  1 15:14:35 box spampd[1630]: bayes: cannot open bayes databases /home/user-data/mail/spamassassin/bayes_* R/O: tie failed: Permission denied#012
Aug  1 15:14:37 box spampd[1630]: bayes: cannot open bayes databases /home/user-data/mail/spamassassin/bayes_* R/W: tie failed: Permission denied#012

I checked; on my box it happened on the 18th for the last time.

The file does have group permissions now, but that doesn't solve it. I'll try and have a look.

Would there be a risk in making them world writeable? So go with 666.

I'm running a test on my box with 666 as the file mode.

Since I changed the setup script to configure spamassasin file mode to 666 the file has changed ownership again to the mail user but with 666 rights. No errors occur in the log file. So it seems to be working.

I see a lot of post recommending to make the database world writeable.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wis picture wis  路  6Comments

franklouwers picture franklouwers  路  3Comments

yousuffarhan picture yousuffarhan  路  7Comments

duxovni picture duxovni  路  5Comments

frank-dspeed picture frank-dspeed  路  3Comments