MH aliases are used in the same way in MH-E as they are in MH. Any alias listed as a recipient will be expanded when the message is sent. This chapter discusses other things you can do with aliases in MH-E.
The following commands are available in MH-Letter mode with the
mh-alias-reload which can be called from anywhere.
Reload MH aliases.
The ‘mh-alias’ customization group contains options associated with aliases.
On means don’t consider case significant in MH alias completion (default: ‘on’).
On means to expand aliases entered in the minibuffer (default: ‘off’).
Specify whether to flash address or warn on translation (default: ‘Flash but Don't Warn If No Alias’).
Filename used to store a new MH-E alias (default: ‘Use Aliasfile Profile Component’).
Specifies where new aliases are entered in alias files (default: ‘Alphabetical’).
If ‘on’, local users are added to alias completion (default: ‘on’).
String prefixed to the real names of users from the password file
On means the GECOS field in the password file uses a comma separator (default: ‘on’).
The following hook is available.
Hook run by
mh-alias-reload after loading aliases (default:
You can use aliases when you are adding recipients to a message.
In order to use minibuffer prompting for recipients and the subject
line in the minibuffer, turn on the option
mh-compose-prompt-flag (see Composing), and use the
minibuffer-complete) command to complete aliases
(and optionally local logins) when prompted for the recipients. Turn
on the option
mh-alias-expand-aliases-flag if you want these
aliases to be expanded to their respective addresses in the draft.
Otherwise, you can complete aliases in the header of the draft with
mh-letter-complete) or SPC
As MH ignores case in the aliases, so too does MH-E. However, you may
turn off the option
make case significant which can be used to segregate completion of
your aliases. You might use uppercase for mailing lists and lowercase
for people. For example, you might have:
mark.baushke: Mark Baushke <email@example.com> MH-E: MH-E Mailing List <firstname.lastname@example.org>
When this option is turned off, if you were to type M in the ‘To:’ field and then M-TAB, then you’d get the list; if you started with m and then entered M-TAB, then you’d get Mark’s address. Note that this option affects completion only. If you were to enter Mark.Baushke, it would still be identified with your ‘mark.baushke’ alias.
To verify that the alias you’ve entered is valid, the alias will be
displayed in the minibuffer when you type a comma
mh-alias-minibuffer-confirm-address if the option
mh-compose-prompt-flag is turned on). See Composing. This
behavior can be controlled with the option
mh-alias-flash-on-comma which provides three choices:
‘Flash but Don't Warn If No Alias’, ‘Flash and Warn If No
Alias’, and ‘Don't Flash Nor Warn If No Alias’.
For another way to verify the alias expansion, see Checking Recipients.
MH-E loads aliases for completion and folder name hints from various
places. It uses the MH command
read aliases from the files listed in the profile component
‘Aliasfile:’ as well as system-wide aliases (for example,
In addition, aliases are created from /etc/passwd entries with a user ID larger than a magical number, typically 200. This can be a handy tool on a machine where you and co-workers exchange messages. These aliases have the form ‘local.first.last’ if a real name is present in the password file. Otherwise, the alias will have the form ‘local.login’.
The prefix ‘local.’ can be modified via the option
mh-alias-local-users-prefix. This option can also be set to
For example, consider the following password file entry:
psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
The following settings of option
will produce the associated aliases:
In the example above, commas are used to separate different values
within the so-called GECOS field. This is a fairly common usage.
However, in the rare case that the GECOS field in your password file
is not separated by commas and whose contents may contain commas, you
can turn the option
If you’re on a system with thousands of users you don’t know, and the
loading of local aliases slows MH-E down noticeably, then the local
alias feature can be disabled by turning off the option
mh-alias-local-users. This option also takes a string which is
executed to generate the password file. For example, use ‘ypcat
passwd’ to obtain the NIS password file.
Since aliases are updated frequently, MH-E reloads aliases
automatically whenever an alias lookup occurs if an alias source has
changed. However, you can reload your aliases manually by calling the
command M-x mh-alias-reload directly. This command runs
mh-alias-reloaded-hook after the aliases have been loaded.
In the past, you have manually added aliases to your alias file(s) listed in your ‘Aliasfile:’ profile component. MH-E provides other methods for maintaining your alias file(s).
You can use the M-x mh-alias-add-alias command which will prompt you for the alias and address that you would like to add. If the alias exists already, you will have the choice of inserting the new alias before or after the old alias. In the former case, this alias will be used when sending mail to this alias. In the latter case, the alias serves as an additional folder name hint when filing messages (see Folder Selection).
Earlier, the alias prefix ‘local’ was presented. You can use other prefixes to organize your aliases or disambiguate entries. You might use prefixes for locales, jobs, or activities. For example, I have:
; Work attensity.don.mitchell: Don Mitchell <email@example.com> isharp.don.mitchell: Don Mitchell <firstname.lastname@example.org> ... ; Sport diving.ken.mayer: Ken Mayer <email@example.com> sailing.mike.maloney: Mike Maloney <firstname.lastname@example.org> ... ; Personal ariane.kolkmann: Ariane Kolkmann <ArianeKolkmann@stop.mail-abuse.com> ...
Using prefixes instead of postfixes helps you explore aliases during completion. If you forget the name of an old dive buddy, you can enter ‘div’ and then SPC to get a listing of all your dive buddies.
An alias for the sender of the current message is added automatically by clicking on the ‘Grab From alias’ tool bar button or by running the M-x mh-alias-grab-from-field command. Aliases for other recipients of the current message are added by placing your cursor over the desired recipient and giving the M-x mh-alias-add-address-under-point command.
mh-alias-insertion-location controls how and where these aliases
The default setting of option
mh-alias-insert-file is ‘Use
Aliasfile Profile Component’. This option can also hold the name of a
file or a list a file names. If this option is set to a list of file
names, or the ‘Aliasfile:’ profile component contains more than
one file name, MH-E will prompt for one of them.
mh-alias-insertion-location is set to
‘Alphabetical’ by default. If you organize your alias file in
other ways, then the settings ‘Top’ and ‘Bottom’ might be
If you can’t quite remember an alias, you can use M-x mh-alias-apropos to show all aliases or addresses that match a regular expression (see the section Syntax of Regular Expressions in The GNU Emacs Manual).