procmail
[Top] [All Lists]

Re: Forward mail with From in subject field

1997-02-20 02:06:22
On Wed, 19 Feb 1997 08:44:00 +0100 (MET), Jarl Groneng 
<gjarl(_at_)sn(_dot_)no>
wrote:
 > I have a little problem. I want to forward mail to another e-mail account 
 > with the sender in the subject field. So I need a program/script that 
 > take out the sender and put it in the subject field on the forwarded 

Try this:

    FROM=`formail -rtzxTo:`

    :0
    * Some condition you want to match before doing this, perhaps? 
    | formail -I"Subject: $FROM" | sendmail 
address(_at_)to(_dot_)forward(_dot_)to

Add a "c" flag if you also want to proceed with normal processing of
this message in addition to forwarding it. 
Thank you very much for the tips, it works great.....but you mention the 
"c" flag, were do I put that? The mail goes tru to the forward 
mail-adress, but I don`t get the mail in my inbox. Have you any tips for 
that??

Jarl Groneng
gjarl(_at_)sn(_dot_)no
http://www.sn.no/~gjarl/

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