When using dovecot with dovecot-antispam and dspam backend, dspam can't be executed by dovecot as it uses uid/gid of virtual user, giving this error : Debug: executing /usr/bin/dspam failed: 13 (uid=1001, gid=12) Reproducible: Always Steps to Reproduce: 1. Install dovecot, dovecot-antispam and dspam 2. Configure dovecot-antispam plugin to use dspam backend 3. Move an email from or to the Spam folder Actual Results: Error in mail.log : Debug: executing /usr/bin/dspam failed: 13 (uid=1001, gid=12) When running dspam by hand with dovecot virtual user vmail (mail or vmail in most cases) : $ sudo -u vmail /usr/bin/dspam --source=error --class=spam --signature=4be87a9f953248352114216 --client --user vmail sudo: unable to execute /usr/bin/dspam: Permission denied Changing dspam binary permissions fixes the issue : $ chmod 4511 /usr/bin/dspam
You should be using /usr/bin/dspamc instead which any user can run and that communicates with dspam running in daemon mode.
Dovecot configuration defaults to /usr/bin/dspam, that's why I opened this bug.