Question
How to configure mailboxes to move spam messages to a Spam folder server-wide in Plesk?
Answer
It is not possible to configure mailboxes to move spam messages to a Spam folder server-wide in Plesk via GUI. It can be configured individually for a mailbox.
Please follow the below steps to configure the Spam folder server-wide using CLI utility for Spamassassin:
-
Install Spamassassin in Plesk > Tools & Settings > Updates & Upgrades
-
Log in to Plesk server using SSH
For existing mailboxes
-
Download the script:
# curl -OL https://raw.githubusercontent.com/plesk/kb-scripts/master/move-mail-to-spam/existing-mailboxes.sh
-
Grant execution permission to the script:
# chmod +x existing-mailboxes.sh
-
Execute the script:
# ./existing-mailboxes.sh
For newly created mailboxes
-
Download the script:
# curl -OL https://raw.githubusercontent.com/plesk/kb-scripts/master/move-mail-to-spam/new-mailboxes.sh
-
Grant execution permission to the script:
# chmod +x new-mailboxes.sh
-
Go to Plesk > Tools & Settings > Event Manager
-
Click Add Event Handler
-
Select the event Mail account created and specify the path to the script in the Command field:
/root/new-mailboxes.sh