Hi,
 I have found that adding clamav checking through maildrop is quite easy.
 It is so simple, that I would believe it might be useful for other people,
and so I am offering it to included in the clamav's contrib subdirectory.

 CLAMOUT=`/usr/local/bin/clamdscan  --stdout - 2>&1`
 log $CLAMOUT
 if ($RETURNCODE) {
 # A virus was found. You may, for example deliver the message to a special
"quarantine" account
 to "[EMAIL PROTECTED]"
 }
 else {
 # OK
 }

 There are several interesting points:
 1) In first line we use the clamdscan capability (not documented) to read
from stdin, and at the same time  there is no need to save stdin  to a
temporary file, as it turns out  that maildrop takes care of that.
 As compared with "clamassassin" utility, there is no need to call mktemp to
create a temporary file, and then remove it before exit.

 2) The second line logs the clamdscan output through maildrops log
statement, having all logs in a single file.

 3) In third line we see that maildrop also has saved for us  clamdscan's
return code!


 There is a small problem which I cannot explain, and I would ask your help
for:

 When the mail is OK, that gets logged at the maildrop logfile (but not in
clamd.conf LogFile, even when LogClean option is enabled )
 While when the mail has a virus, it is logged in clamd logfile but  NOT  in
maildrop logfile.

 Amazing!!!

 Thank you all.

 Julio Maidanik


_______________________________________________
http://lurker.clamav.net/list/clamav-users.html

Reply via email to