Howto enable antivirus for all accounts in Plesk

To enable AntiVirus for all accounts in Plesk you can use the following script:

#!/bin/bash
 
mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa<<-EOT
UPDATE mail 
  SET virusfilter = 'any'
  WHERE postbox = 'true' AND virusfilter != 'any'
EOT

You can run it daily from the cron to keep your mailboxes protected.