What tools I use to deal with email

March 11, 2011

The most important thing I do to deal with my email is that I am not on any high-volume mailing lists. As far as I'm concerned, that's what gmane.org (or some equivalent) is for, plus a good newsreader. I sometimes temporarily subscribe to such mailing lists, but only when I'm going to send email to them. This one decision means that I don't need a mail environment that's designed to cope with a huge volume of email, which in turn means that I have a lot more choices and options.

I sort incoming email with procmail, mostly to divert spam and certain routine 'things are fine' administrative reports off to separate files. Everything else goes into my inbox.

I read my email using MH, in its current modern form of nmh. MH is natively a command line environment, but there are GUI interfaces for it as well. At the office, I primarily use MH through exmh, because I like good graphical interfaces and because it's the best option for showing me various sorts of MIME-encrusted messages. My exmh environment is fairly extensively customized to fit what I like.

(I have been using exmh for a very long time, more or less since it was first announced publicly, so I have all sorts of bits accreted on top of it.)

At home, I use MH through its command line interface. Well, I don't use the raw MH commands as-is; instead, I have a large suite of aliases and shortened names for things and so on (for example, loading my MH environment defines a 'd' alias to delete the current message, clear the screen, and show the next one). Part of my customizations are things to make MH less verbose and to do things like show fewer message headers; for obscure reasons I do this in peculiar ways instead of with the built-in MH facilities to do some of this.

One important part of this command line environment is a replacement for the stock nmh way of displaying MIME-encoded messages. The problem with the stock version is that it wants to quiz you and pause and flail around and so on (as anyone who has ever used it knows). My version's goal in life is simply to print out a plain text representation of as much of the message as possible, doing a sensible job with things like HTML and so on. This can then be run through the pager of your choice to actually see things (I use a very simple one that just pauses every screen's worth for me to hit return; most people would use less).

Even at work I sometimes drop into the MH command line environment; sometimes it's the easiest way to do something quick and simple, and sometimes it's the best way to do some more sophisticated operation. Exmh does not have a great interface for picking out messages, among other things; I do sometimes envy Thunderbird's really convenient UI for this.

(And of course I am not always in front of my desktop that has exmh running. If I am checking email from a laptop or the like, I am effectively 'at home' as far as MH usage is concerned.)

Comments on this page:

From at 2011-03-11 10:10:03:

plus a good newsreader.

Hah, what is a good newsreader? :)

By cks at 2011-03-11 10:55:32:

For me, a good newsreader is trn; I use the 'test' 4.0 prereleases, which are not very test and not very prerelease at this point.

From at 2011-03-11 10:59:38:

Ok, I like to use nn when my gnus setup is not available, but it slowly falls apart... and doesn't support unicode posts, for example (which are rather common in German newsgroups nowadays).

I'd also be interested in your alternate showproc since on this server I have cron likes to send messages as "text/plain; charset=ANSI_X3.4-1968" and I can't figure out why "mhshow-charset-ANSI_X3.4-1968: '%s'" doesn't simply work, which at least should display text mails with a single call to less... "mhshow-charset-utf-8: '%s'" etc. work fine for other mail.

By cks at 2011-03-11 12:00:37:

I've now put up mhnshow.py. Note that it contains some hard-coded dependencies on my environment, such as the invocation of nukehdrs (which filters out message headers that I don't want). I use a thin cover script over this as my showmimeproc.

(The cover script basically sets some options I want and then runs mhnshow.py piped into a pager.)

Note that this does no character encoding conversions, although it probably wouldn't be hard to add; right now I just assume that everything will work (which it usually does in my environment).

From at 2011-03-11 12:26:06:

Nice, I didn't know trn4 had a (good) nn-style message selector. It still doesnt do utf-8 100%, but apparently better than nn, and it copes better with terminals >80x24 as well... I'll give it a try.

From at 2011-03-11 12:38:16:

mhnshow.py works fine, thanks!

I am a long-time user of MH too. Is there anywhere one can take a look at your replacement for handling MIME messages? I also find MIME the one weak spot of nmh to this day.

By cks at 2018-12-17 12:34:29:

Belatedly: the only thing I do for handling MIME messages is to run them through my mhnshow.py. In checking now I discovered that I'd made some changes to it since 2011, so I've updated the version linked to above. I don't have any good solutions to composing MIME messages, and I rarely do it.

(Unfortunately, not dealing well with HTML messages is more and more of a problem these days. Possibly there's a better text HTML displaying option than lynx.)

By cks at 2018-12-18 12:04:30:

Sadly but probably unsurprisingly for a program last updated in 2006, vilistextum is strictly worse than lynx on real HTML email that I get.

(For instance, it doesn't appear to know about '‌' as an entity.)

Oh. I’ve had it filed it away under “better than Lynx” ever since I compared the two and picked it, never realising how long ago that’s been by now. Sorry.

Written on 11 March 2011.
« What we did to get iSCSI multipathing working on Solaris 10 update 8
Trust betrayed: a story of modern email »

Page tools: View Source, View Normal, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Fri Mar 11 02:06:02 2011
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.