• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

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