# man > dist(1mh)

[DIST(1mh)](https://www.chedong.com/phpMan.php/man/DIST/1mh/markdown)                                                                                  [DIST(1mh)](https://www.chedong.com/phpMan.php/man/DIST/1mh/markdown)



## NAME
       dist - distribute an nmh message to additional addresses

## SYNOPSIS
       **dist** [**-help**] [**-version**] [_+folder_] [_msg_] [**-form** _formfile_] [**-annotate** | **-noannotate**] [**-inplace**
            | **-noinplace**] [**-draftfolder** _+folder_] [**-draftmessage** _msg_] [**-nodraftfolder**] [**-editor** _edi__‐
            _tor_] [**-noedit**] [**-width** _columns_] [**-from** _address_] [**-to** _address_] [**-cc** _address_] [**-fcc**
            _+folder_] [**-whatnowproc** _program_] [**-nowhatnowproc**] [**-atfile**] [**-noatfile**]

## DESCRIPTION
       **dist** is similar to **forw**.  It prepares the specified message for redistribution  to  addresses
       that (presumably) are not on the original address list.

       The default message form contains the following elements:

            Resent-From: {from switch} or <Local-Mailbox> or <username@hostname>
            Resent-To: {to switch} or blank
            Resent-cc: {cc switch} or blank
            Resent-fcc: {fcc switch} or blank

       If  a  file  named “_distcomps_” exists in the user's nmh directory, it will be used instead of
       this default form.  You may specify an alternate forms file with the switch  **-form**  _formfile_.
       Forms  are  processed  via the **nmh** template system; see [_mh-format_(5)](https://www.chedong.com/phpMan.php/man/mh-format/5/markdown) for details.  Components
       from the redistributed message are available as standard component escapes in the forms file.

       In addition to the standard [_mh-format_(5)](https://www.chedong.com/phpMan.php/man/mh-format/5/markdown) escapes, the following _component_  escapes  are  also
       supported:

            _Escape_    _Returns_   _Description_
            fcc       string    Any folders specified with `-fcc folder'
            nmh-from  string    Addresses specified with `-from address'
            nmh-to    string    Addresses specified with `-to address'
            nmh-cc    string    Addresses specified with `-cc address'

       See the [_forw_(1)](https://www.chedong.com/phpMan.php/man/forw/1/markdown) man page for descriptions of the **-from**, **-to**, **-cc**, and **-fcc** switches.

       If  the  draft already exists, **dist** will ask you as to the disposition of the draft.  A reply
       of **quit** will abort **dist**, leaving the draft intact; **replace** will replace  the  existing  draft
       with a blank skeleton; and **list** will display the draft.

       Only  those addresses in “_Resent-To:_”, “_Resent-cc:_”, and “_Resent-Bcc:_” will be sent.  Also, a
       “_Resent-Fcc:_ _folder_” will be honored (see [_send_(1)](https://www.chedong.com/phpMan.php/man/send/1/markdown)).  Note that with **dist**,  the  draft  should
       contain only “_Resent-xxx:_” fields and no body.  The headers and the body of the original mes‐
       sage are copied to the draft when the message is sent.  Use care in constructing the  headers
       for the redistribution.

       Because the draft is minimal, the [_prompter_(1)](https://www.chedong.com/phpMan.php/man/prompter/1/markdown) editor is quite useful with **dist**.

       If  the  **-annotate** switch is given, the  message being distributed will be annotated with the
       lines:
              Resent: date
              Resent: addrs
       where each address list contains as many lines as required.  This  annotation  will  be  done
       only  if the message is sent directly from **dist**.  If the message is not sent immediately from
       **dist**, “**comp** **-use**” may be used to re-edit and send the constructed message,  but  the  annota‐
       tions  won't  take  place.   Normally  annotations are done in place in order to preserve any
       links to the message.  You may use the **-noinplace** switch to change this.

       See [_comp_(1)](https://www.chedong.com/phpMan.php/man/comp/1/markdown) for a description of the **-editor** and **-noedit** switches.  Note that  while  in  the
       editor,  with  **-atfile**  and if the current directory is writable, the message being resent is
       available through a link named “@” (assuming the default _whatnowproc_).  In addition, the  ac‐
       tual pathname of the message is stored in the environment variable **$editalt**, and the pathname
       of the folder containing the message is stored in the environment  variable  **$mhfolder**.   The
       creation of the “@” file is controlled via the **-atfile** and **-noatfile** options.

       The **-draftfolder** _+folder_ and **-draftmessage** _msg_ switches invoke the **nmh** draft folder facility.
       This is an advanced (and highly useful) feature.  Consult the [_mh-draft_(5)](https://www.chedong.com/phpMan.php/man/mh-draft/5/markdown) man page  for  more
       information.

       Upon  exiting  from  the  editor, **dist** will invoke the **whatnow** program.  See [_whatnow_(1)](https://www.chedong.com/phpMan.php/man/whatnow/1/markdown) for a
       discussion of available options.  The invocation of this program can be  inhibited  by  using
       the  **-nowhatnowproc**  switch.   (In  fact,  it is the **whatnow** program which starts the initial
       edit.  Hence, **-nowhatnowproc** will prevent any edit from occurring.)

## FILES
       /etc/nmh/distcomps  The default message skeleton.
       <mh-dir>/distcomps  The user's message skeleton.
       $HOME/.mh_profile   The user's profile.
       <mh-dir>/draft      The draft file.

## PROFILE COMPONENTS
       Path:               To determine the user's nmh directory.
       Current-Folder:     To find the default current folder.
       Draft-Folder:       To find the default draft-folder.
       Editor:             To override the default editor.
       fileproc:           Program to refile the message.
       whatnowproc:        Program to ask the “What now?” questions.

## SEE ALSO
       [_comp_(1)](https://www.chedong.com/phpMan.php/man/comp/1/markdown), [_forw_(1)](https://www.chedong.com/phpMan.php/man/forw/1/markdown), [_prompter_(1)](https://www.chedong.com/phpMan.php/man/prompter/1/markdown), [_repl_(1)](https://www.chedong.com/phpMan.php/man/repl/1/markdown), [_send_(1)](https://www.chedong.com/phpMan.php/man/send/1/markdown), [_whatnow_(1)](https://www.chedong.com/phpMan.php/man/whatnow/1/markdown)

## DEFAULTS
       +folder             The current folder.
       msg                 The current message.
### -noannotate
### -nodraftfolder
### -inplace
### -noatfile

## CONTEXT
       If a folder is given, it will become the current folder.  The message distributed will become
       the current message.

## HISTORY
       **dist**  originally used headers of the form “_Distribute-xxx:_” instead of “_Resent-xxx:_”.  In or‐
       der to conform with the ARPA Internet standard, RFC 822, the “_Resent-xxx:_” form is now  used.
       **dist**  will  recognize  “_Distribute-xxx:_”  type headers and automatically convert them to “_Re__‐
       _sent-xxx:_”.

## BUGS
       **dist** does not rigorously check the message being distributed for adherence to  the  transport
       standard,  but  **post**  called  by  **send**  does.  The **post** program will balk (and rightly so) at
       poorly formatted messages, and **dist** won't correct things for you.

       If _whatnowproc_ is **whatnow**, then **comp** uses a built-in **whatnow**, it does not  actually  run  the
       **whatnow** program.  Hence, if you define your own _whatnowproc_, don't call it **whatnow** since **comp**
       won't run it.



nmh-1.7.1                                    2012-12-04                                    [DIST(1mh)](https://www.chedong.com/phpMan.php/man/DIST/1mh/markdown)
