Programs [was LPM: Meetings and attendance]

Frank Price fprice at upended.org
Tue Feb 13 07:47:21 CST 2001


On Mon, Feb 12, 2001 at 02:55:58PM -0500, David Pitts wrote:

> Also, I would like to see what other people are doing.  Several
> people in the group are good programmers.  Others, like myself, are
> good hacks.  I would like to see some good programs - what makes
> them good, etc.  

Actually, I think this would be nice to stimulate list discussion.
How about folks say a couple paragraphs about a program they're
working on, or have done in the past that is useful or neat?  We could
post descriptions and links (maybe even programs) on the lexington.pm
page.  And if there's interest they could develop into talks.

I'll go first, and I'd like to hear about other projects too!

-------
A while back I switched to using Mutt as my mailer, and a combination
of fetchmail and procmail to suck mail down from my ISP and stick it
into different folders (inbox, lexpm, uklug, etc.).  There are quite a
few folders and I wanted something to show me how many unread messages
were in each folder since Mutt doesn't do that very well.

I wrote a Perl program (called miff, for Mutt biff) that parses
through your .muttrc config file to find out what mailboxes Mutt knows
about.  It then reads through the headers of each piece of mail to
count how many are unread, does some formatting, and displays the
total in an xterm.

Some of the interesting things I had to deal with were:
  - Parsing the config file.  I had to look for keywords, deal with
    continuation lines, and deal with recursive config files (Mutt
    lets you "source" other config files in the main config file).
  - Going through the email headers.
  - Saving and resetting the access time on each folder so as not to
    confuse Mutt.
  - Doing a very small bit of terminal manipulation to highlight
    folder with unread mail.

It was pretty interesting to do and useful to me and a few other
people.  A more complete description and source can be found at
http://www.upended.org/miff/

-Frank.
-- 
Frank Price | fprice at upended.org | www.upended.org/fprice/
GPG key: www.upended.org/fprice/gpg.asc | E Pluribus Unix




More information about the Lexington-pm mailing list