Plesk

How to install and manage Spam filter and Antivirus server-wide in Plesk?

Question

How to enable Kaspersky Antivirus or Plesk Premium antivirus server-wide in Plesk?

Answer

Plesk for Windows

  1. Purchase additional key for required antivirus.

  2. Log in to Plesk.

  3. Install the Kaspersky Antivirus or Plesk Premium antivirus component.

  4. Install the license key at Tools & Settings > License Management > Additional License Keys.

  5. Go to Tools & Settings > Mail Server Settings > Settings and select Kaspersky AntiVirus or Plesk Premium antivirus radio button under Antivirus settings.

  6. 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

  1. Purchase additional key for required antivirus.

  2. Log in to Plesk.

  3. Install the Kaspersky Antivirus or Plesk Premium antivirus component.

  4. Install the license key at Tools & Settings > License Management Additional License Keys.

  5. Go to Tools & Settings > Mail Server Settings > Settings and select Kaspersky AntiVirus or Plesk Premium antivirus radio button under "Antivirus settings".

  6. Log on to the server via SSH.

  7. 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:

  1.  Log on to the server via SSH

  2. Create a script /root/handler.sh with the following content:

    #!/bin/bash
    plesk bin mail -u ${NEW_MAILNAME} -antivirus inout

  3. Grant execution permission to the script:

    # chmod +x handler.sh

  4. Go to Plesk > Tools & Settings > Event Manager

  5. Click Add Event Handler.

  6. Select the event Mail account created and specify the full path to the script in the Command field