Antivirus for sendmail
Petr Rehor

INTRODUCTION

This patch was developed on FreeBSD/sendmail and employs an antivirus program AntiViral Toolkit Pro for Unix.

It can be used under every system, when Avp for Unix or other antivirus programs run. If other antivirus program is used, you can use only the Antivirus.Scanner option, because AvpDaemon has proprietary communication protocol. Antivirus program must return zero for successful antivirus check, and non-zero value for any other event. Antivirus program must be able to process check of mail body (UUENCODE, MIME, archived and compressed attachments). Output of antivirus program is appended to response mail if viruses were detected.

HISTORY

ANTIVIRAL TOOLKIT PRO FOR UNIX

Avp for FreeBSD or Linux from Kaspersky Lab contain three components:

HOW IT WORKS

Antivirus check is performed in checkcompat(envelope, to) function in src/conf.c. This function is called for each recipients of each mail.

First, Antivirus.Daemon or Antivirus.Scanner scans mail. It returns EX_OK for successful check, EX_DATAERROR if virus is found, or EX_TEMPFAIL for any fail.

Result of antivirus check is stored in sendmail's internal mail envelope. When mail has a multiple recipients or is processed from the queue, the cached information is used instead of the again run of antivirus scanner for the same mail.

If a virus is found, the mail without its body is returned to the sender, and the event is written to the syslog. Also the postmaster and recipients can be notified. The returned mailcontains verbose output of antivirus scanner about the type of virus.

In the case of fail this event is written to the syslog and mail is deferred. It is processed from the queue until fail is over or mail is returned as undeliverable. If confCOPY_ERRORS_TO is defined in sendmail.mc, the postmaster will be notified too.

INSTALLATION

Installation instructions for sendmail:

Installation instructions for Avp on FreeBSD:

CONFIGURATION

WARNING: When antivirus options are configured in /etc/mail/sendmail.cf, then non-patched sendmail can't be run.

Configure your sendmail:

Configuration options:

Customize virus alert information text:

LICENSING

This code is Copyright © Petr Rehor, 1999, 2000, 2001. I reserve all rights to this code and accompanying files. Since this code is closely tied to sendmail, its licensing policies are the same as for sendmail. See the sendmail's LICENSE.

DISCLAIMER/LIMITATION OF LIABILITY

THIS SOFTWARE IS PROVIDED BY PETR REHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PETR REHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

RELATED LINKS

CONTACT INFO

See How to reach me.

Home, Top


Last updated on Mon May 30 21:27:39 UTC 2005