Manual integration with the Amavis interface

July 4, 2024

ID 62460

To integrate Kaspersky Security 8 for Linux Mail Server with Amavis manually:

  1. Add the kluser user to the amavis group (or to the group specified via the $daemon_group parameter of /etc/amavisd.conf) with the following command:

    gpasswd -a kluser amavis

  2. Add the account of the amavis user (or user specified in the $daemon_user setting of the amavisd.conf configuration file (hereinafter /etc/amavis.conf)) to the klusers user group using the following command:

    gpasswd -a amavis klusers

  3. Open the amavisd file (hereinafter referred to as /usr/sbin/amavisd).
  4. Comment out the following lines to the @spam_scanners section:

    @spam_scanners = (

    #['SpamdClient', 'Amavis::SpamControl::SpamdClient' ],

  5. Under the SUSE Linux 11 SP2 operating system, add the kluser account to the vscan user group. The vscan user group should be the primary group for the kluser account.
  6. Under the SUSE Linux 11 SP2 operating system, add the vscan account to the klusers user group. The klusers user group should be the primary group for the vscan account.
  7. Specify the rds_asp socket, where the KLRDS task is listening for incoming messages, in the following lines of the /usr/sbin/amavisd file for SpamdClient Perl module:

    package Amavis::SpamControl::SpamdClient ...

    my($spamd_handle) = Amavis::IO::RW->new(

    [ '/var/run/klms/rds_asp' ], Eol => "\015\012", Timeout => 30);

  8. Open the amavisd.conf configuration file (hereinafter – /etc/amavisd.conf) for editing.
  9. Make the following changes to the @av_scanners and @spam_scanners sections of the opened file:

    @av_scanners = (

    ['Kaspersky Security 8.0 for Linux Mail Server',

    \&ask_daemon, ["nCONTSCAN {}\n", "/var/run/klms/rds_av"],

    qr/\bOK$/m, qr/\bFOUND$/m,

    qr/^.*?: (?!Infected Archive)(.*) FOUND$/m ], ); ...

    @spam_scanners = (

    ['SpamdClient', 'Amavis::SpamControl::SpamdClient' ], );

  10. We recommend setting a 1500 KB limit on the maximum message size when using the Anti-Spam scan. To do so, set the following value in this string:

    $sa_mail_body_size_limit = 1500000;

  11. Restart the amavisd using the following command:

    /etc/init.d/amavisd restart

During integration with the Amavis interface, you can specify the settings of Kaspersky Security 8 for Linux Mail Server only using the command line. Settings specified using the web interface of Kaspersky Security 8 for Linux Mail Server (such as the response timeout when attempting to connect to KSN) will not apply.

');
Kaspersky Endpoint Security for Business Advanced: Adaptive security of your company
Web and device controls. Data encryption. Centralized and convenient management from a single console.
');
Kaspersky Premium Support (MSA): High‑priority incident processing
Telephone and web ticket support. Fast response, monitoring and health check. Submit a request and activate the contract (MSA).