• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    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. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Spam and Kaspersky

yurka

New Pleskian
Hi,

How can I enable Spam and Kaspersky filtering on all mailboxes in server at once (it if possible). Without need to do it one by one.

10x
 
You can use following sql query for extracting all email addresses from psa database:

select concat(mail.mail_name,"@",domains.name) as name from mail,domains,accounts where mail.dom_id=domains.id and mail.account_id=accounts.id;

and use it for script for updating mailsettings like (for antivir):

for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select concat(mail.mail_name,"@",domains.name) as address from mail,domains,accounts where mail.dom_id=domains.id and mail.account_id=accounts.id order by address"`; do /usr/local/psa/bin/mail -u $i -antivirus inout; done

or for Spam:

for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select concat(mail.mail_name,"@",domains.name) as address from mail,domains,accounts where mail.dom_id=domains.id and mail.account_id=accounts.id order by address"`; do /usr/local/psa/bin/spamassassin -u $i -status=true; done

But problem in that for some reasons sql query works fine inside mysql environment:

mysql> select concat(mail.mail_name,"@",domains.name) as name from mail,domains,accounts where mail.dom_id=domains.id and mail.account_id=accounts.id;
+--------------------------------+
| name |
+--------------------------------+
| mail@plesk10.domain.com |
| usersb@plesk10.domain.com |
+--------------------------------+
2 rows in set (0.00 sec)

But doesn't work in shell:

# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -Ns -e "select concat(mail.mail_name,"@",domains.name) as name from mail,domains,accounts where mail.dom_id=domains.id and mail.account_id=accounts.id"
NULL
NULL

Try to catch up why and you will get good solution :)
 
Well. Problem was in "@"
There should be '@' in sql query :)
 
10x, will tryit.

Is it possible to enable spam and to enable the "Move to SPAM folder" as well?

P.S.
For some reason enabling "Move to SPAM folder" from Plesk Panel do nothig, the mails still coming to Inbox with ****Spam**** in subject.
 
Last edited:
for moving spam to folder just change
-status=true
to
-status true -action move -modify-subj true
 
Right. Just use necessary options for corresponding CLI utilities.
 
Even when move to spam folder option is selected still all spam marked mail come to Inbox. Any suggestions?
10x
 
Yes. in subject I see ******Spam*****
I upgraded the system from 8.6 to 10..2, may be there some permission problems ?
 
Back
Top