procmail
[Top] [All Lists]

Re: Change part of header and then forward on?

1999-11-04 04:07:09

I forward all mail from one account to another, after numerous parsing
via procmail.  The last rule in my file is just:

:0
!scott(_dot_)grosch(_at_)intel(_dot_)com


Is there a way, before the forwarding happens, to have procmail
remove all occurances of grosch(_at_)ichips(_dot_)intel(_dot_)com from the 
headers
and replace them with scott(_dot_)grosch(_at_)intel(_dot_)com?  I want to 
preserve
the To and CC lines, but just change out the account name.

Just filter the header through perl (or sed):

:0 fh
| perl -pe 
's/grosch(_at_)ichips(_dot_)intel(_dot_)com/scott(_dot_)grosch(_at_)intel(_dot_)com/g'

:0
!scott(_dot_)grosch(_at_)intel(_dot_)com


                        Martin

Martin(_dot_)Ward(_at_)durham(_dot_)ac(_dot_)uk http://www.dur.ac.uk/~dcs0mpw/ 
Erdos number: 4
Maintainer of the G.K.Chesterton web site: http://www.dur.ac.uk/~dcs0mpw/gkc/
Shortcuts: http://i.am/mw and http://i.am/gkc -- try them!
Vote against spam: http://www.politik-digital.de/spam/en/


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