nmh

From ArchWiki
Revision as of 23:24, 23 September 2014 by Sceox (talk | contribs) (Expand configuring)
Jump to: navigation, search

Merge-arrows-2.pngThis article or section is a candidate for merging with List of applications.Merge-arrows-2.png

Notes: No content that warrants a separate page (Discuss in Talk:Nmh#)

nmh (new message handler), is a powerful electronic mail handling system. Following the Unix Philosophy, nmh is made up by a collection of simple programs each of which has a single purpose. This architecture allows the user to intersperse nmh with other commands at the shell prompt and to write scripts tailored to their needs.


Installing

Install nmhAUR or nmh-gitAUR from the AUR.

Optionally install a utility to handle IMAP or POP, for example fdm, offlineimap or getmail.

Also optionally install msmtp or another utility for sending mail.

Configuring

nmh is extensively configurable in a variety of ways. The primary of these is the ~/.mh_profile file.

The syntax for .mh_profile is unusual. For example, nmh will refuse to run if there are blank lines in the file. Read the mh_profile (5) man page for more.

By default, nmh uses ~/Mail as your mail folder. To change this, set Path:

 Path: path/to/mail/folder
Note:
  • Path can be either full (if prefixed with /) or relative to $HOME.
  • Nmh uses the mh mail format, which is different from the maildir and mbox. Setting your Path to a preexisting maildir folder, for example, will not work.

Set inbox (relative to Path):

 Inbox: inbox

Also by default, nmh populates the mail folder with the inc command, which incorporates mail from the user's mail drop (/var/mail/user).

If you have a non-standard mail drop path, you can set an Environment Variables $MAILDROP, or set MailDrop, again in mh_profile:

 MailDrop: /path/to/mail-drop

or set inc:

 inc: -file /path/to/mail-drop
Note: For each nmh command (see list below) the user can set default flags with a line of the form command: -flag format in mh_profile. These work much like bash aliases.

Nmh is also capable of retrieving mail via POP. A basic POP setup (see inc (1) man page for more):

 inc: -host example.com -user username -sasl

Usage

To become familiar with basic nmh usage, learn and practice the following commands:

Command Description
inc Incorporate new mail.
scan Scan the contents of the current folder.
folder/folders Change the current folder or list folders and their contents.
show Display messages.
comp Compose a new message.
repl Reply to a message.
refile Move a message to another folder.

See also