procmail
[Top] [All Lists]

Re: Modifying the body of emails

2007-07-07 20:20:35

On Jul 7, 2007, at 9:27 PM, LuKreme wrote:

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>-'

The grep docs say [[:digit:]] is preferable to [0-9], am I right? That's what I've been using.

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

I think I've got it all working now. Thanks for the tip about b over B; I didn't understand the difference. Thanks for the help, guys! This is the end of literally months of struggling to simply fix what Blogger broke. Of course, now I have power to do lots of cool things I couldn't before, that I may use in the future. Check out the results tomorrow at <http://homepage.mac.com/calion/blog> if you wish.

Jim

--
Ron Paul President 2008!
It is time for President Paul!
The only candidate who defends liberty and the
Constitution!
http://ronpaul2008.com

Visit Jim's Web Portal: http://homepage.mac.com/calion/

Attachment: PGP.sig
Description: This is a digitally signed message part

____________________________________________________________
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