Question
How to enable Sophos Antivirus for servers or Plesk Premium antivirus server-wide in Plesk?
Answer
Plesk for Windows
Purchase additional key for required antivirus.
Install Sophos Antivirus for servers 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 Sophos Antivirus for servers 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 Sophos Antivirus for servers 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 Sophos Antivirus for servers 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 Handler feature:
Create a script
/root/handler.shwith the following content:#!/bin/bash
plesk bin mail -u ${NEW_MAILNAME} -antivirus inoutGrant 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