I think the 'to' command is final (yes?) for delivering messages.
Is there another way to deliver the same message to multiple folders?
I'm trying to test a configuration change before I modify any of my
users. My ~/.mailfilter so far looks like:
--------------------------------------------------------
SUBJECT=`$FORMAIL -x Subject:`
SPAMVERSION=`$FORMAIL -x X-Spam-Checker-Version:`
SPAMSTATUS=`$FORMAIL -x X-Spam-Status:`
log "(==) $TIME SUBJECT='$SUBJECT' using mikee's rules"
if ( $FROM =~ /^[a-z]+@$DOMAIN.com/ )
{
log "(==) $TIME '$SUBJECT' from $DOMAIN user '$FROM': delivering"
to "$HOME/Maildir/"
}
if ( $SUBJECT =~ /NOTICE: mail delivery status/ )
{
log "(==) $TIME '$SUBJECT' from $DOMAIN user '$FROM': delivering"
to "$HOME/Maildir/"
}
# the copfilter added on $HOST, the ipcop box that has copfilter installed
if ( /^X-Copfilter/ )
{
log "(==) $TIME delivering scanned '$SUBJECT' to mikee@$DOMAIN.com from
'$FROM'"
log "(==) SPAM-VERSION='$SPAMVERSION'"
log "(==) SPAM-STATUS='$SPAMSTATUS'"
to "$HOME/Maildir/"
}
else
{
log "(==) $TIME forwarding '$SUBJECT' for mikee@$DOMAIN.com from '$FROM' to
$HOST for scanning"
to "|/tmp/smtp.pl '$FROM' mikee@$DOMAIN.com"
}
--------------------------------------------------------
The delivery stanza (the third 'if' from the top) I want to keep
doing what it does, delivering the message to $HOME/Maildir. I want to
continue delivering 'to "$HOME/Maildir/"' and also to another directory
for testing this new project. Can I put two 'to's in the if clause
so it looks like:
if ( /^X-Copfilter/ )
{
log "(==) $TIME delivering scanned '$SUBJECT' to mikee@$DOMAIN.com from
'$FROM'"
log "(==) SPAM-VERSION='$SPAMVERSION'"
log "(==) SPAM-STATUS='$SPAMSTATUS'"
to "$HOME/Maildir/"
to "$HOME/project/" <=== added this line
}
else
{
log "(==) $TIME forwarding '$SUBJECT' for mikee@$DOMAIN.com from '$FROM' to
$HOST for scanning"
to "|/tmp/smtp.pl '$FROM' mikee@$DOMAIN.com"
}