MH & nmh: Email for Users & Programmers

May, 2006

MH Profile
by Brent Welch

exmh uses several entries from your MH profile (usually named ~/.mh_profile), including several entries that are only for exmh.

Header-Suppress: and Header-Display:
You control what header fields are displayed in a message with a combination of the Header-Suppress: and Header-Display: profile entries. Hidden fields are just scrolled off the top of the message display window. Each profile entry is a list of regular expression patterns that are matched against the field. Case is not significant in the patterns.

exmh takes three steps to decide whether or not to show a header field.

  1. By default, show all header fields.
  2. If a field is in the Header-Suppress list, don't show it.
  3. If a field is in the Header-Display list, show it.
Note that a pattern in Header-Display: has priority over a pattern in Header-Suppress:. The default values for these profile entries are:
      Header-Suppress: .*
      Header-Display: subject to from date cc
If you are a mail junky, you may want to use Header-Suppress to explicitly suppress the boring header fields you already know about. New, interesting fields inserted by random mailers will be displayed for you to check out. In contrast, the default for Header-Suppress hides everything; you explicitly choose fields you want to see by setting Header-Display.

So, the effect of the default rules is to show five fields: Subject:, To:, From:, Date:, and cc:.

The Folder-Order: entry tells exmh how to order your folder labels in the folder display area. Each item in the order can be either: All folder names that match the same pattern are sorted alphabetically. Longer pattern matches have priority over shorter patterns.

The glob patterns use the syntax of Tcl's string match function. It's similar to the string matching used in many shells:

* matches a sequence of any characters.
? matches any character.

The default Folder-Order: puts your inbox first:

      Folder-Order: inbox *
My Folder-Order looks like:
      Folder-Order: personal exmh mxedit * mail* sun m3 mach background
Folder-Order: also tells exmh the order in which to visit folders that have unread mail. When you use Next at the end of a folder, exmh automatically changes to the next folder in Folder-Order: that has unseen messages, if any. When no more folders have unseen mail, you're changed to the first folder in your Folder-Order: -- unless you disable this by turning off the Cycle back to first preference setting under the Scan Listing section.
The Folder-Unseen: entry lets you tell exmh the names of folders to search for unseen messages. Its value is a set of "glob" patterns that are matched against folder names. Note that glob has filename smarts, so you'll have to take into account subfolders in your glob patterns. (The Chapter Key Parts of the UNIX Filesystem explains how MH stores folders and subfolders in the UNIX filesystem.) For example,
The Folder-Ignore: entry is a set of patterns for folder names you want to ignore. The default pattern is .*, which causes exmh to ignore all directories whose names begin with a dot (.). Your glob patterns for Folder-Ignore: must take subfolders into account -- in the same way as Folder-Unseen:.
The Draft-Folder: entry is the name of a folder for messages being composed. If you don't have a Draft-Folder: entry, exmh asks if it may create one. The Section Draft Folder has more information.
The ExmhShowProc: entry lets you define a program that pre-filters a message before displaying it. If ExmhShowProc: is defined, exmh runs that program with the current message as the standard input; exmh displays the program's standard output. Note that the Header-Suppress: and Header-Display: mechanisms are used even if you have a special showproc.
The Scan-Proc: entry can be used to define an alternative scan program. (For more information, see the Section MH Format Strings.)

If you change the scan format, be sure that the message number is first on each scan line and that there is at least one space after the message number. exmh depends on this.

The MailDrop: entry is required if you don't have your system mailbox in the "standard" location, which is typically /usr/spool/mail/username. If you don't define MailDrop: correctly then Inc won't do anything because it won't find your new messages in the system mailbox.
The Path: entry is used to find your mail folders. exmh aborts if this entry is missing; it presumes that you haven't set up MH properly. The Section Changing MH Directory Name has more information.