I'm using ClamAV, communicating via a Unix socket a la https://github.com/Elycin/php-clamav/. All working so far.
My app picks up files from a folder. Each file contains RFC822-compliant content (sometimes you see these with extension .eml).
I was going to write code to unpack the .eml file into separate body text and multiple attachment(s). However a quick test showed that if I just write the whole .eml file to the clamd
socket, e.g. the EICAR test file as an attachment, clamd
scans and reports the "infected" file.
I was wondering if this can be relied upon, i.e. does clamd always unpack and check embedded MIME-part email attachments thoroughly, or did I just "get lucky" with my tests? I don't want to trust to luck.
I think I answered my own question. Documentation https://github.com/Cisco-Talos/clamav-faq states
and
[Libclamav is used by clamd].