procmail
[Top] [All Lists]

Re: Modifying the body of emails

2007-07-07 19:32:58
On 7-Jul-2007, at 08:21, Holger Wahlen wrote:
* LuKreme wrote:
   :0fwB

Make that ":0fwb" both times. "B" is used to check the message body
instead of the header (which is pointless here since there aren't any
conditions at all in these recipes), "b" means to pipe only the
body through the external command - that's what you want here.

Yep, exactly right.

As I said, untested.

On 7-Jul-2007, at 17:06, Jim Syler wrote:
Alright, the reason this isn't working is that sed was interpreting  
'/' as a delimiter and 'p' as a command in '</p>'. How do I escape  
'/'? With '\'? I can't tell from the sed manpage. Also, \d isn't  
listed as a synonym in grep(1). Will sed recognize it?

the ' around the sed was simply to protect the contents.  And yes, \  
will escape anything, so

sed 's/[0-9]:[0-9][0-9]:[0-9][0-9] .M/&<\/p>/'

or, use a different delimiter like Holger suggested.

sed 's-[0-9]:[0-9][0-9]:[0-9][0-9] .M-&</p>-'

And yeah, \d only works some of the time, [0-9] is a better choice.

-- 
Oh and I could be a genius
if I just put my mind to it
And I, I could do anything
if only I could get 'round to it.

____________________________________________________________
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