procmail
[Top] [All Lists]

Re: Chaning subject on forwarded message

1996-01-17 11:08:58

I wanted my last recipe in my procmailrc to say "Ok, the message has
gotten this far, forward a copy to my other account and keep a copy here
BUT when you forward a copy, add a "(FWD)" so that I will know it is a
forward, BUT don't change the subject for the copy you keep here. 

Thank you all for the various suggestions you sent in.  It ended up being
rather simple, once I had the right letters to put after the :0

I already had these three lines at the top of my .procmailrc for other recipes:

SUBJECT=`formail -xSubject:`
FROM=`formail -xFROM:`
DATE=`formail -xDATE:`

SO I just used formail -I to change the subject and forward it, and then
use formail -I again to put the original subject back in and drop it off
here.  The key was ":0fhw" before the first 'formail' and the ':0fhwc'
before the second formail: 

:0
*^Subject: *
{
        :0fhw
        | formail -I "Subject: [FWD] $SUBJECT"

        :0 c
        ! 476tjl(_at_)ptsmail(_dot_)ptsem(_dot_)edu
                
        :0fhwc
        | formail -I "Subject: $SUBJECT"

        
}

It seems to be working great.  Is there anything I am missing that might
sneak up on me later?  Anyone want to offer any alternatives?  I'm still
really new at this, so I'm sure there might be better ways of doing things
than how I get them done. 

Thanks again

TjL


--
Timothy J. Luoma            <luomat(_at_)capitalist(_dot_)princeton(_dot_)edu> 
"Everything is easy when you know what you are doing"
                     Dr. Robert Cupper, Department of Computer Science, 
                     Allegheny College, Meadville, PA


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