On Thu, Jan 13, 2005 at 11:12:48PM +0100, Joerg Mertin wrote:
>
> I'm using a script anomy-filter.sh - that basically handles sanitizer.pl
> and pipes it then to formail:
>
>
> cat /dev/null > /var/spool/anomy/virus_scan.tmp
>
> cat | $SPAMC -f -u filter 2>/dev/null \
> | $ANOMY/bin/sanitizer.pl $ANOMY_CONF 2>>$ANOMY_LOG \
> | /usr/bin/formail -a "X-Antivirus:`/bin/cat \
> /var/spool/anomy/virus_scan.tmp`" - \
> | $SENDMAIL "$@" || \
> { echo Message content rejected; exit $EX_UNAVAILABLE; }
>
> The virus is found by sending the mail - but the X-Antivirus: header stays
> blank ...
you need to do it in 2 steps, save the output from sanitizer in a safe
tempfile, then feed it to formail; if you have tempfs mounted, you can
spool both virus_scan.tmp and eg `tempfile -m 600 -d /dev/shm -p msg-`
into /dev/shm, if you have enough RAM. That would be pretty fast.