After upgrading from Ubuntu 18.04 to 22.04, I can no longer move mail between spam folder and inbox folder

I can move the spam mail to any other folder. I can move mail between other folders. I just can’t move mail between “spam” and “inbox” folders.

I’m seeing the following errors:

  • Thunderbird: [SERVERBUG] failed to send mail
  • Roundcube: Server Error: UID MOVE: failed to send mail

I would appreciate any assistance on this (even if it’s how to diagnose what’s happening). No relevant lines pop up in /var/log/mail.log or /mail/log/mail.err when the error occurs, so I’m not sure where else to look.

The issue in my case was that the /usr/local/bin/sa-learn-pipe.sh file was missing “group” and “other” read permissions (i.e. it only had execute permissions). This file is needed by the dovecot antispam plugin (to invoke spamassasin).

This question and answer helped me: spam - SpamAssassin with dovecot-antispam training - Server Fault