[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Jerry Peek
Subject: Re: [Nmh-workers] Discard (trash) redundant HTML part
Date: Thu, 24 Apr 2008 07:48:03 -0700
User-agent: Thunderbird (Windows/20080213)

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 instance, some Microsoft email program(s) used to send multipart/alternative messages with a text/html part that had <DIV> and <FONT> tags around every line of every paragraph. Since I didn't need an HTML approximation of the plain-text message, I'd remove the text/html body part and change the Content-Type: header field from multipart/alternative to something like text/plain.

In case you need to read more about MIME message structure, Chapter 3 of the online book, http://rand-mh.sourceforge.net/book/overall/ch-itm.html , has information that's not completely up-to-date (it was written ten years ago) but which should get you started.

The script I used has two names, showv and mhedit:

$ ls -l mhedit showv
lrwxrwxrwx  1 root   jpeek    5 Apr 30  2005 mhedit -> showv
-rwxrwxr-x  1 jpeek  jpeek  337 Mar 20  1998 showv

Here's the script.


---- snip ----
#! /bin/sh
### showv, mhedit - show message(s) with no formatting, edit message(s)


case "$0" in
*showv)     args="${PAGER-less}" ;;
*mhedit)    args="${VISUAL-${EDITOR-vi}} -noheader" ;;
*)  echo "$0 quitting: I don't know how to run myself." 1>&2
   exit 1

exec show -showproc $args ${1+"$@"}

reply via email to

[Prev in Thread] Current Thread [Next in Thread]