SMTP-VILTER.CONF(5)

NAME
smtp-vilter.conf - smtp-vilter configuration file

SYNOPSIS
smtp-vilter.conf

DESCRIPTION
The operational mode and behaviour of the smtp-vilter content filter for sendmail is defined in smtp-vilter.conf.

SYNTAX
Empty lines and lines beginning with # are ignored. All definitions are assignments to identifiers using name/value pairs separated by an equal sign like "name=value". Some identifiers must only be given once others may appear repeatedly (e.g. "option").

OPERATION

tmpdir=<path>
Define the location for temporary directories.

log-facility=<facility>
The log-facility determines the log facility used for syslog(3). It can be one of the following values: user, daemon, mail, local0, local1, local2, local3, local4, local5, local6, local7

logfile=<path>
Specify a filename for extended logging. You to specify what gets logged using an option directive. See below.

statfile=<path>
Specify a filename for writing statistics to.

interval=<seconds>
Automatically dump statistics every <seconds> seconds.

SECURITY

user=<username>
Define the user to run as. To change the uid requires smtp-vilter to be started as root.

group=<groupname>
Define the group to run as

chroot=<path>
Define a chroot jail. This directory must contain a subdirectory named tmp for temporary data, a directory run for runtime information like the the socket to communicate with sendmail and a directory etc for config files and a file etc/hosts which has the same syntax and semantics as /etc/hosts to resolve the hostname given in the config file.

tmpfiles=<option>
Define options for temporary files. Possible values are:

g+r
If the temporary files created by smtp-vilter should be made group readable (e.g. because both smtp-vilter and the actual scanning engine run with the same group id but different user ids) set "tmpfiles=g+r"

setgrp
If the group ownership of temporary files should be explicitely set to the group id smtp-vilter runs as, set "tmpfiles=setgrp"

BACKENDS

backend=<backend[[,backend]...]>
Define the virus or spam scanning backend to use. More than one backend can be specified.

Possible backends are:

vilter-clamd
Clam AntiVirus clamd daemon

vilter-spamd
Spamassassin spamd

vilter-attachment
Scan for unwanted attachment types based on the filename pattern

backend-path=<path>
Define the path from where backend are loaded.

BACKEND-CONFIGURATION

config-file=<backend>:<config-file>
Define the filename path to the configuration file for backend <backend>. Note that this command must be preceeded by the backend command.

header-options=<header-options>
Control various features of the artifical header used to forward messages to a spam detection backend. Note that this header is entirely internal and is NOT visible to the MTA or the end recipient.

At present there is only one option, which is to indicate the sender's SASL authentication status as reported by the MTA:

header-options=0
ignore SASL authentication status (default)

header-options=1
if the sender successfully signed in then insert a tag of the form "(Authenticated sender: user@domain)" in the received header.

The latter behaviour emulates Postfix's "smtpd_sasl_authenticated_header" option, and enables a (suitably configured) spam detection backend to apply different rules for trusted senders.

STRATEGIES

virus-strategy=<strategy>
Define a strategy in case an e-mail message is infected with a virus.

Possible virus-strategies are:

discard
Silently discard the message.

reject
Reject the message.

mark
Mark the message with X-SMTP-Vilter headers as infected but deliver it anyway.

notify-recipient
Notify the recipient of the e-mail that the message had been discarded because it contained a virus.

recipient-notification=<path>
If the strategy is notify-recipient the default message can be overriden by indicating a path to a file containing a custom message with recipient-notification.

notify-only=<pattern>
A hack: If the following field is present, only recipients that contain the given value in the envelope to field are sent a notification message. The comparison is done using strchr(3), so this is really a hack only...

spam-strategy=<strategy>
Define a strategy in case an e-mail message is considered spam,

Possible spam-strategies are:

discard
Silently discard the message

reject
Reject the message

mark
Mark the message with X-SMTP-Vilter headers as spam but deliver it anyway

spam-subject-prefix=<prefix>
Define a prefix that is put in front of the Subject-line of spam messages.

spam-header=<header>
Define an additional header added to spam mails.

unwanted-strategy=<strategy>
Define a strategy in case an e-mail message contains unwanted content.

Possible unwanted-strategies are:

discard
Silently discard the message.

reject
Reject the message.

mark
Mark the message with X-SMTP-Vilter headers as unwanted but deliver it anyway.

notify-recipient
Notify the recipient of the e-mail that the message had been discarded because it contained unwanted content.

error-strategy=<strategy>
Define a strategy in case the backend can not perform the actual scanning due to some error.

Possible error-strategies are:

discard
Silently discard the message.

mark
Mark the message with X-SMTP-Vilter headers as unchecked but deliver it anyway.

tempfail
Return a temporary failure to the sender, i.e. a SMTP "try again later error".

INTERFACING SENDMAIL

port=<portspec>
Define the socket over which smtp-vilter communicates with sendmail. Use the same syntax as in the sendmail.cf file, e.g. "unix:/var/run/smtp-vilter.sock".

OPTIONS

option=<option>
Define optional settings.

Currently, only one four setting are defined:

markall
Mark all messages, even those that are not infected

logvirus
If extended logging is enabled (by setting a logfile) then virus incidents are logged.

logspam
If extended logging is enabled then spam incidents are logged.

logunwanted
If extended logging is enables then unwanted content incidents are logged.

logall
Log clean mails as well.

FILES
/etc/smtp-vilter.conf
    Default location of the configuration file
/etc/hosts
    Host name database

EXAMPLES

    # smtp-vilter configuration
    #
    # Run as user _vilter and group _vilter (these must, of course, exist.)
    user=_vilter
    group=_vilter
    # Run smtp-vilter chrooted in /var/smtp-vilter.
    chroot=/var/smtp-vilter
    # The temporary files created by smtp-vilter should be made group
    # readable (because both smtp-vilter and the actual scanning
    # engine run with the same group id but different user ids.)
    tmpfiles=g+r
    # The group ownership of temporary files will be set
    # to the group id smtp-vilter runs as, i.e. _vilter.
    tmpfiles=setgrp
    # Backends are loaded from /usr/local/lib/smtp-vilter (which is the
    # default location)
    backend-path=/usr/local/lib/smtp-vilter
    # We chain a virus scanner and a spam scanner.  We use ClamAV
    # and Spamassassin.
    backend=clamd,spamd,attachment
    # Define config files for the various backend (btw, these are the
    # default values)
    config-file=clamd:/etc/smtp-vilter/clamd.conf
    config-file=spamd:/etc/smtp-vilter/spamd.conf
    config-file=attachment:/etc/smtp-vilter/attachment.conf
    # In case an e-mail message is infected with a virus, we notify
    # the recipient of the fact with a custom message.  Pay attention
    # to the path:  Because we run chrooted in /var/smtp-vilter, the
    # file must actually be stored in
    # /var/smtp-vilter/etc/srecipient-notification.  For some reason
    # we only notify recipients in the etc.msys.ch domain.
    virus-strategy=notify-recipient
    recipient-notification=/etc/recipient-notification
    notify-only=etc.msys.ch
    # In case an e-mail message is considered spam we mark it as such.
    spam-strategy=mark
    # For mailers that can not filter on message headers we change the
    # subject line of spam mails by prefixing it with [SPAM].
    spam-subject-prefix="[SPAM]"
    # Additional header added to spam mails
    spam-header="X-Its-A-Nuisance: This is SPAM"
    # In case the backend can not perform the actual scanning due to
    # some error we let sendmail temporarily fail the message.
    error-strategy=tempfail
    # In this example, smtp-vilter communicates with sendmail over
    # a local socket.
    port=unix:/var/run/smtp-vilter.sock
    # Define the path to a directory for temporary files
    # This will be below the chroot path.
    tmpdir=/tmp
    # We log to the system mail log and to a file (extended logging)
    log-facility=mail
    logfile=/var/log/smtp-vilter.log
    # We log all incidents, even clean emails
    option=logvirus
    option=logspam
    option=logunwanted
    option=logall
    # Here, we mark all messages, infected or not.
    option=markall

SEE ALSO
smtp-vilter(8)