#992829 spamassassin: "spamassassin -r" fails with permission problem

Package:
spamassassin
Source:
spamassassin
Submitter:
Francois Marier
Date:
2021-09-03 20:06:03 UTC
Severity:
normal
Tags:
#992829#5
Date:
2021-08-23 23:39:55 UTC
From:
To:
When I run "spamassassin -r" from mutt, I get the following error:

  Can't locate Mail/SpamAssassin/Bayes.pm:   /var/lib/spamassassin/compiled/5.032/3.004006/Mail/SpamAssassin/Bayes.pm: Permission non accordée at /usr/share/perl5/Mail/SpamAssassin.pm line 1771. at /usr/bin/spamassassin line 413.

Here's the relevant entry in my ~/.muttrc:

  macro index \ed "<enter-command>unset wait_key\n<pipe-entry>spamassassin -r\n<enter-command>set wait_key\n<save-message>=spam\n" "report the message as spam"

Francois

#992829#10
Date:
2021-08-24 00:14:05 UTC
From:
To:
Control: tags -1 + moreinfo

Initialization of the Bayes database involves opening files relative to
$HOME.  I'm wondering if maybe HOME, or some other important environment
variable, is unset when you invoke spamassassin this way.  If HOME is
unset, then it could be that it's trying to open these files relative to
to /, which would result in problems such as the one you describe.

What happens if you pipe message content to spamassassin from your
shell, outside mutt?

Consider adding the '-D' flag to spamassassin to produce a lot of debug
output.  This could provide additional clues as to what spamassassin is
trying to do.

noah

#992829#17
Date:
2021-09-02 05:06:19 UTC
From:
To:
I've attached the result of piping your message to spamassassin in this way:

  cat msg  | spamassassin -r -D > spamassassin.out 2>&1

From what I can see, $HOME is set correctly, but perhaps the permissions on
/var/lib/spamassassin are the source of the problem given that I'm running
the spamassassin binary as the "francois" user?

  $ ls -ld /var/lib/spamassassin
  drwxr-x--- 8 debian-spamd debian-spamd 4,0K  4 jun 10:36 /var/lib/spamassassin/

In the last week, I've certainly noticed that SpamAssassin is letting tons
of spam through. Maybe because everything ends up triggering BAYES_00?

Francois

#992829#22
Date:
2021-09-03 20:03:24 UTC
From:
To:
As far as I can tell, I was able to fix this successfully by doing:

  chmod a+rx /var/lib/spamassassin

Not sure why this changed recently (after the bullseye release), but perhaps
that's something that the package needs to set.

Francois