$Id: README.Sendmail,v 1.5 2002/06/17 18:26:42 mjt Exp $

PRELIMINARY VERSION.

This file gives some notes on setting up avcheck together with
Sendmail.  Note that I have no Sendmail around, so I can't verify
or test this information.

Please note that this configuration, avcheck+sendmail, is
UNSUPPORTED entirely.  Sendmail has milter interface that
should be used instead, and avcheck has no support for it
(yet).

The method described does not uses Sendmail's milter interface,
only sendmail.cf editing is required.

The idea is:

 Every mail received by sendmail "delivered" (passed) to a special
 mailer `avcheck' (defined in sendmail.cf) instead of being sent
 to original destination.

 Via this mailer, avcheck command gets called to check mail for
 viruses.

 If avcheck found no viruses, it then reinjects mail back into
 Sendmail, marking it as "done checking".  This is done by using
 special Sendmail "entry point" -- either using special protocol
 name (calling sendmail with -p option), or via standard SMTP port
 but using one of "trusted" client addresses.

 Mail injected by the above methods should be delivered normally,
 without being passed back into avcheck.  This is done using
 some (minor) sendmail.cf tweaks.

Here are .m4 marcos that may be used to build sendmail.cf file.

First, simplest method, injecting mail back to Sendmail using
sendmail command-line utility.

===cut===

define(`AVPATH',`/var/spool/avp')dnl
define(`AVARGS',`AVPATH/avcheck -f $f -S/usr/sbin/sendmail -S-pAVCHECK -S-i -dAVPATH/tst -sAVP:AVPATH/./ctl/AvpCtl -- $u')dnl
Mavcheck, P=AVPATH/avcheck, F=DFMhudm,
 S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, U=avclient,
 A=AVARGS

LOCAL_CONFIG
D{AVCHK} AVCHECK
C{AVCHECK} ${AVCHK}

LOCAL_RULE_0

# add a name of protocol used
R $* < @ $+ . > $*			$: $1 < @ $2 . $&r . > $3

# pass anything that doesn't come with AVCHECK protocol to avcheck
R $* < @ $+ . $~{AVCHECK} . > $*	$# avcheck $@ check $: $1 < @ $2 > $4
R $* < @ $+ . . > $*			$# avcheck $@ check $: $1 < @ $2 > $3

# remove protocol name
R $* < @ $+ . $={AVCHECK} . > $*		$: $1 < @ $2 . > $4

===cut===

This way, avcheck will scan mails for viruses and then will
call "/usr/sbin/sendmail -pAVCHECK -i" to resubmit it back into
Sendmail.  When a mail submitted this way will be handled by
Sendmail, it will have $r=AVCHECK, and will not be scanned again.


