Plesk

How to configure mailboxes to move spam messages to Spam folder server-wide in Plesk?

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:

  1. Log in to Plesk

  2. Install Spamassassin in Plesk > Tools & Settings > Updates & Upgrades

  3. Log in to Plesk server using SSH

For existing mailboxes

  1. Download the script:

    # curl -OL https://raw.githubusercontent.com/plesk/kb-scripts/master/move-mail-to-spam/existing-mailboxes.sh

  2. Grant execution permission to the script:

    # chmod +x existing-mailboxes.sh

  3. Execute the script:

    # ./existing-mailboxes.sh

For newly created mailboxes

  1. Download the script:

    # curl -OL https://raw.githubusercontent.com/plesk/kb-scripts/master/move-mail-to-spam/new-mailboxes.sh

  2. Grant execution permission to the script:

    # chmod +x new-mailboxes.sh

  3. Go to Plesk > Tools & Settings > Event Manager

  4. Click Add Event Handler

  5. Select the event Mail account created and specify the path to the script in the Command field:

    /root/new-mailboxes.sh

Exit mobile version