This man page provides a quick tour through some of the basic features of exmhwhich provides a graphical user interface to the MH mail system.
After you read this tutorial you should be able to use exmhfor your basic daily mail reading needs. You will learn how to send mail, read mail, manage your messages in folders, and adjust some of the exmh features by means of its user interface.
Other places to get information:
A cleaned up version of an earlier release of these pages appear in the 3rd edition of the book by Jerry Peek, MH & xmh: email for users and programmers, which is published by O'Reilly & Associates.
If you are already an MH or xmh user, you can start with the examples given in this tour. If you are a new user, exmh will up your basic MH environment. This includes a Mail directory which will have one subdirectory for each mail folder, plus several files that MH mail uses for its own purposes. You also get a ~/.mh_profile file that has user settings for MH and exmh.
Exmh uses the regular MH programs to manipulate your mail folders and messages. This means it is compatible with command-line use of MH programs, and its actions should be familiar if you are an experienced MH user. If you are a new MH user, then the details of running MH programs is hidden behind the graphical interface. The MH programs used by exmh are described towards the end of this man page.
When you run exmh for the first time it checks a few things
in your MH profile. In particular, it depends on the
components. If these profile components are not present, a dialog
appears and exmh can set them up for you. If you do not let
exmh create them nor set them up by hand, exmh will not
work properly. These profile entries are described
Exmh has been designed to be very flexible, although it will work just fine "out of the box". The package used to adjust some of the settings in exmh is introduced in this man page, and some of the important settings are described here. A more complete guide to customizing exmh is given here.
The command to start exmh looks like this:
If yourexmh -display hostname:0 &
DISPLAYenvironment variable is set up properly, then the
-displayargument is not needed, and the command is even simpler. You do not need to specify a
-geometryargument, although exmh supports one. Instead, simply position and size the window using your window manager. When exmh quits, it saves the geometry information so you don't have to worry about it. It does this with all its top level windows, so you can adjust their position once and then forget about it. There are more command line options described here.
You can add the exmh command to your startup X environment by editing
your startup file (like
.xsession). You might also want
to add it to the main menu of your window manager. The details about
this vary from X system to X system, so ask your local X guru for
help. Exmh also supports the window manager session protocol,
which means that session-smart window managers will automatically
start exmh for you if you quit X when exmh is running.
This section describes the main parts of the exmh display. It probably makes sense to run exmh at this point so you can follow along. There are three sets of buttons in the interface, and three main sub-windows.
To the left of the folder buttons, summary information about the current folder is displayed.
MH experts: The display in this window comes from both the MH scan program or MH inc programs, so it is affected by the form specification used by these programs.
Hint: Many of these message operations have keyboard shortcuts that make it easy to use exmh with your hands on the keyboard. Some of the short-cuts are introduced in this page, and all of them are listed here.
A good way to test things out is to send a message to yourself. Here are the steps you take to do that:
Move the insert cursor to the Subject: line and enter a Subject. The people that receive your message will get an idea of what the message is about from the subject, so take a moment to think of a good one. For this test, you can type something like "exmh test message".
Position the cursor at the start of the message body. You can use the mouse for this, or you can press <Tab> twice quickly and the editor will position the cursor correctly. When using the default MH message templates, this will be right after the line of all dashes.
If you do not want to send the message, press the Abort button instead. If you want to save the message draft and continue to work on it later, press the Save&Quit button. Working on a saved draft message is described here.
Finally, try sending email@example.com a message. This addresses a program that will return a MIME message to you. Just put this address in the To field with anything as the message body and subject. Reading this message will be described below.
The selection is dragged out with the left mouse button. You can modify the selection by holding the Shift key while pressing the left button. A double-click begins a word-oriented selection, and a triple-click begins a line-oriented selection. If you drag a selection off the bottom or top of a window the text will be scrolled automatically and the selection will be extended.
Paste is done with the middle mouse button. If you drag the middle mouse button, then the window is scrolled instead as described below. There is also a key-binding for paste, which is <Control-y>. Use <Control-w> or the <Delete> key to delete the selection. If you have a wheel mouse, such as the Microsoft Intellimouse, and you have configured your X server, you can enable the wheel in the Windows + Scrolling preferences box. For info on how to configure XFree86 with most wheel mice, see http://www.inria.fr/koala/colas/mouse-wheel-scroll/
The middle mouse button is used for "drag-scrolling". To scroll, simply press the middle mouse button over the text and drag the text. If you press the Shift key, the scrolling is faster. Drag-scrolling works in the text widgets, for vertical scrolling, and the one-line entry widgets, for horizontal scrolling. The text widgets are used to display the folder contents and the current message. The entry widgets are used in various dialogs in order to enter values. You can change the scrolling button to the right button or to only work with shift-middle. Set this up in the Simple Edit Bindings... dialog.
Buttons and menus are also sensitive to which mouse button is pressed. Only the left button activates a button, and it is the <ButtonRelease> event that is important. If you accidentally move the mouse off of the button as you release it, nothing will happen. Don't worry, the wrong button will not be invoked.
Press the left button over a menubutton to pull down a menu. Most of the menus in exmh are distinguished with a "..." in their label, e.g. "More...". The menu will go away when the button is released. Release the mouse button off the menu if you do not want to invoke any menu item. (In some versions of Tk, the middle button will "tear off" a Tk menu. This is quite handy if you use the menu often. To get the menu to go away, you must click the left button over the menubutton. This will reattach the menu to the menubutton, and another left click will make the menu go away. In the latest versions of Tk, the first menu entry is a dashed line that invokes this tear-off operation.)
By now you should have some new mail waiting. Press the button from the middle set of buttons that do Folder operations. This will transfer messages from your system spool file into your inbox folder. You will hear an audible cue if there was new mail, and the table of contents will be updated to reflect the new messages in your inbox. New messages will be underlined (on a monochrome screen), or blue (on a color screen), to indicate that you have not read them yet.
To view the new message, click on its line in the table of contents, or press the button in the bottom group of buttons. The message will be displayed in the bottom sub-window, and the line in the table of contents will be highlighted to remind you which message is being displayed.
To view the next message, click the button. The keyboard shortcut for this is the 'n' key.
The view the previous message, click the button. The keyboard shortcut for this is the 'p' key.
Scrolling through messages. If you get a message that is too long to fit into the message window, then the scrollbar will change its appearance to indicate how much text is displayed. The scrollbar is Motif-like. You can click on the arrows at either end to go up and down one line. If you click above or below the elevator box you go up and down one page. You can drag the elevator box to scroll, too.
You can also scroll text windows in exmh by dragging with the middle mouse button. Press the middle button over the text area, not the scrollbar, and hold it down while you move the mouse up or down. If you hold the shift key at the same time, the scrolling is faster. This works in the folder Table of Contents window, too.
Hint. The space bar is a keyboard short-cut that does a combination of scrolling and advancing to the next message. If the message is long, then space will scroll by one screen. Once you are at the end of the message, space will advance to the next message, just like the 'n' key. You can use the BackSpace key to scroll back through a message.
By now you should have also received the sample MIME message from firstname.lastname@example.org. The MIME message has three parts to it, and these are numbered and labeled in the display. The first part is a multipart/alternative content, which means there are a few different ways to view the content. This is indicated by the message under the heading 1. that there are alternative views of the following content. Exmh will go ahead and display what it thinks is the best alternative, and you see the text/plain content displayed in part 1.2. If you want to see the other alternatives, then you can press the right button over section 1 to get a popup menu with some choices.
The next two parts are an audio clip and a picture in GIF format. The audio clip displays two active text buttons labeled "Play attached audio" and "Save audio file". Click on either of these with the left mouse button. The part corresponding to the image displays the image in the window. You can always press the right button to get a MIME menu that has type-specific options for parts of your message. If you press the right button over part 2., then the popup menu will offer you these choices:
The first item is a checkbox menu item that lets you view the raw content if you want to. The Save... menu entry displays a file selection box so you can choose a non-temporary file to store the content. This same function is available through the text button, but not all MIME parts displays buttons like this. The next two entries should result in the same thing. They use the mailcap specifications to run another program that displays the content. In the first case, View using mailcap rule..., exmh runs the program directly. In the other case, Pass to metamail..., the metamail program is run first, and it decodes the mailcap file and runs the external program. Again, the text button labeled "Play attached audio" also plays the audio.Decode part as MIME Save Hello from the author... View using mailcap rule... Print Hello from the author as text... Pass an audio fragment to metamail...
Select one of the messages from your friend that you'd like to answer. Press the left button over the Reply... menu button. A menu with a few entries will be displayed. Select the menu entry by dragging the mouse down to that entry and letting up over it. The menu entry has a <Key-r> in it, which means that you could also press the 'r' key to invoke this function.
This time the built-in editor will open a window with a message that is partly filled in. All the headers are initialized based on the header components from the original message. The built-in editor will automatically position the cursor at the beginning of the message body. You can enter your reply message like you did with the previous messages. You should also double-check the header components. In this case, add yourself to the Cc: component so you will get a copy of the reply message. When you are done, press the Send button in the editor window to send the message.
There are a number of ways to control the format of your reply
messages. The MH
repl command has several formatting
options, and because exmh uses
repl to set up the
reply message, you can customize your reply format. Exmh lets
you define several variations on reply and add them to the
Reply... menu. This is described here.
It should not take long for you to get the copy of the reply message. Wait a minute or so and press the button. The keyboard short-cut for is the 'i' key.
Before we go on to more things you can do with messages, we need to talk about selecting multiple messages at once. Several of the message operations in exmh can operate on a set of messages. You can manually select multiple messages by using the mouse, or you can select messages based on their content.
Using the Mouse. To select messages with the mouse, press the left button and then drag out a selection. This will select a contiguous range of messages. If the messages you want to select are not so nicely organized, you can make a disjoint selection by holding down the Shift key while making your selection. This adds new messages to the selection. If you shift-click on a message that is already selected, then it becomes unselected. If you need to select a lot of messages, simply drag the mouse off the top or bottom of the window. It will be scrolled automatically and the selection will be extended.
The Search... menu has several operations for finding messages and finding text within a message. There is also a help entry that explains searching in more detail. If you select "Find in message body" or "Find in table of contents" a small search dialog appears. Enter the search string and use the Next or Prev buttons to find the next match. When you are searching over the table of contents, you can select All to select all matching messages.
The other way to search a folder is with "Pick by attributes". The MH pick program is used to search the current folder for messages that match mail headers like From or Subject. You can build up boolean expressions among search criteria. This is a much more general search mechanism than the "Find in table of contents" operation.
Get started in the Pick dialog by pressing the "Choose pick attribute" button. A menu of attribute types appears, including the Subject, From, To, and Cc header components. You can type a regular expression pattern in these entries to search for messages that have a matching header component.
The Before and After attributes are dates. You can find all messages before or after a given date by using these fields. You can specify dates as mm/dd/yy. Be sure to include the year. Dates can also be keywords like "today", "yesterday", "tomorrow", and any day of the week ("Sunday", "Monday", and so on.)
The Search attribute is used to search for something in the body of
a message. This will run little slower because
read through all of your messages, not just their headers.
If you select more than one attribute,
messages that match all the criteria. In other words, it does the
logical and of the search criteria. If you want to search for
this or that, then you need to press the Or button in the
dialog. This adds another set of fields to the dialog, and pick will
search for everything that matches the first set or matches the
The "Add to Sel" checkbutton should be set before you do the search. This controls whether or not the selected messages are added to any existing selection.
Finally, use the "Pick" button to do the search. Once the search has completed you can perform a few operations on the selection. You can and refile messages as described later. You can also display a new table of contents that only contains the selected messages. Use the "New FTOC" button for this. You can also clear the unseen state of the messages with the "Mark Seen" button.
The "Clear" button resets the fields.
The two entries in the dialog are used to control MH sequences. You can define up to 10 sequences in each folder, but they won't be displayed properly unless you also define resources for them.
If you use New FTOC to get a new scan listing, it would be better if it appeared in a new window, but currently it replaces the table of contents. You can move around and manipulate messages in this table of contents. However, if you do another pick, it will only find things in this limited table of contents, not the whole folder. (Yes, this is a bug .) Use the Rescan Folder menu entry in the folder More... menu to get a complete folder listing.
If you want to send someone a copy of a message or messages that you have received, use the Forward message operation. Select the messages as described in the previous section, then press the button. The keyboard short-cut for forward is the 'f' key.
The message template will have a copy of the selected messages. You fill in the headers, and you can also add a short message before the start of the forwarded messages. When you are done, press Send to forward the messages.
After you have read a message, you might want to remove it to keep your mail folders tidy. Exmh uses two steps to remove mail. In the first step you mark a message as being deleted. In the second step you commit the operations on all marked messages. It turns out that just renames your message files. They will survive until you get another message by the same number and remove it, too. In addition, exmh has a operation that removes these renamed files if they are more than a week old.
The operation applies to the current message, or you can also select a range of messages by dragging out a selection in the table of contents. You can delete the current message(s) by pressing the button. The keyboard short-cut is the 'd' key. The deleted message(s) will be highlighted after the operation so you can easily see the state of the message. On a monochrome screen, a cross hatching will be drawn through the table of contents line for the message. On a color screen, the table of contents line will get a dark grey background.
After you mark a message for , you are automatically advanced to the next message. This makes it easy to go through your folder and clean it up. Click 'd' to delete, or click 'n' to leave it alone.
Hint. If you are really in a hurry, use 'D' and 'N' as your keyboard short-cuts. This prevents the next message from being displayed, which can be slow for complex multi-media messages.
When you are ready to commit the pending actions, press the button. The keyboard shortcut for is <Control-Return>.
If you decide you do not want to a message you can unmark it. Use the menu entry that is under the message More... menu. The unmark operation applies to the current message or messages, so you have to select the messages to unmark first. The keyboard short-cut for unmark is 'u'.
Hint. The minus, '-', keyboard shortcut takes you to the previous message, even if it has been marked for . Ordinarily the operation, and the 'p' short-cut for it, will skip over marked messages.
Press the button to leave exmh. It will take a few moments to close down because it saves some state information before quitting. The button will grey out after you click it, and you will see a few status messages as it shuts itself down.
Try out the by turning off the folder cache. This just takes up display space if you don't have many folders. If you have lots of nested folders, though, you might even want to make this display bigger!
Click the button, which brings up a dialog that has buttons for several of the modules that make up exmh. Click on the Folder Cache button to bring up the preference items that control the folder cache. In this case there are just two items: the number of lines of labels in the cache, and the names of folders that are always in the cache. Click in the first field and backspace over the default value of 1. Type in 0 instead, and press <Return>. Voila! The folder cache disappears.
If you like this setting, press Save one the main Preference dialog and your changes will be saved to a file named ~/.exmh/exmh-defaults. Press Reset if you want to undo your changes. You should be a little careful here, because you are allowed to Dismiss the preference dialog without saving.
Another useful preference item to set is under Background Processing. You can arrange for exmh to periodically run so your messages are automatically transferred into your inbox. The advantage of doing this is that the folder label highlighting works best this way. Unfortunately, exmh does not give you any visual clues when mail is only waiting in your system spool file.
More details about the dialog are given here, and an overview of the various preference sections is given here.
MH is a collection of UNIX programs that store, manipulate, and display your mail. MH originated from RAND, and it is now in the public domain. Exmh uses these programs to do all the hard work, while it concentrates on the user interface.
You can use the MH programs to read your mail. Run them from the UNIX command line like you would cd, ls, cc, or make. They are useful when you are connecting over a slow line or cannot run exmh for some other reason. For more details, there are individual man pages for each MH program, plus one overview man page called MH. Below is a short summary of the main MH programs used by exmh.
- Display the previous mail message. (Exmh doesn't actually run this.)
- Delete a mail message.
- Move a message into another mail folder.
- Reply to a mail message
- Forward one or more mail messages.
- Compose a new mail message.
MH keeps track of the current folder and the current message in between uses of these MH programs. For example:
% scan +inbox unseen 1713 04/14 foote.PARC@xerox. Have you started blasting cdroms yet?<<Probably. 1715 04/14 FlashBack Publish 1232: Tactix Introduces Break through in Unix Ad 1716 04/14 FlashBack Publish 1234: CERT Advisory - NCSA HTTP Daemon for UNIX< 1717 M04/15 To:welch PGP test<<-----BEGIN PGP MESSAGE----- Version: 2 1718 M04/17 email@example.com mime-flashback-w MIME FlashBack April 13th, 1995 1719 -04/16 Bill Wohler Notes for MH Chapters 20-22<<Brent, I have been 1720+-04/17 "Allen R. Carl" Re: Tabs<<Brent, where is this -tabs resource se % show 1717 (Message 1717 displayed) % next (Message 1718 displayed) % rmm (Message 1718 deleted) % repl 1717 (Set up template for reply to message 1717, invoke editor)
Each user has a
.mh_profile file that stores general MH
settings as well as per-command settings. Each line has a key, and a
value. For example, your mail directory is set with the Path profile
If your old mail system uses that directory already, just edit your
.mh_profile to change the name used for your MH mail
This man page should get you started with exmh. If you decide you want to know more about it, here are some of the features described in the other exmh pages.
msgchkprogram, or count up the messages in your mail spool file.
exmh-asyncscript. Or, Tcl-based editors such as
mxeditcan interact with exmh directly.