How to set spam filter settings for bunch of email accounts avoiding configuration of Spamassassin on server level in Plesk for Linux?
Plesk GUI and
spamasassin utility do not support multiple mail accounts management at once. Instead, the following command should be used to update multiple mailboxes simultaneously:
# mysql -uadmin -p`cat /etc/psa/.psa.shadow ` -Dpsa -Ne"SELECT CONCAT(mail_name,'@',name) FROM mail,domains WHERE dom_id=domains.id AND postbox='true';"|while read i;do /usr/local/psa/bin/spamassassin -u $i -status true -action del -hits 5;done
This command will enable Spamassassin on all mailboxes (if disabled), set 5 hits required for marking a message as spam, set spam messages to be deleted
For details about spam settings management via Plesk CLI, visit:
122520 [How to] Manage spam settings in Plesk via CLI?