dgc: Mutt dgc: Mutt
I use mutt, a mail user agent (MUA) for UNIXTM and other sufficiently Linux-like operating systems.

I've done some minor development for Mutt. Here are my add-ons and patches. If you want to try a patch, but there's not one for your version of Mutt, try one for the nearest lesser version number. This software is not warranted for any purpose, etc.



--> Directory lookups in Qi
Mutt has a simple interface for directory lookup plugins. I wrote one to look up names in one or more CCSO nameservers (a.k.a. Qi, a.k.a. Ph). To use this, install the agent in your path as "
mutt-phquery", and add:

    set query_command = "mutt-phquery '%s'"
to your .muttrc file.

(There are other Ph query agents for Mutt; see the links at the Mutt web site. I prefer mine because it allows one to query any number of directories (with different parameters for each), and because it doesn't depend on the ph program or the qiapi libraries. Since we have three Qi directories on our campus and most of our neighboring institutions use Qi/Ph, too, this works well for me.



--> Kerberos patches
Mutt has had some problems configuring itself for Kerberos (--with-gss). These problems are gone in the current (1.2.5/1.3.9) releases, but in case anyone still needs the
patches for older versions, I keep them around.



--> Custom message-tagging — X-Label:
I like my mailing list mail to have a tag identifying messages as mailing-list messages. Some MLMs do this automatically by putting the list name in brackets on the subject header, but others don't. Anyway, I'd rather that the message have this property independently of the subject. It gives the mailer a lot more control.

These patches implement message labelling to meet that wish. The labels also can be used to mark messages according to interest or disposition.

Once again, the obsolete versions are still around. My original mailing-list article describes the patch's use more fully.



--> Undo stroke and macro bindings
At a time there seemed to be interest in undoing keystroke bindings and macros more simply than rebinding strokes to noop or macros to nothing. In particular, I believe that people wanted to unbind everything on a menu's binding list. I wrote this as an exercise and in response.



--> Attachment-counting patch
MIME attachments are useful, but I often lose track of where attachments are. I might be looking for a specific file that someone sent me, but if I get much mail from that person, the search can be somewhat difficult: Mutt's index doesn't tell me which messages have attachments, and there's no way to search for attachments across a whole mailbox.

  • mutt-1.2.5.dgc.attach.2 [ OpenPGP Signature ]
    mutt-1.3.23.dgc.attach.3 [ OpenPGP Signature ]
    This patch creates the %V expando for $index_format, and the ~V search operator. %V expands to the number of attachments Mutt can find in a message. In a wacky deviation from Mutt's norm, %-V expands to the number of attachments in the outermost part of a multipart message. (In a boolean context, as in the example above, %V is true if there is one or more attachment.)

    The ~V operator is a numeric operator. It takes the form:

    ~V [MIN]-[MAX]
    See the Mutt manual (section 4.2, Patterns) if you don't understand what that means.

    Additionally, since different user agents (and different users) do attachments differently, it provides three variables which help mutt to decide what exactly it should consider an attachment:

    attach_count_containers_ok
    If set, Mutt's attachment counter will consider MIME components which contain other components (e.g., multipart/* and message/*) as attachments.
    attach_count_inline_ok
    If set, Mutt's attachment counter will consider MIME components with a disposition of "inline" as attachments.
    attach_count_recurse
    If set, Mutt's attachment counter will examine message/* components for attachments.

    The default is to recurse containers, but not to count containers themselves, and not to count attachments marked as inline.

    The attachments patch tries hard to conserve memory. Messages are scanned for attachments when they're parsed for the index or during a search. When a mesasge leaves view, the attachment information is thrown away. It's not slow, though, and it doesn't waste memory.

    There is a bug in attach.2 relating to deletion of attachments within messages. (They won't be deleted upon folder synchronizaion.) This is fixed in attach.3. Thanks to David Ellement for noting this and testing the revised patch.



--> Nested if-else sequences in strings
If-else sequences in strings give menu displays a way of varying the conditionally. For example:

%?M?<%2M>&%4c?
This index_format checks whether a thread is collapsed. If it is, and at least one message is hidden from view, it will expand to <%2M> — the number of hidden messages. Otherwise, it expands to %4c, the message size.

What if you want a three-way condition, though — "if A, then X; else, if B, then Y; else, if C, then Z"? Mutt doesn't allow that until you apply this patch.



--> Alias-matching pattern-matching symbol
People have, on occasion, written to the
mutt-users mailing list wishing for a way to use Mutt's pattern matcher to find messages from, to, etc. addresses which are aliases known to Mutt. I recently had a need for this, myself.



--> Marking messages to return to later
There's a feature in vi that I'm so accustomed to, I kept trying to use it in mutt, too. In vi, you can mark a point in the current file with the m key, strike another key to act as the identifier for that mark, and then return to that mark later on by pressing the apostrophe (') and the identifier key.

  • mutt-1.3.23.dgc.markmsg.2 [ OpenPGP Signature ]
    mutt-1.3.24.dgc.markmsg.2 [ OpenPGP Signature ]
    This creates the mark-message binding, bound to the tilde (~) by default. Entering this binding prompts for a key sequence to identify the current message. This creates a macro sequence that will return to the message-id of the currently-selected message. The macro sequence is the apostrophe ('), followed by the identifier you were prompted for. You can change the apostrophe to some other character or sequence by redefining the mark_macro_prefix variable to that character or sequence.

    I'm not sure how useful this really is in practice, but that's for you to decide.



--> Miscellaneous patches from other people
There are some other patches I keep here for convenience.

  • mutt-1.1.12.skimo.exmhthread.1
    mutt-1.3.23.skimo.exmhthread.1
    Exmh posts wacky In-Reply-To: headers that don't thread correctly in a stock Mutt build. This patch is not mine, so I haven't signed it, but since I don't know where to get it when I want it, I keep this copy. I've updated it for 1.1.12. It still applies as of 1.3.8.


$Id: index-20020613.html4,v 1.1 2003/05/20 03:04:16 dgc Exp $