1

I'm trying to get dovecot-antispam working with SpamAssassin' sa-learn. This is my Dovecot configuration:

antispam_backend = pipe
antispam_trash = trash;Trash;Deleted Items; Deleted Messages
antispam_spam = Junk
antispam_pipe_program_spam_arg = --spam
antispam_pipe_program_notspam_arg = --ham
antispam_pipe_program = /usr/bin/sa-learn
antispam_pipe_tmpdir = /tmp

However, I can't seem to get it working. When I try to move a false-negative from/to my Junk folder in my MUA I get the following error:

[SERVERBUG] Failed to send mail

This is what gets logged by dovecot-antispam:

imap: antispam: mail copy: src spam: 1, dst spam: 0, src unsure: 0
imap: antispam: running mailtrain backend program /usr/bin/sa-learn
imap: antispam: running mailtrain backend program /usr/bin/sa-learn
imap: antispam: running mailtrain backend program parameter 1 --ham
imap: antispam: run program failed with exit code 2

So apparently, sa-learn exits with code 2. However, I don't know what that means. sa-learn's documentation doesn't mention anything about exit codes, so I don't know where I should start to debug this.

Compizfox
  • 414

1 Answers1

3

When you move message, then dovecot invoke the sa-learn with dovecot's UID, so sa-learn hasn't enough permissions to update bayesian databases.

You have to add dovecot's user to the spamd group and ensure you have the next line

bayes_file_mode 0660

in the etc/spamassassin/local.cf file.

Also you have to verify is bayes databases already have permissions 0660. Then restart spamassassin.

Kondybas
  • 7,110