# MH-ALIAS(5mh) - man - phpMan

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



## NAME
       mh-alias - format of nmh email-address alias files

## DESCRIPTION
       Each line of an **nmh** alias file takes one of the following forms:

            _alias_ **:** _address-group_

            _alias_ **;** _address-group_

            **<** _alias-file_

            **;** | **:** | **#** _comment_

       where:

            _address-group_  := _address-list_
                           |  < _file_

            _address-list_   := _address_
                           |  _address-list_, _address_

       Continuation  lines  end with “\” followed by a newline character.  This also applies to com‐
       ment lines.  Thus, the line following a “\”-terminated comment line is a continuation of that
       comment line.

       _Alias-file_  and _file_ are Unix file names.  Alias file contents are case-insensitive, with the
       exception of filesystem path names.

       If the line starts with a “<”, the file named after the “<” is read for  more  alias  defini‐
       tions.  The reading is done recursively, so a “<” may occur in the beginning of an alias file
       with the expected results.

       If the _address-group_ starts with a “<”, the file named after the “<” is read and its contents
       are added to the _address-list_ for the alias.

       In match, a trailing “*” on an alias will match just about anything appropriate.

       An approximation of the way aliases are resolved at posting time is:

       1)     Build  a list of all addresses from the message to be delivered, eliminating duplicate
              addresses.

       2)     For those addresses in the message that have no host specified, perform alias  resolu‐
              tion.

       3)     For  each  line  in  the  alias  file, compare “alias” against all of the existing ad‐
              dresses.  If a match, remove the matched “alias” from the address list, and  add  each
              new address in the address-group to the address list if it is not already on the list.
              The alias itself is not usually output, rather the address-group that the  alias  maps
              to is output instead.  If “alias” is terminated with a “;” instead of a “:”, then both
              the “alias” and the address are output in the correct format (with the alias quoted if
              necessary and the address wrapped in <>).

       Since  the  _mh-alias_  file is read line by line, forward references work, but backward refer‐
       ences are not recognized.

### Example Alias File
            </etc/nmh/BBoardAliases
            sgroup: fred, fear, freida
            fred: <frated@UCI.example>
            b-people: Blind List: bill, betty
            Unix-committee: <unix.aliases
            news.*: news

       The  first  line  says  that  more  aliases  should  immediately  be  read  from   the   file
       **/etc/nmh/BBoardAliases**.   Next,  “sgroup”  is defined as an alias for three names, and one of
       them, “fred”, is a forward reference to another alias for “<frated@UCI.example>”.

       The alias “b-people” is a blind list which includes the addresses  “bill”  and  “betty”;  the
       message  will  be  delivered to those addresses, but the message header will show only “Blind
       List: ;” (not the addresses).  The alias must not be terminated with,  or  contain,  a  semi‐
       colon.  Note that blind lists are not supported with the **sendmail/pipe** mail transport method.

       The  definition  of  “Unix-committee” is given by reading the file _unix.aliases_ in the user's
       **nmh** directory.

       Lastly, “news._anything_” is aliased to “news”; the full stop is just another  literal  charac‐
       ter.

## PROFILE COMPONENTS
       Aliasfile:          Default alias file.

## FILES
       /etc/nmh/MailAliases
                           System-wide default alias file.

## SEE ALSO
       [_ali_(1)](https://www.chedong.com/phpMan.php/man/ali/1/markdown), [_send_(1)](https://www.chedong.com/phpMan.php/man/send/1/markdown), [_whom_(1)](https://www.chedong.com/phpMan.php/man/whom/1/markdown), [_getgrent_(3)](https://www.chedong.com/phpMan.php/man/getgrent/3/markdown), [_getpwent_(3)](https://www.chedong.com/phpMan.php/man/getpwent/3/markdown), [_post_(8)](https://www.chedong.com/phpMan.php/man/post/8/markdown)

## BUGS
       Although  the  forward-referencing  semantics of mh-alias files prevent recursion, the **alias-**
       **file** directive may defeat this.  Since the number of file descriptors is finite,  such  infi‐
       nite recursion will terminate with a meaningless diagnostic when all the fds are used up.

       Earlier  versions  of  this man page showed a semicolon at the end of the blind list example.
       That caused the preceding alias to not be expanded.  There must not be a semicolon at the end
       of,  or  within,  the  address  group of a blind list.  **post** will append the semicolon to the
       blind list name.



nmh-1.7.1                                    2014-04-18                                [MH-ALIAS(5mh)](https://www.chedong.com/phpMan.php/man/MH-ALIAS/5mh/markdown)
