procmail
[Top] [All Lists]

Forwarding mail on procmail error exit

1997-08-07 14:28:00
I have been trying to set up procmail in my office, which gateways mail
from Unix servers to MSMail (not Exchange) postoffices and on to MSMail
3.2.  I have been running procmail quite successfully on this Netcom
account, and now find the need to use it at work to filter out spam and
handle a number of work-related outside mailing lists and internal
aliases.

When I forward mail via procmail (! rik(_at_)hqgw(_dot_)company(_dot_)com), 
mail shows
up in MSMail with my login as the sender. I realize that this is a
result of MSMail looking at the envelope sender, and not at the From:
address.  When the original .forward file simply forwards all mail,
without invoking procmail, mail shows up with the proper sender.

To overcome this I thought of setting the .forward file to forward if
procmail fails, and force procmail to exit with an appropriate
ERRORCODE when I want a message forwarded.

The original .forward was:

rik(_at_)hqgw(_dot_)company(_dot_)com

The .forward I tried (suitably unwrapped) was:

"|IFS=' ' && exec /field2/rik/bin/procmail -tf- || 
rik(_at_)hqgw(_dot_)company(_dot_)com
|| exit 75 #rik"

This is clearly wrong, and experimentation proves it so.

The questions, then, are:

1) Can this be made to work, and if so, how? I suspect it can, I don't
know how.

2) Is this necessary, or can the message headers be changed within
procmail so that forwarding there works? I suspect that the answer is
no to this. Evidence for this is that mail forwarded via procmail to
other accounts is handled correctly.

-- 
Rik Kabel      Click *HERE* to lower control rods          
rik(_at_)netcom(_dot_)com

<Prev in Thread] Current Thread [Next in Thread>