'\" t .\" .\" .\" Title: makealiases .\" Author: Sam Varshavchik .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 10/28/2020 .\" Manual: Double Precision, Inc. .\" Source: Courier Mail Server .\" Language: English .\" .TH "MAKEALIASES" "8" "10/28/2020" "Courier Mail Server" "Double Precision, Inc." .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" makealiases \- Create an alias database .SH "SYNOPSIS" .HP \w'\fBmakealiases\fR\ 'u \fBmakealiases\fR [\-protocol=\fIprotocol\fR] [\-alias=\fIfilename\fR] [\-src=\fIpathname\fR] [\-tmp=\fIfilename\fR] [\-chk] [\-dump] [\fImodule\fR] .SH "DESCRIPTION" .PP The Courier mail server\*(Aqs /etc/courier/aliases\&.dat file is a unified implementation of sendmail\-style address aliasing, qmail\-style virtual domains, plus several Courier mail server\-style enhancements\&. .PP The term \fIaliasing\fR refers to substituting one or more addresses for another address\&. A one\-to\-one substitution results in the Courier mail server accepting mail for one address, and delivering the mail to another address\&. A one\-to\-many substitution results in the Courier mail server accepting mail for one address, and delivering a separate copy of the message to every address defined by the alias\&. .PP /etc/courier/aliases\&.dat is a binary database file\&. \fBmakealiases\fR creates the binary database file by reading the aliases from plain text files, and \fBmakealiases\fR creates /etc/courier/aliases\&.dat by default\&. .PP \fBmakealiases\fR creates /etc/courier/aliases\&.dat 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, \fBmakealiases\fR obtains the source text from /etc/courier/aliases\&. If this is a text file, it is used verbatim\&. If this is a directory (the Courier mail server creates it as a directory by default), all the non\-hidden files in this directory are concatenated together\&. .SH "OPTIONS" .PP \-alias=\fIfilename\fR .RS 4 Create \fIfilename\fR, instead of /etc/courier/aliases\&.dat\&. .RE .PP \-chk .RS 4 Try to search for bad addresses used in the aliases\&.dat file\&. This option takes some time to complete\&. It does not create an aliases\&.dat file, but instead tries to check every address specified by the source text file\&. Why is this necessary? That\*(Aqs 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 Courier mail server considers aliases to be private mailing lists\&. Because non\-delivery notices are not sent, bad addresses will not be immediately detected\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br The \fB\-chk\fR option is really effective for addresses which are local, because there is no real way to determine if a remote mail address is valid\&. .sp .5v .RE .RE .PP \-dump .RS 4 Do not create aliases\&.dat, 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\&. .RE .PP \-src=\fIpathname\fR .RS 4 Use \fIpathname\fR instead of /etc/courier/aliases as the source file\&. \fIpathname\fR can also refer to a directory\&. This concatenates every non\-hidden file in the directory\&. .RE .PP \-tmp=\fIfilename\fR .RS 4 Use \fIfilename\fR as a temporary file, instead of /etc/courier/aliases\&.tmp\&. \fBmakealiases\fR requires a temporary file for its own purposes, which is automatically removed when done\&. This temporary file MUST reside on the same filesystem as aliases\&.dat\&. If the \fB\-alias\fR option specifies a file on a different filesystem, use this option to specify where to temporary place a file in the same filesystem\&. Because \fBmakealiases\fR always uses the same name for a temporary file you cannot run more than one \fBmakealiases\fR process at the same time\&. .RE .PP \-protocol=\fIprotocol\fR .RS 4 Use an alias list that\*(Aqs private to messages coming from \fIprotocol\fR\&. See below\&. .RE .PP The optional \fImodule\fR specifies the module whose rewriting rules are used to convert E\-mail addresses into a canonical form\&. If not specified, the local module\*(Aqs address rewriting rules will be used\&. .SH "PROTOCOL ALIASES" .PP Addresses in /etc/courier/aliases\&.dat will be checked in every message\&. Use the \fB\-protocol\fR 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 \fB\-protocol\fR option is one of: esmtp, uucp, or local\&. .PP Protocol\-specific alias files are /etc/courier/aliases\-\fIprotocol\fR\&.dat, where "\fIprotocol\fR" is the specific protocol, such as "local", "esmtp", or "uucp", and the source file read by \fBmakealiases\fR would be /etc/courier/aliases\-\fIprotocol\fR\&. If the \fB\-protocol\fR option is specified, \fBmakealiases\fR will access these files instead of /etc/courier/aliases\&.dat and /etc/courier/aliases\&. .SH "ALIAS SPECIFICATIONS" .PP The sources file used to create the binary aliases\&.dat database are plain text files that may be created using any editor\&. .PP Each alias specification takes the following form: .sp .if n \{\ .RS 4 .\} .nf alias: address1, address2, \&.\&.\&. .fi .if n \{\ .RE .\} .PP Mail received by the Courier mail server addressed to \fIalias\fR 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\&. .PP Lines starting with the # character are ignored, they are comments\&. .PP \fIalias\fR is not restricted to be a local address\&. It may be any valid \m[blue]\fBRFC 2822\fR\m[]\&\s-2\u[1]\d\s+2 address\&. All addresses do not necessary have to be in a canonical form\&. .sp .if n \{\ .RS 4 .\} .nf alias: :include:/absolute/pathname .fi .if n \{\ .RE .\} .PP This notation reads the list of addresses from another file, \fI/absolute/pathname\fR\&. This file should contain one address per line (comma separated addresses on the same line will also work)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .PP If \fIalias\fR 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: .sp .if n \{\ .RS 4 .\} .nf larry: larry, moe, curly, shemp .fi .if n \{\ .RE .\} .PP Larry will still receive his mail, but copies will will also be sent to Moe, Curly, and Shemp\&. If Larry wasn\*(Aqt specified in the alias, he would never get any mail, it will all be forwarded to Moe, Curly, and Shemp\&. .sp .5v .RE .SH "DUPLICATE ADDRESSES" .PP Alias definitions may refer to other alias definitions, and \fBmakealiases\fR 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\&. .SH "VIRTUAL DOMAINS" .PP The following special syntax implements a virtual domain\&. A virtual domain redirects all mail for an entire domain to one user: .sp .if n \{\ .RS 4 .\} .nf @domain: user .fi .if n \{\ .RE .\} .PP This special entry results in any recipient address of the form foo@domain to be rewritten as user\-foo@me, where \fIme\fR is the hostname of the machine, which we expect to be a local domain\&. .PP The following examples use the alias entry "@example\&.com: john", and "domain\&.com" is in the control/me file\&. The address "postmaster@example\&.com" becomes "john\-postmaster@domain\&.com", and "sales\-info@example\&.com" becomes "john\-sales\-info@domain\&.com"\&. .PP The intended behavior is to use an actual account named john\&. As a result of the virtual domain address rewriting, delivery instructions for postmaster@example\&.com can now be specified by john\*(Aqs $HOME/\&.courier\-postmaster file, and delivery instructions for sales\-info@example\&.com may be specified by $HOME/\&.courier\-sales\-info\&. john\*(Aqs $HOME/\&.courier\-default may be used to specify delivery instructions for any other address in the example\&.com domain, which does not have an explicit \&.courier file\&. .PP If the alias entry was "@example\&.com: john\-example", the corresponding files in john\*(Aqs $HOME directory are \&.courier\-example\-postmaster, \&.courier\-example\-sales\-info, and \&.courier\-example\-default\&. See \m[blue]\fB\fBdot-courier\fR(5)\fR\m[]\&\s-2\u[2]\d\s+2 for more information on \&.courier files\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .PP Virtual domain rewriting is NOT recursive, unlike regular aliases\&. For example: .sp .if n \{\ .RS 4 .\} .nf tom: john@example\&.com @example\&.com: larry .fi .if n \{\ .RE .\} .PP You should explicitly expand the alias out: .sp .if n \{\ .RS 4 .\} .nf tom: larry\-john .fi .if n \{\ .RE .\} .sp .5v .RE .SH "PROGRAM OR MAILBOX ALIASES" .PP The following notation associates an address directly with a mailbox, or with a program: .sp .if n \{\ .RS 4 .\} .nf info: /var/shared/info .fi .if n \{\ .RE .\} .PP Messages addressed to "info" will be delivered to the mailbox or maildir /var/shared/info\&. A full pathname must be specified\&. .sp .if n \{\ .RS 4 .\} .nf info: | /usr/local/shared/info .fi .if n \{\ .RE .\} .PP Mail addressed to "info" will be delivered to the indicated program\&. The program receives each message on standard input\&. .PP 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 \m[blue]\fB\fBdot-courier\fR(5)\fR\m[]\&\s-2\u[2]\d\s+2 file with the necessary delivery instructions\&. In fact, aliases for programs or mailboxes is not directly supported by the Courier mail server\*(Aqs aliasing mechanisms\&. It\*(Aqs implemented by having the \fBmakealiases\fR script automatically create a \&.courier file, and point the alias address to it\&. .PP See \m[blue]\fB\fBdot-courier\fR(5)\fR\m[]\&\s-2\u[2]\d\s+2 for more information\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .PP Unlike sendmail, the Courier mail server delivers as user "courier" (group courier) when delivering to programs or mailboxes\&. .sp .5v .RE .SH "UUCP VIRTUAL DOMAINS" .PP The following notation allows mail addressed to a certain domain to be forwarded via uucp: .sp .if n \{\ .RS 4 .\} .nf @domain: uucp!bang!path! .fi .if n \{\ .RE .\} .PP The trailing ! tells the Courier mail server not to append a dash, so user@domain gets rewritten as uucp!bang!path!user, and not uucp!bang!path\-user, which is probably not what you want\&. .SH "DELIVERY STATUS NOTIFICATIONS" .PP An alias with only one address does not affect delivery status notification attributes of an E\-mail message\&. .PP An alias with multiple addresses is treated like a private mailing list, as defined by \m[blue]\fBRFC 1894\fR\m[]\&\s-2\u[3]\d\s+2\&. If the message requests a successful delivery notification, the Courier 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\&. .SH "BUGS" .PP This has nothing to do with the Courier mail server\*(Aqs support for a Qmail\-style alias account\&. .PP owner\-foo feature of sendmail\*(Aqs aliasing is not supported\&. .PP the Courier 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 Courier mail server can\*(Aqt do anything in this case\&. Each copy of the same original text is considered an individual, separate, message\&. .PP Duplicate elimination can fail in certain rare circumstances, involving exotic features of \m[blue]\fBRFC 2822\fR\m[]\&\s-2\u[1]\d\s+2 concerning case sensitivity\&. .PP "@example\&.com: jack, jill" is allowed, but strongly discouraged under the penalty of law\&. .PP 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\&. .PP The \fBmakealiases\fR command may execute while the Courier mail server is running, and any changes take effect immediately\&. However, only one instance of \fBmakealiases\fR is permitted to run at the same time\&. .SH "SEE ALSO" .PP \m[blue]\fB\fBesmtpd\fR(8)\fR\m[]\&\s-2\u[4]\d\s+2\&. .SH "AUTHOR" .PP \fBSam Varshavchik\fR .RS 4 Author .RE .SH "NOTES" .IP " 1." 4 RFC 2822 .RS 4 \%http://www.rfc-editor.org/rfc/rfc822.txt .RE .IP " 2." 4 \fBdot-courier\fR(5) .RS 4 \%http://www.courier-mta.org/dot-courier.html .RE .IP " 3." 4 RFC 1894 .RS 4 \%http://www.rfc-editor.org/rfc/rfc1894.txt .RE .IP " 4." 4 \fBesmtpd\fR(8) .RS 4 \%http://www.courier-mta.org/esmtpd.html .RE