[Avcheck] Announce: avcheck-0.91
Michael Tokarev
mjt@tls.msk.ru
Sun, 13 Oct 2002 19:02:28 +0400
Ralf Hildebrandt wrote:
[]
> I've got a wish for the infected script:
> We use "always_bcc = copymail" to backup mail. But since always_bcc
> adds copymail to the recipients, the virus message always contains:
>
> original_recipient, copymail
>
> which is not what we want :)
>
There are several possible ways to resolve this:
a) in case of "traditional" content_filter, when all good mails are
reinjected back to postfix, set always_bcc *only* for smtpd that
is used by avcheck to reinject good mails back. I.e., add additional
address for good mails only.
b) by modifying `infected' handler so it will strip one configured address
from a list of rcpts, as you proposed. Note please that it's not
guaranteed to be present for any given invocation of content filter
(think of <filter>_destination_recipient_limit).
I'd use the first variant. For second one, there is no safe way to
implement this using standard Bourne shell (but bash and ksh should
be ok), and this is why I don't think it's ok to add this feature
directly to the "default" `infected' handler. Here is an example
code to implement this using bash features (untested - I'm writing
this right in this email w/o an attempt to execute):
rcpts=()
for rcpt; do
case "$rcpt" in
some@domain.tld) ;;
*) rcpts[${#rcpts[@]}]="$rcpt"
# yeah, array syntax is a bit cryptic... ;)
esac
done
set -- "${rcpts[@]}" # make $@
This code may become a *commented* part of default handler. Should it?
/mjt