Re: How to replace a string in email body

[email protected] (Professional Software Engineering)
Newsgroups gmane.mail.procmail
Organization Professional Software Engineering
Message-ID <[email protected]>
At 09:56 2011-03-02, Komal Tagdiwala (ktagdiwa) wrote:

>I have a requirement to strip out/replace certain text in inbound 
>email body and am not sure how to do so in procmail.

Procmail itself doesn't do text replacement.  You can pipe the 
message to an external program (sed, perl, whatever) to perform your 
replacement, but you still need to write that.

:0fw
| /path/to/some/script

Note that encodings could complicate things for you, and 
cryptographically signed messages will be broken.

I would STRONGLY advise that if you're changing message content, that 
you add a header indicating that this has been done, because you are 
in effect changing what someone has said  in an email.  If you're 
doing this only for tweaking some automated report, or it is only for 
your OWN email (which doesn't seem like the case), that wouldn't be 
so important.

---
  Sean B. Straw / Professional Software Engineering

  Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
  Please DO NOT carbon me on list replies.  I'll get my copy from the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.