[Avcheck] avcache announcement

Michael Tokarev mjt@tls.msk.ru
Thu, 14 Mar 2002 19:24:03 +0300


Ralf Hildebrandt wrote:
> 
[]
> On a mailserver, we want to prevent large writes! We have CPU in
> abundance.

So why bother about multiple scanning of the same msg at all? :)

Well, if most majority of your mail are for multiple recipients,
checksuming will surely help.  But if not, it will slow down the
whole process.

Ok, the only way to figure this out is to see the process in action.
Ralf, I suggest you to modify avcheck for this.  In main() routine,
near the place where avcheck saves the temp file (near the line
#ifdef VERY_PARANOID/err(0, "BUGGY antivirus..."), just add the following:

  mmap(msgfd)
  find first "\n\n"
  md5sum all the rest
  munmap()
  check the cache

and bypass call to antivirus for known body several lines after.

this will be a hack, but it will allow to see if it will help you
or not.  Latter it may be rewritten more appropriately (interesting,
if md5sum(mmap()) is better compared to md5upd(chunk) for every chunk
read from file).

> We would only use the body for the md5 sum, and remove the headers
> (except for the content type header)

It's sufficient to checksum all after first empty line.  No headers
are necessary at all.