Next: メールコマンド, Previous: メールヘッダーフィールド, Up: メールの送信 [Contents][Index]
メールエイリアス(mail
aliases)を定義することができます。これは1つ以上のメールアドレスを意味する短い呼び名です。デフォルトでは、メールエイリアスはファイル~/.mailrcで定義されます。変数mail-personal-alias-file
をセットすることにより、異なるファイル名を指定できます。
~/.mailrcでエイリアスを定義するには、以下のように記述します:
alias nick fulladdresses
これはnickがfulladdressesに展開されるという意味で、fulladdressesは単一のアドレス、またはスペースで区切られた複数のアドレスです。たとえばmaingnu
が、gnu@gnu.org
とあなた自身のローカルのアドレスを意味するよう定義するには、以下の行を記述します:
alias maingnu gnu@gnu.org local-gnu
アドレスにスペースが含まれる場合は、以下のようにダブルクォートでアドレス全体をクォートします:
alias jsmith "John Q. Smith <none@example.com>"
その人の名前の部分などのような、アドレスの特定の部分をダブルクォートで括る必要はないことに注意してください。Emacsは必要に応じてそれらを挿入します。たとえば上記のアドレスは‘"John Q. Smith" <none@example.com>’のように挿入されます。
After editing the ~/.mailrc file, or if the file was modified outside
of Emacs, you can update the mail aliases used by a running Emacs session
with M-x rebuild-mail-abbrevs RET. This prompts for the
name of the file to use, the default being the value of
mail-personal-alias-file
. A similar command
merge-mail-abbrevs
prompts for a file with mail aliases, then merges
the aliases in that file with the existing ones.
Alternatively, you can use Emacs commands to define mail aliases. The
command define-mail-abbrev
prompts for the alias and the full
address, and defines the alias to expand to the full address. Emacs will
save the added aliases whenever it offers to save all files (for C-x s
or C-x C-c), like it does with other abbrevs (see abbrevの保存).
Emacsは、~/.mailrcでのincludeコマンドも識別します。これらは以下のようなものです:
source filename
ファイル~/.mailrcは、Emacsだけのものではありません。他の多くのメールを閲覧するプログラムが、メールアドレスのためにこれを使用し、他にもさまざまなコマンドが含まれます。しかしEmacsは、エイリアスの定義とインクルードコマンド以外のすべてを無視します。
メールエイリアスはabbrevのように — つまり、エイリアスの後で単語区切り文字をタイプするとすぐに — 展開されます。この展開はヘッダーフィールド‘To’、‘From’、‘CC’、‘BCC’、‘Reply-To’(およびそれらの‘Resent-’の変種)だけで展開されます。‘Subject’のような、他のヘッダーフィールドでは展開されません。
コマンドM-x mail-abbrev-insert-aliasを使って、エイリアスされたアドレスを直接挿入することもできます。これは補完つきでエイリアス名を読み取り、ポイント位置にそれの定義を挿入します。
The command mail-abbrev-complete-alias
completes on the mail alias
preceding point.