I don't have them running on the same machine at the moment, so I can't run a proper test, but like many programs clamscan should understand '-' as scanning its standard input.
I tried using cat and head as a test on my OpenBSD machine:
Code:
& pi 1 cat
... output for message number 1 ...
& pi 1 head -n 3
Referencing before 1
& pi 1 /tmp/filterscript
... top 3 lines of message number 1 ...
The test was done using the mailx util on an OpenBSD 4.4-release box. Perhaps nailx/heirloom mailx may be different (or I'm just being stupid) but it seems to have an issue about executing a command > 1 word. If needed you can always create a filter script to supply any needed arguments to clamscan.
__________________
My
Journal
Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.