docs/man/clamav-milter.8
1125407a
 .TH "clamav-milter" "8" "March 23, 2004" "" "Clam AntiVirus"
59970c62
 .SH "NAME"
6ceae60d
 .LP
ead674a2
 clamav\-milter \- milter compatible mail scanner
59970c62
 .SH "SYNOPSIS"
6ceae60d
 .LP
59970c62
 clamav\-milter [options] socket_address
 .SH "DESCRIPTION"
6ceae60d
 .LP
432653f0
 Clamav\-milter is a filter for \fBsendmail(1)\fR mail server.
 It uses a mail scanning engine built into \fBclamd(8)\fR.
1adb647e
 .LP
432653f0
 Clamav\-milter can, when configured to use communicate to clamd on other
 machines, use load balancing and fault tolerant techniques to connect to
 more than one clamd and seemlessly hot swap to even the load between different
 servers and to keep scanning for viruses even when a server goes down.
ea512858
 When it is configured to use clamd on the the localhost, when
68e81e6a
 the \-\-external flag (see below) is not given or
ea512858
 LocalSocket in set in \fBclamd.conf(5)\fR,
432653f0
 clamav\-milter verifies that it can communicate with clamd; if it cannot, it
 terminates.
1adb647e
 .LP
 clamav\-milter supports tcpwrappers, the value for \fIdaemon_list\fR
 is "clamav\-milter".
f02c3c82
 .LP
 The socket_address argument is the socket used to communicate with
 \fBsendmail(8)\fR.
 It must agree with the entry in sendmail.cf or sendmail.mc.
 The file associated with the socket must be createable by clamav\-milter,
432653f0
 if the User option is set in clamd.conf,
f02c3c82
 then that user must have the rights to create the file.
59970c62
 .SH "OPTIONS"
6ceae60d
 .LP
59970c62
 
6ceae60d
 .TP
b61a0781
 \fB-a FROM, \-\-from<=EMAIL>\fR
4c875578
 Source email address of notices. The default is MAILER-DAEMON.
b61a0781
 If \fI=EMAIL\fR is not given, thus \-\-from, then the from address is set
 to the originating email address, however since it is likely that address is
 forged it must not be relied upon.
59970c62
 \fB\-h, \-\-help\fR
 Output the help information and exit.
d9b674b2
 .TP
 \fB\-H, \-\-headers\fR
 Include all headers in the content of emails generated by clamav\-milter.
cff14b86
 This is useful for system administrators who may want to look at headers
d9b674b2
 to check if any of their machines are infected.
6ceae60d
 .TP
59970c62
 \fB\-V, \-\-version\fR
 Print the version number and exit.
6ceae60d
 .TP
59970c62
 \fB\-c FILE, \-\-config\-file=FILE\fR
ead674a2
 By default clamav\-milter uses a default configuration file, this option allows you to specify another one.
9bff441d
 .TP
64bbd4ea
 \fB\-D, \-\-debug\fR
9bff441d
 Enables debugging.
6ceae60d
 .TP
59970c62
 \fB\-x n, \-\-debug\-level=n\fR
9bff441d
 Set the debug level to n (where n from [0..9]) if \fBclamav\-milter\fR was
a5a0857c
 configured and compiled with \-\-clamav-debug enabled.
9bff441d
 Will be replaced by \-\-debug for compatability with other programs in the
 suite.
6ceae60d
 .TP
ced83bee
 \fB-A, \-\-advisory\fR
 When in advisory mode, clamav\-milter flags emails with viruses but
 still forwards them. The default option is to stop viruses.
102dd6fa
 This mode is incompatible with \-\-quarantine and \-\-quarantine-dir.
ced83bee
 .TP
59970c62
 \fB\-b, \-\-bounce\fR
ead674a2
 Send a failure message to the sender, and to the postmaster.
 [ \fBWarning\fR: most viruses and worms
8ad6dd05
 fake their source address, so this option is not recommended ].
 See also \-\-noreject.
ead674a2
 .TP
e5bb3b37
 \fB\-B, \-\-broadcast[=<iface>]\fR
78a78fcc
 When a virus is intercepted, broadcast a UDP message to the TCPSocket port set
 in \fBclamd.conf\fR.
e5bb3b37
 If the optional \fIiface\fR option is given, broadcasts will be sent on
 that interface. The default is set by the opertating system, usually to the
 first NIC.
78a78fcc
 A future network management program (yet to be written) will intercept these
 broadcasts to raise a warning on the operator's desk.
 .TP
79f846a3
 \fB-C, \-\-dont-log-clean\fR
 Messages without viruses are usually logged if SysLog is set in
09b431f0
 \fBclamd.conf\fR since it gives a feel-good factor.
79f846a3
 This option turns that off.
 .TP
ead674a2
 \fB-d, \-\-dont-scan-on-error\fR
 If a system error occurs pass messages through unscanned,
 usually when a system error occurs the milter raises a temporary failure which
 generally causes the message to remain in the queue.
 .TP
 \fB-f, \-\-force-scan\fR
553eca1c
 Always scan, whereever the message came from (see also --local and --outgoing).
cff14b86
 You probably don't want this.
6ceae60d
 .TP
82a6ea6b
 \fB-e, \-\-external\fR
1b7a33ae
 Usually clamav\-milter scans the emails itself without the use of an
7ca2a6cf
 external program.
1b7a33ae
 The \-\-external option informs clamav\-milter to use an external program such
 as clamd(8) running either on the local server or other server(s) to perform
 the scanning.
ea512858
 The setting in clamd.conf for LocalSocket or TCPSocket is ignored.
ccf2bd40
 .TP
ead674a2
 \fB-l, \-\-local\fR
cff14b86
 Also scan messages sent from LAN. You probably want this especially if
 your LAN is populated by machines running Windows or DOS.
ead674a2
 .TP
 \fB-n, \-\-noxheader\fR
4c875578
 Usually clamav\-milter adds headings to messages that are scanned.
 The headers are of the form "X-Virus-Scanned: version",
 and "X-Virus-Status: clean/infected/not-scanned".
 This option instructs
ead674a2
 clamav\-milter to refrain from adding this heading.
8ad6dd05
 .TP
f9511084
 \fB-N, \-\-noreject\fR
8ad6dd05
 When clamav\-milter processes an e-mail which contains a virus it rejects
6ceae60d
 the e-mail by using the SMTP code 550 or 554 depending on the state machine.
 This option causes clamav\-milter to silently discard such messages.
cff14b86
 It is recommended that system administrators use this option when NOT using
6ceae60d
 the \-\-bounce option.
 .TP
ead674a2
 \fB-o, \-\-outgoing\fR
cff14b86
 Scan messages generated from this machine. You probably don't need this.
ead674a2
 .TP
679ff9e7
 \fB-i, \-\-pidfile=FILE\fR
 Notifies clamav\-milter to store its process ID in FILE.
 The file must be createable by clamav\-milter,
 if the User option is set in
09b431f0
 \fBclamd.conf(5)\fR,
679ff9e7
 then that user must have the rights to create the file.
 .TP
ead674a2
 \fB-p, \-\-postmaster=EMAILADDRESS\fR
8ad6dd05
 Sets the e-mail address to send notifications to when the \-\-quiet option
 is not given.
ead674a2
 .TP
 \fB-P, \-\-postmaster-only\fR
8b5e27e2
 When the \-\-quiet option is not given, send a notification to the postmaster.
8ad6dd05
 Setting this flag will include the ID of the message which can ease searching
 through system logs if the administrator believes it is a locally sourced
 virus.
ead674a2
 .TP
 \fB-q, \-\-quiet\fR
 Don't send any warning messages when a virus or worm or is detected.
 This option overrides the \-\-bounce and \-\-postmaster-only options, and is
 the way to turn off notification to the postmaster.
 .TP
 \fB-Q, \-\-quarantine=EMAILADDRESS\fR
 If this e-mail address is given, messages containing a virus or worm are
 redirected to it.
 .TP
 \fB-U, \-\-quarantine-dir=DIR\fR
 If this option is given, infected files are left in this directory.
79f846a3
 The directory must not be publically readable or writeable, if it is,
 clamav\-milter will issue an error and fail to start.
 \fBNote\fR - this option only works when using LocalSocket.
6ceae60d
 .TP
9bff441d
 \fB\-\-server=HOSTNAME/ADDRESS, \-s HOSTNAME/ADDRESS\fR
 IP address or hostname of server(s) running clamd (when using TCPsocket).
106cb83f
 More than one server may be specified, separating the server's names by colons.
1125407a
 If more than one server is specified, clamav\-milter will load balance
 between the available servers. All the servers must be up when clamav\-milter
 starts, however afterwards it is fault tolerant to a server becoming
 unavailable, and will only raise an error if all of the servers cannot be
 reached.
 The default value for ADDRESS is 127.0.0.1 (localhost).
ead674a2
 .TP
 \fB\-\-sign, \-S\fR
 Add a hard\-coded signature to each scanned file.
 .TP
 \fB\-\-signature-file, \-F\fR
 Location of file to be appended to each scanned message. Overrides \-S.
6ceae60d
 .TP
59970c62
 \fB\-\-max\-children=n, \-m n\fR
3a349ef6
 Set a hint of the maximum number of children. If the number is hit the
ad31761c
 maximum time a pending thread will be held up is set by \-\-timeout, so the
 number of threads can exceed this number for short periods of time.
ead674a2
 There is no default, if this argument is not \fBclamav\-milter\fR will
ad31761c
 spawn as many children as is necessary up to the MaxThreads limit set
09b431f0
 in \fBclamd.conf\fR.
68ccfa90
 When clamav\-milter has been built with SESSION mode this argument is
 mandatory since it tells clamav\-milter the number of sessions to keep open
 to clamd servers.
 When not built with in SESSION mode it is unlikely that you will need this
 unless your system is under great load.
371e0440
 Note, however, that the default build is for SESSION to be disabled.
3a349ef6
 .TP
ced83bee
 \fB\-\-dont\-wait\fR
 Tells clamav\-milter what do to if the max-children number is exceeded.
68ccfa90
 Usually clamav\-milter waits until a child dies or the timeout value has been
ced83bee
 exceeded, which ever comes first, however with dont-wait enabled, clamav\-milter
 will inform the remote SMTP client to retry later.
 .TP
1392cf22
 \fB\-\-template\-file=file \-t file\fR
a861e96c
 File points to a file whose contents is sent as the warning message whenever a
 virus is intercepted.
6d113e37
 Occurances of %v within the file is replaced with the message
1392cf22
 returned from clamd, which includes the name of the virus.
2a0313f5
 Occurances of %h are replaced with the message's headers.
6d113e37
 The %v string can be escaped thus, \\%v, to send the string %v.
2a0313f5
 The % character can be escaped thus, %%, to send the % character.
6d113e37
 Any occurance of strings in dollar signs are replaced with the appropriate
 sendmail-variable, e.g. ${if_addr}$.
a861e96c
 If the \-t option is not given, clamav\-milter defaults to a hardcoded message.
01e025f7
 Note that to send warning messages, clamav\-milter must be able to execute
 sendmail.
ad31761c
 .TP
 \fB\-\-timeout=n \-T n\fR
 Used in conjuction with max\-children. If clamav\-milter waits for more than
cf6c41b7
 \fIn\fR seconds (default 0) it proceeds with scanning. Setting \fIn\fR to zero
ad31761c
 will turn off the timeout and clamav\-milter will wait indefinately for the
 scanning to quit. In practice the timeout set by sendmail will then take over.
ad5eb067
 .TP
 \fB\-\-detect-forged-local-address \-L\fR
 When neither \-\-force, \-\-local nor \-\-outgoing is given,
 this option intercepts incoming mails that incorrectly claim to be from the
 local domain.
a87be00b
 .TP
 \fB\-\-whitelist-file=FILE, \-W file
 This option specifies a file which contains a list of e-mail addresses.
 E-mails sent to these addresses will NOT be checked.
ad5eb067
 While this is not an Anti-Virus function, it is quite useful for some systems.
a87be00b
 The address given to the \-\-quarantine directive is always whitelisted.
 .TP
 \fB\-\-sendmail-cf=FILE
 When starting, clamav\-milter runs some sanity checks against the sendmail.cf
 file, usually in /etc/sendmail.cf or /etc/mail/sendmail.cf. This directive
 tells clamav\-milter where to find the sendmail.cf file.
ced83bee
 .SH "BUGS"
 There is no support for IPv6.
59970c62
 .SH "EXAMPLES"
6ceae60d
 .LP
60252f26
 clamav\-milter \-o local:/var/run/clamav/clmilter.sock
59970c62
 .SH "AUTHOR"
6ceae60d
 .LP
78a78fcc
 Nigel Horne <njh@bandsman.co.uk>
59970c62
 .SH "SEE ALSO"
6ceae60d
 .LP
432653f0
 sendmail(1), clamd(8), clamscan(1), freshclam(1), sigtool(1), clamd.conf(5), hosts_access(5)