nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] Discard (trash) redundant HTML part

2008-04-24 11:17:09
On April 24, 2008 at 07:48, Jerry Peek wrote:

On 4/23/2008 3:05 PM, Xavier Maillard wrote:

    Do you know any easy way to just trash redundant HTML part of emails
    from gmail.com (for example) ?
   
    Is there any way to extend this to a more "general" way to delete
    unwanted MIME parts ?

When I used to have more free time :-/ I'd use a script named "mhedit" 
that would open my favorite text editor (which, for political reasons, I won't
name :) on the entire message. Because I'm comfortable with the format of
MIME messages, it was easy to spot the parts I wanted to remove and to
change the header accordingly.

For showing messages with HTML parts, you can use text-based browsers
like w3m, links, lynx, etc.  Here is what I have in my .mh_profile:

  mhshow-show-text/html: w3m -T text/html
  mhshow-show-text/x-html: w3m -T text/html

For handling replies to such beasts, I wrote a Perl script
to handle it, leveraging mhonarc.  The script is called
mha-edit.  Info and download is here:

http://www.mhonarc.org/MHonArc/extras/mha-mhedit/

If you download mhonarc itself (which you will need), mha-mhedit
is provided in the extras/ directory.

Here is my .mh_profile settings for mha-mhedit:

  mha-mhedit: -editor vim -htmlconv w3m
  mha-mhedit-lynx: -stdin -dump -force_html -nolist -width=76
  mha-mhedit-w3m: -dump -cols 76 -T text/html
  mha-mhedit-next: vim

The mha-mhedit-next is very important so you do not lose
anything if you enter "edit" at the "What now?" prompt.

I like to use w3m for converting HTML to text since it supports
tables.  links supports tables also, but the venerable lynx
browser does not.

The documentation for mha-mhedit should be fairly complete.

--ewh
-- 
Earl Hood, <earl(_at_)earlhood(_dot_)com>
Web: <http://www.earlhood.com/>
PGP Public Key: <http://www.earlhood.com/gpgpubkey.txt>


_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
http://lists.nongnu.org/mailman/listinfo/nmh-workers

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