Question
How to enable Kaspersky Antivirus or Plesk Premium antivirus server-wide in Plesk?
Answer
Plesk for Windows
-
Purchase additional key for required antivirus.
-
Install the Kaspersky Antivirus or Plesk Premium antivirus component.
-
Install the license key at Tools & Settings > License Management > Additional License Keys.
-
Go to Tools & Settings > Mail Server Settings > Settings and select Kaspersky AntiVirus or Plesk Premium antivirus radio button under Antivirus settings.
-
Switch to Antivirus tab and select usage policy, for example:
Plesk for Linux
Note: In Plesk for Linux it is required to log into server directly to enable antivirus for all mailboxes at once
-
Purchase additional key for required antivirus.
-
Install the Kaspersky Antivirus or Plesk Premium antivirus component.
-
Install the license key at Tools & Settings > License Management Additional License Keys.
-
Go to Tools & Settings > Mail Server Settings > Settings and select Kaspersky AntiVirus or Plesk Premium antivirus radio button under "Antivirus settings".
-
Enable selected antivirus for all mailboxes:
# plesk db -Ne"select concat(m.mail_name,'@',d.name) as email from mail as m left join domains as d on m.dom_id=d.id"| while read i; do plesk bin mail -u $i -antivirus inout; done
Note: to disable the selected antivirus for all mailboxes for execute the command below:
# plesk db -Ne"select concat(m.mail_name,'@',d.name) as email from mail as m left join domains as d on m.dom_id=d.id"| while read i; do plesk bin mail -u $i -antivirus off; done
Enable antivirus for newly created mailbox automatically (Linux)
For every newly created mailbox, the antivirus can be activated using Event Hadler feature:
-
Create a script
/root/handler.sh
with the following content:#!/bin/bash
plesk bin mail -u ${NEW_MAILNAME} -antivirus inout -
Grant execution permission to the script:
# chmod +x handler.sh
-
Go to Plesk > Tools & Settings > Event Manager
-
Click Add Event Handler.
-
Select the event Mail account created and specify the full path to the script in the Command field