📄 mh-alias.rf
字号:
.\" @(MHWARNING).\" @(#)$Id: mh-alias.rf,v 1.11 1992/12/11 21:44:16 jromine Exp $.SC MH-ALIAS 5.NAmh-alias \- alias file for MH message system.SYany \fIMH\fR command.DEThis describes both \fIMH\fR personal alias files andthe (primary) alias file for mail delivery, the file @(MHETCPATH)/MailAliasesIt does \fBnot\fR describe aliases files used by the message transport system.Each line of the alias file has the format: alias : address\-group.bror.br alias ; address\-group.bror.br < alias\-file.bror.br ; comment.brwhere: address\-group := address\-list.br | \*(lq<\*(rq file.br | \*(lq=\*(rq UNIX\-group.br | \*(lq+\*(rq UNIX\-group.br | \*(lq*\*(rq.br address\-list := address.br | address\-list, address.brContinuation lines in alias files end with `\\' followed by the newlinecharacter.Alias\-file and file are UNIX file names.UNIX\-group is a group name (or number) from \fI/etc/group\fR.An address is a \*(lqsimple\*(rq Internet\-style address.Througout this file, case is ignored, except for alias\-file names.If the line starts with a `<', then the file named after the `<' isread for more alias definitions. 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 `<',then the file named after the `<' is read and its contents are added tothe address\-list for the alias.If the address\-group starts with an `=',then the file \fI/etc/group\fR is consultedfor the UNIX\-group named after the `='.Each login name occurring as a member of the group is added to theaddress\-list for the alias.In contrast, if the address\-group starts with a `+',then the file \fI/etc/group\fR is consultedto determine the group\-id of the UNIX\-group named after the `+'.Each login name occurring in the \fI/etc/passwd\fR file whose group\-idis indicated by this group is added to the address\-list for the alias.If the address\-group is simply `*',then the file \fI/etc/passwd\fR is consultedand all login names with a userid greater than some magic number(usually 200) are added to the address\-list for the alias.In match, a trailing * on an alias will match just about anything appropriate.(See example below.)An approximation of the way aliases are resolved at posting time is(it's not really done this way):.in +.5i1) Build a list of all addresses from the message to bedelivered, eliminating duplicate addresses.2) If this draft originated on the local host,then for those addresses in the message that have no host specified,perform alias resolution.3) For each line in the alias file,compare \*(lqalias\*(rq against all of the existing addresses.If a match, remove the matched \*(lqalias\*(rq from the address list,and add each new address in the address\-group to the address listif 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 \*(lqalias\*(rq is terminated with a `;' instead of a `:',then both the \*(lqalias\*(rq and the address are outputin the correct format.(This makes replies possible since \fIMH\fR aliases andpersonal aliases are unknown to the mail transport system.).in -.5iSince the alias file is read line by line, forward referenceswork, but backward references are not recognized, thus, there isno recursion..ne 10\fBExample:\fR.nf.in +.5i<@(MHETCPATH)/BBoardAliasessgroup: fred, fear, freidab-people: Blind List: bill, betty;fred: frated@UCIUNIX\-committee: <unix.aliasesstaff: =staffwheels: +wheeleveryone: *news.*: news.in -.5i.fiThe first line says that more aliases should immediately be read fromthe file \fI@(MHETCPATH)/BBoardAliases\fR.Following this, \*(lqfred\*(rq is defined as an alias for\*(lqfrated@UCI\*(rq,and \*(lqsgroup\*(rq is defined as an alias for the three names \*(lqfrated@UCI\*(rq, \*(rqfear\*(rq, and \*(rqfreida\*(rq..spThe alias \*(lqb-people\*(rq is a blind list which includes theaddresses \*(lqbill\*(rq and \*(lqbetty\*(rq; the messagewill be delieved to those addresses, but themessage header will show only \*(lqBlind List: ;\*(rq (not the addresses)..spNext, the definition of \*(lqUNIX\-committee\*(rq is given by readingthe file \fIunix.aliases\fR in the users \fIMH\fR directory,\*(lqstaff\*(rq is defined as all users who are listed as members ofthe group \*(lqstaff\*(rq in the \fI/etc/group\fR file,and \*(lqwheels\*(rq is defined as all users whose group\-id in\fI/etc/passwd\fR is equivalent to the \*(lqwheel\*(rq group..spFinally, \*(lqeveryone\*(rq is defined as all users with a user\-id in\fI/etc/passwd\fR greater than 200,and all aliases of the form \*(lqnews.<anything>\*(rq are definedto be \*(lqnews\*(rq.The key thing to understand about aliasing in \fIMH\fRis that aliases in \fIMH\fR alias files are expanded into theheaders of messages posted.This aliasing occurs first,at posting time,without the knowledge of the message transport system.In contrast,once the message transport system is given a message to deliverto a list of addresses,for each address that appears to be local,a system\-wide alias file is consulted.These aliases are \fBNOT\fR expanded into the headers of messages delivered..HhTo use aliasing in \fIMH\fR quickly, do the following:.in +.5iFirst, in your \fI\&.mh\(ruprofile\fR,choose a name for your alias file, say \*(lqaliases\*(rq,and add the line:.nf.in +.5iAliasfile: aliases.\" ali: \-alias aliases.\" send: \-alias aliases.\" whom: \-alias ailases.in -.5i.fiSecond, create the file \*(lqaliases\*(rq in your \fIMH\fR directory.Third, start adding aliases to your \*(lqaliases\*(rq file as appropriate..in -.5i.Fi^@(MHETCPATH)/MailAliases~^Primary alias file.Pr^Aliasfile:~^For a default alias file.Saali(1), send(1), whom(1), group(5), passwd(5), conflict(8), post(8).DeNone.CoNone.HiIn previous releases of \fIMH\fR,only a single, system\-wide mh\-alias file was supported.@BEGIN: MMDFMTSNow that \fIMH\fR uses \fIMMDF\fR as a transport system,the system\-wide aliasing facility can be more consistently controlled by thelatter.This means that at most sites,the system\-wide mh\-alias file will be empty (or trivial at best).@END: MMDFMTS@BEGIN: MHMTSThis led to a number of problems,since only mail\-system administrators were capable of (un)definingaliases.@END: MHMTS@BEGIN: SENDMTSThis led to a number of problems,since only mail\-system administrators were capable of (un)definingaliases.@END: SENDMTSHence,the semantics of mh\-alias were extended to support personal alias files.Users of \fIMH\fR no longer need to bother mail\-system administrators forkeeping information in the system\-wide alias file,as each \fIMH\fR user can create/modify/remove aliases at will from anynumber of personal files..BuAlthough the forward-referencing semantics of \fImh\-alias\fR files preventrecursion, the \*(lq<\ alias\-file\*(rq command may defeat this. Since thenumber of file descriptors is finite (and very limited), such infiniterecursion will terminate with a meaningless diagnostic when all the fds areused up..spForward references do not work correctly inside blind lists..En
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -