procmail
[Top] [All Lists]

Re: Changing Subject, forwarding to new address

1997-05-15 01:13:00
On Wed, 14 May 1997 16:59:44 -0500, Jill Lampi 
<lampi(_at_)magic(_dot_)mb(_dot_)ca>
wrote:
I've spent the last couple hours sifting through the archives, trying
this and that to do the following (without avail, obviously!):
take incoming mail, change subject line to "XYZ" and forward the
message, with the new subject line, to XYZ(_at_)where(_dot_)iam(_dot_)com 
without losing
any information from the message sent.

By definition, if you throw away the original Subject line, you lose
information. 

Let's see if I get this straight: 

    For each message you receive, you unconditionally want to
    * change the subject line
    * send it to a different address
    * and not keep a copy of the unaltered original on the local account

If that last one is incorrect, you merely add a "c" flag after the
:0 in the following:

    :0
    | formail -I"Subject: XYZ" | $SENDMAIL $SENDMAILFLAGS 
xyz(_at_)where(_dot_)iam(_dot_)com

You could instead, for example, preserve any existing Subject: header
but add a tag in front of it, like so:

    :0
    | sed -e '1,/^$/s/^Subject:[        ]*/Subject: [xyz] /' | $SENDMAIL ...

(The stuff in the brackets is a tab and a space. This will "normalize"
Subject lines with no space or many whitespace characters after the
colon, changing either of those into a single space.)

Hope this helps,

/* era */

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>

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