To use the "before-queue" integration method, you have to specify that dlfunc support is required when compiling the corresponding dynamic library from the source code. Repositories of some Linux distributions contain compiled Exim versions already, in other cases manual compiling is required.
In case of manual compilation, you have to add the following lines to Makefile:
EXPAND_DLFUNC=yes
EXTRALIBS= -export-dynamic
When before-queue integration via a dynamic library is used, the filter must transfer messages for scanning to ScanLogic through ServiceSocket
. This socket must be specified in the configuration of the program.
Depending upon the specific distribution of the operating system, you have to modify one or several configuration files of the Exim mail server. For example, in Debian and Ubuntu, the Exim mail server configuration may consist of several files in the /etc/exim/conf.d directory or a single file only.
To perform before-queue integration of Kaspersky Security 8 for Linux Mail Server with Exim using a dynamically loaded library:
exim -bV
command.The following represents a positive result: Expand_dlfunc
.
acl_smtp_data
. To do that, find in the Exim configuration file(s) the line that looks like:acl_smtp_data = acl_check_data
(the line may contain another access control list instead of acl_check_data
)
and after the line
acl_check_data:
(or line containing another access control list)
add the following lines:
#klms-filter-begin
warn set acl_m_klms_headers =
set acl_m_klms_result =
set acl_m_klms_answer = ${dlfunc{
LIBDIR/libklms-exim.so}{scan}{${spool_directory}/input}}
defer condition = ${if eq {$acl_m_klms_answer}{}{yes}{no}}
log_message = LMS check failed (empty answer)
message = Temporary local problem - please try later
defer condition = ${if match {$acl_m_klms_answer}{\N^451\N}{yes}{no}}
log_message = LMS check defer: ${if match {$acl_m_klms_answer} \
{\N^451 Mail processing aborted(.+\n?.*\n)*$\N}{$1}{}}\\
${if eq {$acl_m_klms_result}{}{}{, result is \
'$acl_m_klms_result\'}}\
, temporary file $acl_m_klms_tempfile
message = Temporary local problem - please try later
defer condition = ${if match {$acl_m_klms_answer}{\N^452\N}{yes}{no}}
log_message = LMS check defer: ${if match{$acl_m_klms_answer} \
{\N^451 Mail processing timed out(.+\n?.*\n)*$\N}{$1}{}}\
${if eq {$acl_m_klms_result}{}{}{, result is \
'$acl_m_klms_result\'}}\
, temporary file $acl_m_klms_tempfile
message = Temporary local problem - please try later
deny condition = ${if match {$acl_m_klms_answer}{\N^550\N}{yes}{no}}
log_message = LMS check reject: ${if match {$acl_m_klms_answer} \
{\N^550 Rejected by malware filter(.+\n?.*\n)*$\N}{$1}{}}\
${if eq {$acl_m_klms_result}{}{}{, result is \
'$acl_m_klms_result\'}}\
, temporary file $acl_m_klms_tempfile
deny condition = ${if match {$acl_m_klms_answer}{\N^554\N}{yes}{no}}
log_message = LMS check reject: ${if match {$acl_m_klms_answer} \
{\N^554 Mail processing failed(.+\n?.*\n)*$\N}{$1}{}}\
${if eq {$acl_m_klms_result}{}{}{, result is \
'$acl_m_klms_result\'}}\
, temporary file $acl_m_klms_tempfile
message = ${if match {$acl_m_klms_answer} \
{\N^554 Mail processing failed(.+\n?.*\n)*$\N} \
{Mail processing failed:$1}{}}
warn condition = ${if match {$acl_m_klms_answer}{\N^250\N}{yes}{no}}
logwrite = LMS check accept: ${if match {$acl_m_klms_answer} \
{\N^250 (.+)$\N}{$1}{}} \
${if eq {$acl_m_klms_result}{}{}{, result is \
'$acl_m_klms_result\'}}
set acl_m_klms_answer =
warn condition = ${if eq {$acl_m_klms_answer}{}{no}{yes}}
logwrite = LMS check: $acl_m_klms_answer
#klms-filter-end
where LIBDIR – path to the libklms-exim.so library:
.so
module according to the settings of your operating system (optional).kluser
to the group to which the exim
process belongs. [global]
section, set the false
value for the header-guard
setting of the klms_filter.conf filter settings file.EXIM_INTEGRATION_TYPE=dlfunc
The Kaspersky Security 8 for Linux Mail Server installation package contains the compiled dynamically loaded library dlfunc for all operating systems supported by the program. The source files required for the dlfunc library are located in the directory /opt/kaspersky/klms/share/src/dlfunc (under Linux) or /usr/local/share/klms/src/dlfunc (under FreeBSD).
In some cases, manual compilation is required.
To perform a manual compilation of the dynamically loaded dlfunc library:
./configure --with-exim=<path to exim headers> --with-boost=<path to boost> --with-libevent=<path to libevent>.
# make
.The libklms-exim.so file appears in the current folder.
Page top