.\" $Id: avcheck.1,v 1.4 2002/10/09 22:07:59 mjt Exp $ .\" manpage for avcheck program .\" Michael Tokarev .\" Public domain .TH avcheck 1 .SH NAME avcheck \- antivirus daemon client for mail system .SH SYNOPSYS .B avcheck .I options \-\- .I recipient... .SH DESCRIPTION .B avcheck reads a mail message from standard input, saves it to a temporary file, and then asks the running antivirus daemon to check this file for viruses. If no viruses are found, \fBavcheck\fR optionally reinjects message back into mail system for further delivery. If the antivirus software claims that message contains some virus\-infected file or such, \fBavcheck\fR will call another program to handle this message and take appropriate actions. In case of any error (except of incorrect usage/options), \fBavcheck\fR will exit with EX_TEMPFAIL exit code, so that further "delivery" attempt will be attempted again later, thus allowing to correct that error. Typically, \fBavcheck\fR is used as a part of mail subsystem to scan mail messages before further delivery. The "idea" behind this simple program is as follows: Mail messages are received by a mail system, queued, and then passed to \fBavcheck\fR for inspection. If a message passes the antivirus check, then it will be routed using normal MTA mechanisms, either by reinjecting (requeuing) back into that same mail subsystem (or other a subsystem on another host etc), or by continuing without reinjecting. Or, if the antivirus software detects a virus, control will be passed to an administrator\-defined handler that will send virus\-alert messages to administrator, sender or recipients, places the message into quarantine folder for further examination etc. Note that \fBavcheck\fR is \fInot\fR a virusscanner, but antivirus client: it can't work without a supported antivirus daemon. The antivirus daemon should be able to handle MIME structure, attachtments, archives and so on, since \fBavcheck\fR itself doesn't contain any code for these tasks. .SH OPTIONS .IP "\-f \fIfrom\fR (required)" specify envelope from (sender) address of a mail message .IP "\-s \fIavtype\fR[:\fIavsocket\fR] (required)" specifies antivirus daemon product to use and a path for it's control socket. Currently, only antivirus products from the following vendors are supported: .nf \fBAVP\fR, www.kaspersky\-labs.com \fBDrWeb\fR, www.sald.com .fi \fIavsocket\fR may be a pathname to Unix\-domain socket, or \fIhost\fR:\fIport\fR for a TCP connection. In latter case, host part may be omitted and defaults to 127.0.0.1. \fIavsocket\fR may be omitted, default is antivirus\-dependant. .IP "\-d \fItmpdir\fR (required)" specify a temporary directory where the message will be stored for inspection by the antivirus daemon. Do NOT use /tmp, /var/tmp and other public\-accessable directory here, but create one especially dedicated for mail antivirus scanning, and give it appropriate, restrictive permissions. If \fItmpdir\fR contains "/./" component, e.g. /var/avscan/./tmp, then \fBavcheck\fR assumes that antivirus daemon is chrooted in /var/avscan, and filename will be translated accordingly before being sent to antivirus daemon. .IP "\-t \fItimeout\fR" set timeout in secounds to wait for answer from the antivirus daemon. If the answer will not be available after this time, \fBavcheck\fR will exit with EX_TEMPFAIL error code. By default, \fBavcheck\fR will not restrict time it waits for an answer. .IP "\-n" do not reinject good message back into mail subsystem (by default, \fBavcheck\fR will do so). .IP "\-g \fIokcode\fR" exit with \fIokcode\fR (default 0) when no viruses found. Useful with conjunction with -n and an MTA which will continue normal delivery when AV inspector returns this exit code. .IP "\-S \fIsendmail\fR" specifies path to sendmail\-compatible program that will be used for message re\-injection (unless \-n option given). May be a pathname (starting with slash character), or \fIhost\fR:\fIport\fR to use (subset of) SMTP. Default is 127.0.0.1:smtp, i.e. \fBavcheck\fR will attempt to talk SMTP with localhost using the standard smtp port. In case of SMTP (\fIhost\fR:\fIport\fR form), either \fIhost\fR or \fIport\fR part may be omitted and defaults to 127.0.0.1 and 25). Note that \fBavcheck\fR's SMTP implementation does not permit multiline responses from SMTP server, and the ESMTP protocol is not supported. When given a path to local program, this program should be compatible with \fBsendmail\fR(1). In particular, \fB\-f\fR option (specifying envelope from address) should be supported, and this program is expected to send a mail message given on standard input to a list of recipients specified in command line. In order to specify additional arguments for this external program (for Sendmail, it may be useful to specify \-p\fIpoto\fR option, for example), \fB\-S\fR option may be repeated with all needed arguments, or one can specify multiword value for \fB\-S\fR option. For example, to specify .br /usr/sbin/sendmail \-p AVSCAN .br as a sendmail program, one may use either .br \fBavcheck\fR \-S "/usr/sbin/sendmail \-p AVSCAN" .br or .br \fBavcheck\fR \-S /usr/sbin/sendmail \-S \-p \-S AVSCAN .br or .br \fBavcheck\fR \-S /usr/sbin/sendmail \-S "\-p AVSCAN" .br and so on. When using Sendmail\-compatible program, do not forget to specify \-i option for it (use \fBavcheck\fR \-S /usr/sbin/sendmail \-S \-i), to stop sendmail from treating a line consisting of one dot character (.) as end of a message. Note that the flow path used for further delivery as specified by this \-S option should not include \fBavcheck\fR again, or else the mail will loop. The mail system should assume that mails injected by this method are already safe from an antivirus point of view. .IP "\-h \fIhdr\fR" Prepend the .br \fBX\-AV\-Checked: