• Inviting everyone who uses WordPress management tools in Plesk
    The Plesk team is conducting a 60-minute research session that includes an interview and a moderated usability test.
    To participate, please use this link .
    Your experience will help shape product decisions and ensure the tools better support real-world use cases.

SpamAssasin Enable

K

kieranjones

Guest
I've had a browse and search around the forums and couldn't find anything that specifically answered this so I've posted a new topic.

It seems that Plesk has not been automatically enabling spam assasin on mailboxes. I have no set it up to do this using the event manager.

Question is, how can I easily go through and enable spam assasin on all the mailboxes that don't have it already enabled?

Your help is appreciated :)
 
First of all you can use 'Group Operations' on domains and enable Spamassassin support with help of it: Domains -> domain.tld -> Mail, check all accounts and click on 'Group Operations'. The you will be able to enable Spamassassin support and make some other configurations for mail names on domain.

Plesk also has a functional set of CLI utilities in /usr/local/psa/bin directory including utility spamassassin.sh which allows to change spamassassin settings for specific mailname. To use it in batch mode for all mailnames at once you should put it in some kind of cycle, e.g.:

echo "select concat(m.mail_name,'@',d.name) from domains d, mail m where m.dom_id=d.id" | \
mysql -uadmin -p`cat /etc/psa/.psa.shadow` -Dpsa -Ns | while read mailname ; do \
/usr/local/psa/bin/spamassassin.sh --update $mailname -action del -hits 4.0 ; done

For more options for spamassassin.sh check it's help page:

/usr/local/psa/spamassassin.sh --help

Hope it helps..On Debian server you should user /opt/psa/bin/spamassassin.sh script.
 
Oh..sorry, if you wish to enable only you need to use following command:

echo "select concat(m.mail_name,'@',d.name) from domains d, mail m where m.dom_id=d.id" | \
mysql -uadmin -p`cat /etc/psa/.psa.shadow` -Dpsa -Ns | while read mailname ; do \
/usr/local/psa/bin/spamassassin.sh --update $mailname -status true ; done
 
Thank you! You're a genius, haha.

I love it when someone like you can just post a simple easy to understand and execute answer to a problem like that :)
 
Back
Top