procmail
[Top] [All Lists]

Re: How to replace a string in email body

2011-03-02 12:42:49
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.

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

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