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.