• 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!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • 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.

Question How I enable anti-virus for all accounts in Onyx? The old way doesn't work anymore.

HHawk

Regular Pleskian
Hi guys,

I have a quick question, how do I enable anti-virus on all email accounts from SSH in Onyx?

The old way, which was working for Plesk 12.5.3, doesn't work anymore.
This is what I used in the past:

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 in; done

I tried to use the command "plesk db" first and enter the code above, but it doesn't work.

Any ideas?
 
Hi HHawk,

could you pls. tell us the output of the command
Code:
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 in; done
... and in addition, what is stored in your "panel.log" ?
 
Changing the database doesn't change the mailbox itself. you can use this php script to change all mailboxes.

PHP:
<?php

$pwfile = "/etc/psa/.psa.shadow";

$pw = trim(file_get_contents($pwfile));

mysql_connect("localhost","admin", $pw);
mysql_select_db("psa");

if (!($resdoms=mysql_query("SELECT domains.id, domains.name, mail.mail_name, mail.postbox, mail.spamfilter FROM mail, domains WHERE domains.id=mail.dom_id AND mail.postbox=true AND mail.spamfilter=false ORDER BY domains.name;"))) {
        print("MySQL error: " . mysql_error());
}

$domsfound = mysql_num_rows($resdoms);
echo "$domsfound domains found ... Starting\n";
    for ($r = 0; $r < mysql_num_rows( $resdoms); $r++) {
        $row = mysql_fetch_array ($resdoms);
    $mailbox = $row[2] . "@" . $row[1];
    $command = "plesk bin mail -u $mailbox -manage-virusfilter true";
    echo "will do: $command";
    //$done = shell_exec("$command");
    echo "$done";
    }

?>

This runs a test, remover the comment before //$done = shell_exec("$command"); to actualy do it.

change the $command = "plesk bin mail -u $mailbox -manage-virusfilter true";
in $command = "plesk bin spamassassin --update $mailbox -status true -personal-conf true -action mark";
and then the script can enable spam filter on all mailboxes.

Full list of parameters here

mail: Mail Accounts

regards
Jan
 
... mail.spamfilter ... AND mail.spamfilter=false

I see i forgot to change the query. This query is for finding mailboxes with spamfilter not enabled.

the virusfilter query is

SELECT domains.id, domains.name, mail.mail_name, mail.postbox, mail.virusfilter FROM mail, domains WHERE domains.id=mail.dom_id AND mail.postbox=true and virusfilter = 'none' ORDER BY domains.name;

regards
Jan
 
Back
Top