MH-ALIAS(5mh)
π NAME π
mh-alias β it's giving the format of nmh email-address alias files, and honestly? it's iconic. This is the MH-ALIAS(5mh) page, bestie, so buckle up. π
β¨ DESCRIPTION β¨
okay so every single line of an nmh alias file is one of these four forms, no exceptions, periodt:
alias : address-group
alias ; address-group
< alias-file
; | : | # comment
and where those lil pieces come from:
address-group := address-list
| < file
address-list := address
| address-list, address
Continuation lines end with \ followed by a newline character. And yes this applies to comment lines too β so the line right after a \-terminated comment line is literally 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 (those stay picky, as they should π«Ά).
If the line starts with a <, the file named after the < is read for more alias definitions. And 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. slay.
An approximation of the way aliases are resolved at posting time is:
- Build a list of all addresses from the message to be delivered, eliminating duplicate addresses.
- For those addresses in the message that have no host specified, perform alias resolution.
- For each line in the alias file, compare
aliasagainst all of the existing addresses. If a match, remove the matchedaliasfrom 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. Ifaliasis terminated with a;instead of a:, then both thealiasand 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 references are not recognized. not me finding out the hard way π
πΈ 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 semicolon. 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 character. no cap.
π PROFILE COMPONENTS π
Aliasfile:β Default alias file. β¨
π FILES π
/etc/nmh/MailAliasesβ System-wide default alias file.
π¦ SEE ALSO π¦
ali(1), send(1), whom(1), getgrent(3), getpwent(3), post(8)
π 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 infinite recursion will terminate with a meaningless diagnostic when all the fds are used up. it's giving chaos, bestie π
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. π
okay that's the whole page, you ate it, go post some mail π
this was nmh-1.8, dated 2014-04-18 β mwah, xoxo, the manual page π
π¦ where this page comes from
- debian trixie: nmh 1.8-3
- ubuntu noble: nmh 1.8-1build4
- ubuntu questing: nmh 1.8-3
- ubuntu resolute: nmh 1.8-4
- ubuntu stonking: nmh 1.8-4build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms