procmail
[Top] [All Lists]

Re: Rewriting From: and Subject:

2000-09-19 08:09:12
At 14:31 2000-09-19 +0100, FMK wrote:
I want to rewrite the From:-Field of a Mail, but I want to append the
old From: to the subject....

I tried this, but it only moves the mail into "osubj"...

Well, the rule you provided never attempted to put the MATCH from the from to the end of the subject, so you're guaranteed not to get what you're asking for, but that isn't the only problem with it.

:0fh
* Subject: \/.*
osubj = $MATCH
* From: \/.*
| formail -I "From: niemand(_at_)nirgends(_dot_)de" -I "Subject: Wichtig: 
$osubj"

You don't assign things partway through the conditions in a recipe. FLAGS then RULES then ACTIONS. AFAIK, variable assignments aren't something you should do within a filter (f flag) recipe. Try:

:0h
* ^Subject:[    ]*\/.*
SUBJECT=$MATCH

:0h
* ^From:[       ]*\/.*
FROM=$MATCH

:0fh
* (whatever your rule constructs are, if any)
| formail -I "From: niemand(_at_)nirgends(_dot_)de" -I "Subject: Wichtig: $SUBJECT 
$FROM"


(I actually get the subject, from, to, and sender all in one block near the top of my .procmailrc, which ensures that every recipe has access to these and doesn't need to do anything extra to get their hands on them - makes life much easier than doing them on a message-per-message basis).

---
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

 Sean B. Straw / Professional Software Engineering
 Post Box 2395 / San Rafael, CA  94912-2395


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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