nmh-workers
[Top][All Lists]
Advanced

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

[Nmh-workers] Can One Suppress MIME Part Number Headers?


From: Martin McCormick
Subject: [Nmh-workers] Can One Suppress MIME Part Number Headers?
Date: Sat, 19 Dec 2009 07:29:53 -0600

When trouble-shooting, these are useful but when things are
normal, not so much so. As a computer user who happens to be
blind, I listen to each nmh message with synthetic speech so
each extra line takes time to hear all be it a tiny amount of
time, but nonetheless, it is there. My ignores= lines in
mhl.format and mhl.headers are many and long. If there is
something wrong with a message, I either call with show
-showproc more or just use less or vi on the actual
message file if that is possible (not encoded).

        Lines like: part 1     text/html                 1286
probably take 1.5 seconds to hear but in a year, I get over 7200
messages in just the inbox alone. That's 2 hours of just
that.:-).

        As problems go, this is way down on the list but it
presents a learning opportunity in the art of controlling nmh. I
wrote a sed script called nuisance filter which has little gems
in it like:

#! /bin/sh
sed -E '
/part[[:blank:]]*[1-9][[:blank:]]*text\/html[[:space:]]*/d
/part[[:blank:]]*[1-9][[:blank:]]*text\/plain[[:space:]]*/d
/News Banner <http:\/\//d
/If you are having trouble viewing this e-mail, go to/d
/If you have trouble viewing this e-mail, go to:/d
/If you have trouble viewing this e-mail, please go to:/d
/If you are having trouble viewing this email, please go to:/d
/If you have trouble viewing this e-mail please go to:/d
/If you are having trouble viewing this e-mail, go to:/d
/If you are having trouble viewing this e-mail, click here/d
/If you are having trouble viewing this message, go to:/d
/http:\/\/osu.okstate.edu\/news\/email\/headlines_/d
/  OSU Headlines <#>/d
/<http:\/\/osu.okstate.edu\/news>/d
/\/index.php?option=com_content&task=view&id=/d
'

The top 2 lines do filter out the MIME part headers if you do
something like

show 7 |nuisancefilter. If you put nuisancefilter in to the
.mh_profile as in:

mhshow-show-text/html: %p/usr/local/bin/lynx -force_html -child -dump '%F'
 |/home/martin/etc/nuisancefilter |/home/martin/etc/noblanks |/usr/bin/more

the filter does do a nice job on the body, but the header
processing has already happened so the MIME part numbers still get
through. Maybe my question should be; Is there a best place to
put a content filter in nmh that always gets all of the output?
Show msg# |filter works but it's clunky and has side effects.

        Many thanks. I think I have been using nmh or mh now for
15 or 16 years. I love it and we use it for scripting and
automation in more ways than I can count. IN case anybody is
curious, noblanks is a small script that removes blank lines and
whitespace from the beginning of lines when one is only
interested in printable text. Not recommended for pretty
formatting.

Martin McCormick WB5AGZ  Stillwater, OK 
Systems Engineer
OSU Information Technology Department Telecommunications Services Group




reply via email to

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