<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>makealiases</title><link rel="stylesheet" type="text/css" href="style.css"/><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"/><link rel="home" href="#idm255233240784" title="makealiases"/><link xmlns="" rel="stylesheet" type="text/css" href="manpage.css"/><meta xmlns="" name="MSSmartTagsPreventParsing" content="TRUE"/><link xmlns="" rel="icon" href="icon.gif" type="image/gif"/><!--

Copyright 1998 - 2009 Double Precision, Inc.  See COPYING for distribution
information.

--></head><body><div class="refentry"><a id="idm255233240784" shape="rect"> </a><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>makealiases — Create an alias database</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">makealiases</code>  [-protocol=<em class="replaceable"><code>protocol</code></em>] [-alias=<em class="replaceable"><code>filename</code></em>] [-src=<em class="replaceable"><code>pathname</code></em>] [-tmp=<em class="replaceable"><code>filename</code></em>] [-chk] [-dump] [<em class="replaceable"><code>module</code></em>]</p></div></div><div class="refsect1"><a id="idm255232416256" shape="rect"> </a><h2>DESCRIPTION</h2><p>
The <span class="application">Courier</span> mail server's
<code class="filename">@sysconfdir@/aliases.dat</code> file is a unified
implementation of sendmail-style address aliasing, qmail-style virtual
domains, plus several
<span class="application">Courier</span> mail server-style
enhancements.</p><p>
The term <span class="emphasis"><em>aliasing</em></span>
refers to substituting one or more addresses for
another address. A one-to-one substitution results in the
<span class="application">Courier</span> mail server accepting mail
for one address, and delivering the mail to another address. A one-to-many
substitution results in the <span class="application">Courier</span>
mail server accepting mail for one address, and delivering
a separate copy of the message to every address defined by the alias.</p><p>
<code class="filename">@sysconfdir@/aliases.dat</code> is a binary database file.
<span class="command"><strong>makealiases</strong></span> creates the binary database file by reading the
aliases from plain text files, and <span class="command"><strong>makealiases</strong></span> creates
<code class="filename">@sysconfdir@/aliases.dat</code> by default.</p><p>
<span class="command"><strong>makealiases</strong></span> creates <code class="filename">@sysconfdir@/aliases.dat</code> from
one or more source files, which are plain text files that may be created by
any text editor. The format of those source files is defined below. By
default, <span class="command"><strong>makealiases</strong></span> obtains the source text from
<code class="filename">@sysconfdir@/aliases</code>. If this is a text file, it is used
verbatim. If this is a directory (the
<span class="application">Courier</span> mail server creates it as
a directory by
default), all the non-hidden files in this directory are concatenated
together.</p></div><div class="refsect1"><a id="idm255232402592" shape="rect"> </a><h2>OPTIONS</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-alias=<em class="replaceable"><code>filename</code></em></span></dt><dd><p>
Create <em class="replaceable"><code>filename</code></em>, instead of
<code class="filename">@sysconfdir@/aliases.dat</code>.</p></dd><dt><span class="term">-chk</span></dt><dd><p>
Try to search for bad addresses used in the
<code class="filename">aliases.dat</code> file. This option takes some time to
complete. It
does not create an <code class="filename">aliases.dat</code> file, but instead tries to
check every address specified by the source text file. Why is this
necessary? That's because non-delivery reports will not be sent to the
sender for failures in delivering mail to an aliased address. This is by
design. the <span class="application">Courier</span> mail server
considers aliases to be private mailing lists. Because
non-delivery notices are not sent, bad addresses will not be immediately
detected.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
The <code class="option">-chk</code> option is really effective for
addresses which are local, because there is no real way to determine if a
remote mail address is valid.</p></div></dd><dt><span class="term">-dump</span></dt><dd><p>
Do not create <code class="filename">aliases.dat</code>, instead
display the contents of the alias database, in plain text form. The
contents will be the combined contents of all the source files, with all
addresses converted to canonical format, with duplicates removed and
sub-aliases expanded.</p></dd><dt><span class="term">-src=<em class="replaceable"><code>pathname</code></em></span></dt><dd><p>
Use <em class="replaceable"><code>pathname</code></em> instead of
<code class="filename">@sysconfdir@/aliases</code> as the source file.
<em class="replaceable"><code>pathname</code></em> can
also refer to a directory. This concatenates every non-hidden file in the
directory.</p></dd><dt><span class="term">-tmp=<em class="replaceable"><code>filename</code></em></span></dt><dd><p>
Use <em class="replaceable"><code>filename</code></em> as a temporary
file, instead of <code class="filename">@sysconfdir@/aliases.tmp</code>.
<span class="command"><strong>makealiases</strong></span> requires a temporary file for its own purposes,
which is automatically removed when done. This temporary file MUST reside
on the same filesystem as <code class="filename">aliases.dat</code>. If the
<code class="option">-alias</code> option specifies a file on a different filesystem, use
this option to specify where to temporary place a file in the same
filesystem. Because <span class="command"><strong>makealiases</strong></span> always uses the same name
for
a temporary file you cannot run more than one <span class="command"><strong>makealiases</strong></span>
process at the same time.</p></dd><dt><span class="term">-protocol=<em class="replaceable"><code>protocol</code></em></span></dt><dd><p>
Use an alias list that's
private to messages coming from <em class="replaceable"><code>protocol</code></em>.  See below.</p></dd></dl></div><p>
The optional <em class="replaceable"><code>module</code></em> specifies the module
whose rewriting rules are used
to convert E-mail addresses into a canonical form. If not specified, the
<code class="literal">local</code> module's address rewriting rules will be used.</p></div><div class="refsect1"><a id="idm255232392224" shape="rect"> </a><h2>PROTOCOL ALIASES</h2><p>Addresses in <code class="filename">@sysconfdir@/aliases.dat</code> will be checked in every
message.  Use the <code class="option">-protocol</code> option to create aliases that will be
checked only for message that are received via a specific protocol, such as
ESMTP, UUCP, or locally-generated mail. This allows you, for example, to
create an alias such as "everyone", which is only avaliable to locally
generated mail, and does not work for mail received via ESMTP. The argument to
the <code class="option">-protocol</code> option is one of: <code class="literal">esmtp</code>,
<code class="literal">uucp</code>, or <code class="literal">local</code>.</p><p>Protocol-specific alias files are
<code class="filename">@sysconfdir@/aliases-<em class="replaceable"><code>protocol</code></em>.dat</code>, where "<em class="replaceable"><code>protocol</code></em>"
is the specific protocol, such as "local", "esmtp", or "uucp", and the source
file read by <span class="command"><strong>makealiases</strong></span> would be
<code class="filename">@sysconfdir@/aliases-<em class="replaceable"><code>protocol</code></em></code>. If the
<code class="option">-protocol</code> option is specified, <span class="command"><strong>makealiases</strong></span> will
access these files instead of <code class="filename">@sysconfdir@/aliases.dat</code> and
<code class="filename">@sysconfdir@/aliases</code>.</p></div><div class="refsect1"><a id="idm255232381808" shape="rect"> </a><h2>ALIAS SPECIFICATIONS</h2><p>
The sources file used to create the binary <code class="filename">aliases.dat</code>
database are plain text files that may be created using any editor.</p><p>
Each alias specification takes the following form:</p><div class="informalexample"><pre class="programlisting" xml:space="preserve">
alias: address1, address2, ...
</pre></div><p>
Mail received by the <span class="application">Courier</span> mail
server addressed to <em class="replaceable"><code>alias</code></em> will be delivered to the
list of addresses specified. The list of addresses may be split across
multiple lines, if the second and subsequent line starts with a space
character.</p><p>
Lines starting with the # character are ignored, they are comments.</p><p>
<em class="replaceable"><code>alias</code></em> is not restricted to be a local address.
It may be any valid
<a class="ulink" href="http://www.rfc-editor.org/rfc/rfc822.txt" target="_top" shape="rect">RFC 2822</a>
address. All addresses do not necessary have to be in a canonical
form.</p><div class="informalexample"><pre class="programlisting" xml:space="preserve">
alias: :include:/absolute/pathname
</pre></div><p>
This notation reads the list of addresses from another file,
<em class="replaceable"><code>/absolute/pathname</code></em>.
This file should contain one address per line
(comma separated addresses on the same line will also work).</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
If <em class="replaceable"><code>alias</code></em> refers to a local, existing,
account, this
account will never get any mail. Any mail with the account listed as recipient
will be redirected to all the addresses specified for that alias. To have a
copy of the mail delivered to the account, define it as one of the addresses
in the alias itself. For example:</p><div class="informalexample"><pre class="programlisting" xml:space="preserve">
larry: larry, moe, curly, shemp
</pre></div><p>
Larry will still receive his mail, but copies will will also be sent to Moe,
Curly, and Shemp. If Larry wasn't specified in the alias, he would never get
any mail, it will all be forwarded to Moe, Curly, and Shemp.</p></div></div><div class="refsect1"><a id="idm255232370192" shape="rect"> </a><h2>DUPLICATE ADDRESSES</h2><p>
Alias definitions may refer to other alias definitions, and
<span class="command"><strong>makealiases</strong></span> automatically incorporates addresses from other
aliases. If the same address is listed in multiple aliases, and two or more of
them are specified as recipients of the same message, only one copy of the
message will be delivered to the address.</p></div><div class="refsect1"><a id="idm255232368160" shape="rect"> </a><h2>VIRTUAL DOMAINS</h2><p>
The following special syntax implements a virtual domain. A
virtual domain redirects all mail for an entire domain to one user:</p><div class="informalexample"><pre class="programlisting" xml:space="preserve">
@domain: user
</pre></div><p>
This special entry results in any recipient address of the form
<code class="literal">foo@domain</code> to be rewritten as
<code class="literal">user-foo@me</code>, where
<em class="replaceable"><code>me</code></em> is the hostname of the machine,
which we expect to be a local domain.</p><p>
The following examples use the alias entry "<code class="literal">@example.com:
john</code>", and "<code class="literal">domain.com</code>" is in the
<code class="filename">control/me</code>
file. The address "<code class="literal">postmaster@example.com</code>" becomes
"<code class="literal">john-postmaster@domain.com</code>", and
"<code class="literal">sales-info@example.com</code>" becomes
"<code class="literal">john-sales-info@domain.com</code>".</p><p>
The intended behavior is to use an actual account named
<code class="literal">john</code>.
As a result of the virtual domain address rewriting, delivery instructions for
<code class="literal">postmaster@example.com</code> can now be specified by
<code class="literal">john</code>'s <code class="filename">$HOME/.courier-postmaster</code> file,
and delivery
instructions for <code class="literal">sales-info@example.com</code> may be specified by
<code class="filename">$HOME/.courier-sales-info</code>. <code class="literal">john</code>'s
<code class="filename">$HOME/.courier-default</code> may be used to specify delivery
instructions for any other address in the <code class="literal">example.com</code>
domain,
which does not have an explicit <code class="filename">.courier</code> file.</p><p>
If the alias entry was "<code class="literal">@example.com: john-example</code>", the
corresponding files in <code class="literal">john</code>'s <code class="filename">$HOME</code>
directory are
<code class="filename">.courier-example-postmaster</code>,
<code class="filename">.courier-example-sales-info</code>, and
<code class="filename">.courier-example-default</code>. See
<a class="ulink" href="dot-courier.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">dot-courier</span>(5)</span></a>
for more information on <code class="filename">.courier</code> files.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
Virtual domain rewriting is NOT recursive, unlike regular
aliases. For example:</p><div class="informalexample"><pre class="programlisting" xml:space="preserve">
tom: john@example.com
@example.com: larry
</pre></div><p>
You should explicitly expand the alias out:</p><div class="informalexample"><pre class="programlisting" xml:space="preserve">
tom: larry-john
</pre></div></div></div><div class="refsect1"><a id="idm255232343040" shape="rect"> </a><h2>PROGRAM OR MAILBOX ALIASES</h2><p>
The following notation associates an address directly with a
mailbox, or with a program:</p><div class="informalexample"><pre class="programlisting" xml:space="preserve">
info: /var/shared/info
</pre></div><p>
Messages addressed to "info" will be delivered to the mailbox or maildir
<code class="filename">/var/shared/info</code>.  A full pathname must be
specified.</p><div class="informalexample"><pre class="programlisting" xml:space="preserve">
info: | /usr/local/shared/info
</pre></div><p>
Mail addressed to "info" will be delivered to the indicated program. The
program receives each message on standard input.</p><p>
Program/mailbox delivery notation is primarily used to support legacy
sendmail aliases entries.  This is considered to be a legacy feature, and new
installations should create a
<a class="ulink" href="dot-courier.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">dot-courier</span>(5)</span></a>
file with the
necessary delivery instructions.  In fact, aliases for programs or mailboxes
is not directly supported by the <span class="application">Courier</span>
mail server's aliasing mechanisms. It's implemented
by having the <span class="command"><strong>makealiases</strong></span> script automatically create a
<code class="filename">.courier</code> file, and point the alias address to it.</p><p>
See
<a class="ulink" href="dot-courier.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">dot-courier</span>(5)</span></a>
for more information.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
Unlike sendmail, the <span class="application">Courier</span> mail server
delivers as user "<code class="literal">@mailuser@</code>"
(group @mailgroup@) when delivering to programs or mailboxes.</p></div></div><div class="refsect1"><a id="idm255232330704" shape="rect"> </a><h2>UUCP VIRTUAL DOMAINS</h2><p>
The following notation allows mail addressed to a certain domain to be
forwarded via uucp:</p><div class="informalexample"><pre class="programlisting" xml:space="preserve">
@domain: uucp!bang!path!
</pre></div><p>
The trailing <span class="token">!</span> tells the
<span class="application">Courier</span> mail server not to append a dash,
so <code class="literal">user@domain</code> gets rewritten as
<code class="literal">uucp!bang!path!user</code>,
and not <code class="literal">uucp!bang!path-user</code>, which is probably not what you
want.</p></div><div class="refsect1"><a id="idm255232325168" shape="rect"> </a><h2>DELIVERY STATUS NOTIFICATIONS</h2><p>
An alias with only one address does not affect delivery status
notification attributes of an E-mail message.</p><p>
An alias with multiple addresses is treated like a private mailing list, as
defined by
<a class="ulink" href="http://www.rfc-editor.org/rfc/rfc1894.txt" target="_top" shape="rect">RFC 1894</a>.
If the message requests a successful delivery
notification, the <span class="application">Courier</span> mail server
generates a delivery status notification for the
successful delivery to the aliased address, and each alias recipient address
will have DSNs set to NEVER.</p></div><div class="refsect1"><a id="idm255232321888" shape="rect"> </a><h2>BUGS</h2><p>
This has nothing to do with the <span class="application">Courier</span>
mail server's support for a Qmail-style alias
account.</p><p>
<code class="literal">owner-foo</code> feature of sendmail's aliasing is not
supported.</p><p>
the <span class="application">Courier</span> mail server normally tries to
eliminate duplicate addresses listed as
recipients for the same message. Some mail servers are not capable of
delivering messages with multiple recipients, and will transmit a separate
copy of the same message addressed to each recipient.
The <span class="application">Courier</span> mail server can't do
anything in this case. Each copy of the same original text is considered an
individual, separate, message.</p><p>
Duplicate elimination can fail in certain rare circumstances, involving
exotic features of
<a class="ulink" href="http://www.rfc-editor.org/rfc/rfc822.txt" target="_top" shape="rect">RFC 2822</a>
concerning case sensitivity.</p><p>
"<code class="literal">@example.com: jack, jill</code>" is allowed, but strongly
discouraged under the penalty of law.</p><p>
Because multiple-recipient aliases are treated like private mailing lists,
failure DSNs are turned off, and a bad recipient address is hardly noticed by
anyone.</p><p>
The <span class="command"><strong>makealiases</strong></span> command may execute while the
<span class="application">Courier</span> mail server is
running, and any changes take effect immediately. However, only one instance of
<span class="command"><strong>makealiases</strong></span> is permitted to run at the same time.</p></div><div class="refsect1"><a id="idm255232311904" shape="rect"> </a><h2>SEE ALSO</h2><p>
<a class="ulink" href="esmtpd.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">esmtpd</span>(8)</span></a>.</p></div></div></body></html>
