procmail
[Top] [All Lists]

Re: How to use procmail to forward mail under conditions

1999-05-20 14:10:19
tomers(_at_)excite(_dot_)com writes:
I would like to perform the following algorithm:

if (To == "email1(_at_)host(_dot_)com" )
then {
add "Misc" field and write orginal "To" to it;/*optional*/
write "email2(_at_)host(_dot_)com" in "To" ;
forward message to "email2(_at_)host(_dot_)com" (without saving) ;
}

Is this for a virtual domain?  If so, the virtual domain software ahead
of procmail should be either saving the original envelope recipient
address somewhere or passing it as an argument to procmail.  Without
that, it just won't work right, period.

If this isn't, then the answer is probably as simple as:

        :0 w
        * ^TO_email1(_at_)host\(_dot_)com
        ! email2(_at_)host(_dot_)com

The above doesn't change the To: header, but that's fine: the e-mail
system doesn't really really care what the headers are most of the time
(which is what makes the virtual domain version of this more
complicated.  See era's procmail FAQ for details:

        http://www.iki.fi/~era/procmail/mini-faq.html

)


Philip Guenther