On Sun, 27 Feb 2005 08:29:42 -0500
John Peacock <[EMAIL PROTECTED]> wrote:

> Since I can't leave well enough alone, I have started to write a new
> clamav  plugin along the following lines:
[...]
> 2) directly call clamd on the temporary files that qpsmtpd already
>  has
> (to save  writing out a copy of the file body).

> The second change is giving me other issues.  libclamav uses
> heuristics to  determine what type of file is being scanned, and then
> calls the appropriate  code.  Unfortunately, the temporary files which
> qpsmtpd creates in the spooldir  contain only the MIME body, and
> libclamav doesn't recognize the file as  containing any content (and
> thus doesn't scan it at all).
Why you don't write the headers to the temp file when the body starts
and modify Qpsmtpd::Transaction::body_resetpos() to seek to the
beginning of the body (i.e. length($transaction->header->as_string)+1).
Then there's a full mail in the temp file like clamav (and maybe other
scanners) want it.

        Hanno

Reply via email to