New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spampd cannot open bayes databases #534

Closed
0xFelix opened this Issue Aug 28, 2015 · 13 comments

Comments

Projects
None yet
6 participants
@0xFelix
Contributor

0xFelix commented Aug 28, 2015

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 <user@mydomain.tld>
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 <user@mydomain.tld> in 0.22s, 6630 bytes.

Is this a bug?

@Futurama56

This comment has been minimized.

Show comment
Hide comment
@Futurama56

Futurama56 Aug 29, 2015

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

Futurama56 commented Aug 29, 2015

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

@0xFelix

This comment has been minimized.

Show comment
Hide comment
@0xFelix

0xFelix Aug 29, 2015

Contributor

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

Contributor

0xFelix commented Aug 29, 2015

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

@0xFelix 0xFelix closed this Sep 4, 2015

@anoma

This comment has been minimized.

Show comment
Hide comment
@anoma

anoma Sep 4, 2015

Contributor

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

Contributor

anoma commented Sep 4, 2015

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

@0xFelix 0xFelix reopened this Sep 4, 2015

@anoma

This comment has been minimized.

Show comment
Hide comment
@anoma

anoma Sep 4, 2015

Contributor

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

Contributor

anoma commented Sep 4, 2015

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

@JoshData

This comment has been minimized.

Show comment
Hide comment
@JoshData

JoshData Sep 4, 2015

Member

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.

Member

JoshData commented Sep 4, 2015

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 JoshData added the bug label Feb 20, 2016

@yodax

This comment has been minimized.

Show comment
Hide comment
@yodax

yodax Mar 17, 2016

Collaborator

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

Collaborator

yodax commented Mar 17, 2016

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

@yodax

This comment has been minimized.

Show comment
Hide comment
@yodax

yodax Mar 20, 2016

Collaborator

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.

Collaborator

yodax commented Mar 20, 2016

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.

@mariusv

This comment has been minimized.

Show comment
Hide comment
@mariusv

mariusv Aug 1, 2016

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

mariusv commented Aug 1, 2016

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
@yodax

This comment has been minimized.

Show comment
Hide comment
@yodax

yodax Aug 1, 2016

Collaborator

Do you also see the log messages?

Collaborator

yodax commented Aug 1, 2016

Do you also see the log messages?

@mariusv

This comment has been minimized.

Show comment
Hide comment
@mariusv

mariusv Aug 1, 2016

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

mariusv commented Aug 1, 2016

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
@yodax

This comment has been minimized.

Show comment
Hide comment
@yodax

yodax Aug 1, 2016

Collaborator

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.

Collaborator

yodax commented Aug 1, 2016

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.

@yodax

This comment has been minimized.

Show comment
Hide comment
@yodax

yodax Aug 2, 2016

Collaborator

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

Collaborator

yodax commented Aug 2, 2016

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

@yodax

This comment has been minimized.

Show comment
Hide comment
@yodax

yodax Aug 4, 2016

Collaborator

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.

Collaborator

yodax commented Aug 4, 2016

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.

@JoshData JoshData reopened this Sep 23, 2016

JoshData added a commit that referenced this issue Sep 23, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment