procmail
[Top] [All Lists]

Replacing HTML bodies

1998-01-14 13:31:14
I've been following the discussion of excising useless attachments
from messages for awhile.  I just wish those ideas could be
implemented on some of the other mailing lists I subscribe to.

I have another requirement....

I belong to a couple of mailing lists (distribution only) that
have begun to htmlize *every* message.  Unhappily, my mailers
don't handle them very well.  They either do a *very* bad job
of handling the formatting or don't format them at all.

What I'd like to do is use lynx to take the html body, pretty print
it and then put the resulting text into the body of the message, 
replacing the current contents.

The couple of lists I need to deal with don't seem to insert
mime-headers of any sort, but simple put the html code in the
message body.

The format of the lynx command is:

   lynx -dump [file|URL]

I was thinking of something like so:

:0 fwb
* ^^<HTML>                #detect html mail (simple case, no mime stuff)
|cat > /tmp/foo; lynx -dump /tmp/foo

or

:0 fwb
* ^^<HTML>
| $body =|; lynx -dump $body

The first case cats the body to a temp file and the second
capture the body to an environment variable (I'm replaying that
"capture" magic from memory so I probably have it wrong).

Are there any reasons to prefer one solution over another?

Has anyone done something like this before?

Simeon

<Prev in Thread] Current Thread [Next in Thread>
  • Replacing HTML bodies, Nevel, Simeon <=