BLIND-HAMS Archives

For blind ham radio operators

BLIND-HAMS@LISTSERV.ICORS.ORG

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"T. Joseph Carter" <[log in to unmask]>
Reply To:
For blind ham radio operators <[log in to unmask]>
Date:
Fri, 19 Aug 2011 13:04:46 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (127 lines)
On the contrary, I wrote the script so you don't have to know any 
Python.  *grin*  You just need to know how to configure your mail 
client.  Though probably if you're running a mail client in which you 
could easily add the filter, odds are you are using Linux or possibly 
a Mac as I am.

The problem isn’t trying to get messages int' “plain text” form, it’s 
that the mailing list does this thing to messages it does not think 
are “plain text enough” which nobody does anymore.  It’s called 
Quoted-Printable encoding (and even back in the early to mid 1990s 
when it was a regular fixture, we called it “Quoted-Unreadable”, 
hence the name of my script!)

Quoted-Printable is understood by all major email clients nowadays, 
so long as the message contains basic headers indicating it’s there!

On this message you are reading now, these headers should be present:

	MIME-Version: 1.0
	Content-Type: text/plain; charset=utf-8
	Content-Transfer-Encoding: quoted-printable

They aren’t, however, so you’re probably seeing a lot of garbage in 
my message with equal signs and hexadecimal numbers representing 
anything from spaces at the end of my lines to the equals sign 
between charset and utf-8 above, and the various quote marks and 
apostrophes used in this email.

Fixing it properly would require a large amount of someone else’s 
time.  I can more or less solve the problem in just a few minutes of 
my own, so that is what I did.

Joseph - KF7QZC


On Fri, Aug 19, 2011 at 09:08:44AM -0400, Ron Canazzi wrote:
>Hi Joseph,
>
>If you are using Linux with Orca--which judging by your post I think you may
>be, with the accessible version of Linux called Vinux, people are using
>Evolution Mail--a Windows-like full featured mail client, which you can
>configure to display messages in plain text only--just as you can with
>Windows based clients like Windows Live Mail and Outlook.
>
>While I'm sure your method works, anyone reading this would have to know a
>lot about python scripting and other Linux based coding--which I dare say
>most people on this list have no idea of.
>
>
>----- Original Message -----
>From: "T. Joseph Carter" <[log in to unmask]>
>To: <[log in to unmask]>
>Sent: Friday, August 19, 2011 2:26 AM
>Subject: Quoted-printable crap on messages
>
>
>Alas, it is 2011, and Quoted-Unreadable is not yet dead!
>
>Messages from this list are encoded in it if they contain even the
>slightest non-ASCII character or long line.  Only, it doesn't put a
>header on the message telling modern clients to do the decoding
>automatically.
>
>Fortunately, I use a text-based client called mutt, which allows all
>kinds of folder and other kinds of hooks.  I do not know if anybody
>else can benefit from this but I offer it in case it might be useful
>to someone:
>
>In my .muttrc:
>
>folder-hook . 'unset display_filter'
>folder-hook '+Gmail/ham\.blind-hams' \
>'set display_filter="~/Library/bin/quoted-unreadable"'
>
>
>For any folder, the first line un-sets the display_filter option.
>Without this, all messages would be assumed to be in quoted-printable
>format and thus decoded.  We don't want that, since it is only this
>list that uses QP without telling the client about it!
>
>The second line (and third via continuation backslash) matches on the
>precise name of the folder "Gmail/ham.blind-hams" located in my mail
>directory.  It then sets the display filter for this list alone to be
>the script named quoted-unreadable in ~/Library/bin (which kind of
>mixes the UNIX and Mac paradigms a little, but I couldn't think of a
>better name for a bin directory than, well, bin.)
>
>Anyway, here's the script, written using Python:
>
>#! /usr/bin/env python
>
>import sys
>import quopri
>
># Mutt sends displayed headers through this hook, ignore them!
>show_header = True
>while show_header:
>hdr_line = sys.stdin.readline()
>sys.stdout.write(hdr_line)
>if len(hdr_line.rstrip('\r\n')) == 0:
>show_header = False
>
># The entire body of the message is filtered with a single line:
>quopri.decode(sys.stdin, sys.stdout)
>
>
>Yup, that's it.  The heavy lifting is done by quopri, which is
>apparently something you probably already have installed if you've
>got a full Python library.
>
>If you can filter the body alone, you need just the two import lines
>and the call to quopri.decode.
>
>I haven't the faintest idea how you'll use this on anything other
>than Mutt, and yes I know the way I handle headers could be improved.
>Much could be done if I were to make the header handling optional, so
>that I could make effective use of this one-line-wonder elsewhere
>(because for example I have seen on this list the occasional
>double-QP which my filter makes no attempt to solve.  But there you
>have it.
>
>It finally got annoying, so I fixed it on my end.  It's taken longer
>to share the result than it did to fix the problem and test it, so I
>hope it's useful to somebody.  *grin*
>
>Joseph - KF7QZC

ATOM RSS1 RSS2