If you take the "standard" ClamAV test executable (clam.exe), attach it
to an email (I'm using swaks for testing) and send it thru qpsmtpd, the
clamdscan plugin doesn't catch it.
If you take a copy of the generated email (full headers), OR the bare
executable, and run clamdscan (ClamAV command line program) directly on
it, it does detect.
If you take the body of the generated email (excluding headers) and run
clamdscan on it, it won't detect.
If you take a copy of the generated email, and include that as an
attachment (via swaks), the clamdscan plugin will catch it.
The clamdscan plugin only passes the body (no headers) to ClamAV.
So, I think the clamdscan plugin needs to pass the headers too.
Is there a quick way of doing this other than creating a new file,
writing header->as_string and the body before stuffing in the clamd socket?