# mh-draft(5mh) - man - phpMan

[MH-DRAFT(5mh)](https://www.chedong.com/phpMan.php/man/MH-DRAFT/5mh/markdown)                                                                          [MH-DRAFT(5mh)](https://www.chedong.com/phpMan.php/man/MH-DRAFT/5mh/markdown)



## NAME
       mh-draft - draft folder facility for nmh message system

## DESCRIPTION
       There are a number of interesting advanced facilities for the composition of outgoing mail.

### The Draft Folder
       The  **comp**,  **dist**,  **forw**,  **repl**,  **send**,  and **whom** commands each take the switches **-draftfolder**
       _+folder_ and **-draftmessage** _msg_, which allow you to manipulate the various draft  messages  you
       are composing.

       If  **-draftfolder** _+folder_ is used, draft messages will be constructed in the indicated folder.
       The “_Draft-Folder_” profile entry may be used to specify a default draft folder.

       If the switch **-draftmessage** _msg_ is given, the specified draft is used to compose the message.
       If  **-draftmessage**  _msg_ is not used, then the draft defaults to `new' (create a new draft) un‐
       less the user invokes **comp** with **-use**, in which case the default is `cur'.

       Hence, the user may have several message compositions in progress simultaneously.   Now,  all
       of  the **nmh** tools are available on each of the user's message drafts (e.g.  **show**, **scan**, **pick**,
       and so on).  If the folder does not exist, the user is asked if it should  be  created  (just
       like  with  **refile**).   The last draft message the user was composing is known as `cur' in the
       draft folder.

       Using **send**, the user can send drafts using the standard **nmh** `msgs' convention with **-draftmes**‐‐
       **sage** _msgs_.  If no `msgs' are given, it defaults to `cur'.

       In addition, all of these programs have a **-nodraftfolder** switch, which undoes the last occur‐
       rence of **-draftfolder** _folder_ (useful if a default is specified in the user's **nmh** profile).

       If the user does not give the **-draftfolder** _+folder_ switch, then all these commands act  “nor‐
       mally”.  Note that the **-draft** switch to **send** and **show** still refers to the file called `draft'
       in the user's **nmh** directory.  In the interests of economy of expression, when using  **comp**  or
       **send**,  the  user  needn't prefix the draft `msg' or `msgs' with **-draftmessage**.  Both of these
       commands accept a `file' or `files' argument and they will, if  given  **-draftfolder**  _+folder_,
       treat these arguments as `msg' or `msgs'.  (This may appear to be inconsistent, at first, but
       it saves a lot of typing.)  Hence,

              send -draftfolder +drafts first

       is the same as

              send -draftfolder +drafts -draftmessage first

       To make all this a bit more clear, here are some examples.  Let's assume that  the  following
       entries are in the **nmh** profile:

            Draft-Folder: drafts
            sendf: -draftfolder +drafts

       Furthermore,  let's  assume  that  the  program  **sendf**  is  a  (symbolic)  link in the user's
       _$HOME/bin/_ directory to **send**.  Now,

            comp
            dist
            forw
            repl

       will construct the message draft in the `draft' folder using the `new' message number.   Fur‐
       thermore,  they  each define `cur' in this folder to be that message draft.  If the user were
       to use the **quit** option at the `What now?' prompt, then later on, if no other  draft  composi‐
       tion was done, the draft could be sent with simply

            sendf

       Or, if more editing was required, the draft could be edited with

            comp -use

       If  other  drafts had been composed in the meantime, so that this message draft was no longer
       known as `cur' in the `draft' folder, then the user could **scan** the folder to see  which  mes‐
       sage  draft  should  be  used for editing or sending.  Clever users could even employ a back‐
       quoted **pick** to do the work:

            comp -use `pick +drafts -to nmh-workers`

       or

            sendf `pick +drafts -to nmh-workers`

       Note that in the **comp** example, the output from **pick** must resolve to a  single  message  draft
       (it  makes  no sense to talk about composing two or more drafts with one invocation of **comp**).
       In contrast, in the **send** example, as many message drafts as desired can  appear,  since  **send**
       doesn't mind sending more than one draft at a time.

       Note  that  the  argument **-draftfolder** _+folder_ is not included in the profile entry for **send**,
       since when **comp**, et al, invoke **send** directly, they supply **send** with the Unix pathname of  the
       message draft; _not_ a **-draftmessage** _msg_ argument.  As far as **send** is concerned, a draft folder
       is not being used.

       It is important to realize that **nmh** treats the draft folder like a  standard  **nmh**  folder  in
       nearly all respects.  There are two exceptions:

       First,  under  no circumstances will the **-draftfolder** _folder_ switch cause the named folder to
       become the current folder.  Obviously, if the folder appeared in the context  of  a  standard
       _+folder_ argument to an **nmh** program, as in

            scan +drafts

       it  might  become  the current folder, depending on the context changes of the **nmh** program in
       question.

       Second, although conceptually **send** deletes the `msgs' named in the draft folder, it does  not
       call _delete-prog_ to perform the deletion.

### What Happens if the Draft Exists
       When  the **comp**, **dist**, **forw**, and **repl** commands are invoked and the draft you indicated already
       exists, these programs will prompt the user for a response directing  the  program's  action.
       The prompt is

            Draft ``/home/foobar/nmhbox/draft'' exists (xx bytes).
            Disposition?

       The appropriate responses and their meanings are:

            **replace**   deletes the draft and starts afresh
            **list**      lists the draft
            **refile**    files the draft into a folder and starts afresh
            **quit**      leaves the draft intact and exits

       In  addition,  if  you  specified **-draftfolder** _folder_ to the command, then one other response
       will be accepted:

            **new**       creates a new draft

       just as if **-draftmessage** _new_ had been given.  Finally, the **comp** command will accept one  more
       response:

            **use**       re-uses the draft

       just as if **-use** had been given.

## FILES
       $HOME/.mh_profile   The user's profile.

## PROFILE COMPONENTS
       Draft-Folder:       For a default draft folder

## CONTEXT
       None



nmh-1.7.1                                    2012-03-18                                [MH-DRAFT(5mh)](https://www.chedong.com/phpMan.php/man/MH-DRAFT/5mh/markdown)
