MAKEALIASES(8)
πΈ MAKEALIASES πΈ
okay bestie, so this is makealiases from section 8 of the manual β the Courier mail server corner of the universe β and it was written by S. Varshavchik. It's giving database-builder, it's giving address-glow-up, and honestly? You're gonna want to sit down for this one because it's a long one. π
β¨ NAME β¨
makealiases β Create an alias database
π SYNOPSIS π
makealiases [-protocol=protocol] [-alias=filename] [-src=pathname]
[-tmp=filename] [-chk] [-dump] [module]
π¦ DESCRIPTION π¦
So. The Courier mail server's /etc/courier/aliases.dat file? It's a whole unified moment. It does sendmail-style address aliasing, qmail-style virtual domains, plus several Courier-mail-server-style enhancements on top. Iconic behavior, honestly. π₯
The word aliasing means swapping one or more addresses in for another address. Let's break that down:
- A one-to-one substitution means the Courier mail server accepts mail for one address, and delivers it to a different address. Sneaky. Cute.
- A one-to-many substitution means the Courier mail server accepts mail for one address, and delivers a separate copy of the message to every address defined by the alias. Yes, every single one. She's thorough. π
/etc/courier/aliases.dat is a binary database file. makealiases creates that binary database file by reading the aliases out of plain text files, and by default makealiases creates /etc/courier/aliases.dat. No cap.
makealiases builds /etc/courier/aliases.dat from one or more source files β plain text files, the kind you can make with literally any text editor. The format of those source files is defined below (keep scrolling, bestie π). By default, makealiases gets its source text from /etc/courier/aliases. Here's the tea on that path:
- If it's a text file, it gets used verbatim.
- If it's a directory (and the Courier mail server creates it as a directory by default), then all the non-hidden files in that directory get concatenated together. π«Ά
π OPTIONS π
-alias=filenameβ Createfilenameinstead of/etc/courier/aliases.dat. Live your truth, name your file.-chkβ Try to search for bad addresses used in thealiases.datfile. Heads up: this option takes some time to complete. It does not create analiases.datfile β instead it tries to check every address specified by the source text file.
So why is this even necessary?? π Because non-delivery reports will not be sent to the sender for failures in delivering mail to an aliased address. That's by design, periodt. The Courier mail server considers aliases to be private mailing lists. And because non-delivery notices aren't sent, bad addresses won't be immediately detected. So this flag is your little detective moment. π
Note The -chk option is really effective for addresses which are local, because there is no real way to determine if a remote mail address is valid. Remote addresses stay mysterious. We can't fix that. π₯²
-dumpβ Do not createaliases.dat; instead display the contents of the alias database in plain text form. What you get is the combined contents of all the source files, with all addresses converted to canonical format, with duplicates removed and sub-aliases expanded. It's giving before/after glow-up reveal. β¨-src=pathnameβ Usepathnameinstead of/etc/courier/aliasesas the source file.pathnamecan also refer to a directory β and that concatenates every non-hidden file in the directory.-tmp=filenameβ Usefilenameas a temporary file, instead of/etc/courier/aliases.tmp.makealiasesneeds a temporary file for its own purposes, and it's automatically removed when done. Important bestie:
This temporary file MUST reside on the same filesystem asaliases.dat. If the-aliasoption specifies a file on a different filesystem, use this option to specify where to temporarily place a file in that same filesystem. And becausemakealiasesalways uses the same name for a temporary file, you cannot run more than onemakealiasesprocess at the same time. One at a time, queen. π«
-protocol=protocolβ Use an alias list that's private to messages coming fromprotocol. See below, babes. π
The optional module specifies the module whose rewriting rules are used to convert E-mail addresses into a canonical form. If you don't specify it, the local module's address rewriting rules get used. π«
π PROTOCOL ALIASES π
Addresses in /etc/courier/aliases.dat get checked in every message. But the -protocol option lets you create aliases that get checked only for messages received via a specific protocol β like ESMTP, UUCP, or locally-generated mail. This is how you can, for example, create an alias like "everyone" that's only available to locally generated mail and does not work for mail received via ESMTP. Exclusive, but in a good way. π
The argument to the -protocol option is one of: esmtp, uucp, or local.
Protocol-specific alias files are named /etc/courier/aliases-protocol.dat, where protocol is the specific protocol β such as local, esmtp, or uucp β and the source file read by makealiases would be /etc/courier/aliases-protocol. If the -protocol option is specified, makealiases accesses these files instead of /etc/courier/aliases.dat and /etc/courier/aliases.
π ALIAS SPECIFICATIONS π
The source files used to create the binary aliases.dat database are plain text files that may be created using any editor. Any. Editor. No gatekeeping. βοΈ
Each alias specification takes the following form:
alias: address1, address2, ...
Mail received by the Courier mail server addressed to alias gets delivered to the list of addresses specified. And the list of addresses may be split across multiple lines β if the second and subsequent lines start with a space character. (A little leading space is all it takes. π·)
Lines starting with the # character are ignored; they are comments. π
alias is not restricted to being a local address. It may be any valid RFC 2822[1] address. And all addresses don't necessarily have to be in a canonical form. Chaotic? A little. Valid? Absolutely.
alias: :include:/absolute/pathname
This notation reads the list of addresses from another file, /absolute/pathname. That file should contain one address per line (comma separated addresses on the same line will also work). Flexible queen. π
Note If alias 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:
larry: larry, moe, curly, shemp
Larry will still receive his mail, but copies will also be sent to Moe, Curly, and Shemp. If Larry wasn't specified in the alias, he would never get any mail β it would all be forwarded to Moe, Curly, and Shemp. Larry said "put me on the list" and honestly, smart. π
π§ DUPLICATE ADDRESSES π§
Alias definitions may refer to other alias definitions, and makealiases automatically incorporates addresses from other aliases. And if the same address is listed in multiple aliases, and two or more of them are specified as recipients of the same message, then only one copy of the message gets delivered to that address. No duplicate deliveries, no spam-adjacent nonsense. πΈ
π VIRTUAL DOMAINS π
The following special syntax implements a virtual domain. A virtual domain redirects all mail for an entire domain to one user:
@domain: user
This special entry results in any recipient address of the form foo@domain being rewritten as user-foo@me, where me is the hostname of the machine β which we expect to be a local domain.
The following examples use the alias entry "@example.com: john", and "domain.com" is in the control/me file. So the address "postmaster@example.com" becomes "john-postmaster@domain.com", and "sales-info@example.com" becomes "john-sales-info@domain.com". Look at that transformation. Gorgeous. β¨
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's $HOME/.courier-postmaster file, and delivery instructions for sales-info@example.com may be specified by $HOME/.courier-sales-info. john's $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.
And if the alias entry was "@example.com: john-example", the corresponding files in john's $HOME directory are .courier-example-postmaster, .courier-example-sales-info, and .courier-example-default. See dot-courier(5)[2] for more information on .courier files. π
Note Virtual domain rewriting is NOT recursive, unlike regular aliases. For example:
tom: john@example.com
@example.com: larry
You should explicitly expand the alias out:
tom: larry-john
Yes, bestie, you have to spell it out yourself. The recursion is not coming to save you. π
π₯ PROGRAM OR MAILBOX ALIASES π₯
The following notation associates an address directly with a mailbox, or with a program:
info: /var/shared/info
Messages addressed to "info" will be delivered to the mailbox or maildir /var/shared/info. A full pathname must be specified. No shortcuts, no relative paths, we're being precise here. π
info: | /usr/local/shared/info
Mail addressed to "info" will be delivered to the indicated program. The program receives each message on standard input.
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 dot-courier(5)[2] file with the necessary delivery instructions. In fact, aliases for programs or mailboxes are not directly supported by the Courier mail server's aliasing mechanisms β it's implemented by having the makealiases script automatically create a .courier file, and point the alias address to it. A little behind-the-scenes choreography, iykyk. π
See dot-courier(5)[2] for more information.
Note Unlike sendmail, the Courier mail server delivers as user"courier"(groupcourier) when delivering to programs or mailboxes. Know your identity. π
π UUCP VIRTUAL DOMAINS π
The following notation allows mail addressed to a certain domain to be forwarded via uucp:
@domain: uucp!bang!path!
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. That one little punctuation mark is doing so much work. π«Ά
β DELIVERY STATUS NOTIFICATIONS β
An alias with only one address does not affect delivery status notification attributes of an E-mail message. Casual. Low-stakes. No drama.
An alias with multiple addresses is treated like a private mailing list, as defined by RFC 1894[3]. 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. π¬
π BUGS π (aka the tea, the disclaimers, the "bestie be careful" section)
Okay so first things first β this whole thing has nothing to do with the Courier mail server's support for a Qmail-style alias account. Different vibe entirely, don't mix them up π
The owner-foo feature of sendmail's aliasing is not supported. Nope. Not a thing here. Moving on π«Ά
Now the duplicate-address lore, because it's important: the Courier mail server normally tries to eliminate duplicate addresses listed as recipients for the same message. Adorable, right? Well β some mail servers are simply not capable of delivering messages with multiple recipients, and those ones will transmit a separate copy of the same message addressed to each recipient. And Courier? Can't do anything about that in this case. Each copy of the same original text gets considered an individual, separate, message. Every single one. No takebacks πΈ
Also, heads up: duplicate elimination can fail in certain rare circumstances β the kind involving exotic features of RFC 2822<sup>[1]</sup> concerning case sensitivity. So like, rare rare. But possible π
Lowkey a warning from the devs themselves: "@example.com: jack, jill" is allowed, but strongly discouraged under the penalty of law. Yes literally under the penalty of law. Bestie. Don't. βοΈπ
And 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. Which is giving "you will simply never know" energy. Very chilling, very real π
One more thing, and it's actually good news: the makealiases command may execute while the Courier mail server is running, and any changes take effect immediately. Instantly. Slay β¨
However β and this is a big however β only one instance of makealiases is permitted to run at the same time. One. Solo. Main character only. No coordinating twins, no duets π
π SEE ALSO π
esmtpd(8)<sup>[4]</sup>.
π AUTHOR π
Sam Varshavchik
- Author
Give them their flowers, they wrote the whole thing, we're obsessed π«ΆπΈ
π NOTES π
- RFC 2822 β https://datatracker.ietf.org/doc/html/rfc822
- dot-courier(5) β https://www.courier-mta.org/dot-courier.html
- RFC 1894 β https://datatracker.ietf.org/doc/html/rfc1894
- esmtpd(8) β https://www.courier-mta.org/esmtpd.html
And that's the whole page bestie, you made it all the way to the end π star sticker for you β This one's from the Courier Mail Server, dated 01/10/2026, and it lives in the manual as MAKEALIASES(8) β so go forth, write those aliases, be iconic, and remember: only one instance at a time π
β¨π
π¦ where this page comes from
- ubuntu stonking: courier-mta 2.0.6-1 Β· GPL-3+~with-OpenSSL-exception
- Copyright 1998 - 2009 S. Varshavchik. See COPYING for -->
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms