newaliases(1)
β¨ NAME β¨</p>
okay so hi bestie π welcome to newaliases β it's the glow-up tool that creates a forwarding database from /etc/aliases. that's it. that's the job. she takes your messy little list of who-goes-where and turns it into something fast. iconic behaviour fr fr π
πΈ SYNOPSIS πΈ
newaliases
no flags, no arguments, no drama. she just does it π
π¦ DESCRIPTION π¦
so here's the tea β newaliases reads a table of sendmail-style forwarding instructions out of /etc/aliases and converts them into a forwarding database living at /etc/aliases.cdb. that database is what fastforward eats for breakfast. nom nom. π
ngl the safety situation here is lowkey genius: instead of writing straight over your live database, newaliases writes the forwarding database to /etc/aliases.tmp first, and then moves /etc/aliases.tmp to /etc/aliases.cdb. if something goes wrong while creating /etc/aliases.tmp, she complains and leaves /etc/aliases.cdb completely alone β untouched, unbothered, main character energy π. in the meantime, deliveries can keep on going using /etc/aliases.cdb. no downtime, no panic, we love to see it π
one thing to know: newaliases always creates /etc/aliases.cdb world-readable. every time. no cap.
and bestie, listen β newaliases makes no attempt to protect against simultaneous updates of /etc/aliases.cdb. like, none. zero. two of them running at once is giving chaos π
π INSTRUCTION FORMAT π
newaliases imitates how sendmail handles /etc/aliases. for example:
root: alice, bill
that says mail for root should be forwarded to alice and bill. cute, right? β¨
COMPATIBILITY WARNING:newaliasesdoes not support file deliveries. you can use the file delivery mechanism described indot-qmail(5)instead. periodt.
π SIMPLE ALIASES π
the simplest kind of forwarding instruction is literally just:
alias: recip
any message sent to alias gets forwarded to the recipient address recip. and here's the cute part β addresses are compared to alias without regard to case. so ROOT and root are the same girl π
forwarding instructions are cumulative. if recip is itself an alias, then messages to alias get forwarded the same way messages to recip do. chain reaction, slay π₯
for example, with these instructions:
postmaster@heaven.af.mil: bob@heaven.af.mil
root@heaven.af.mil: postmaster@heaven.af.mil
messages to postmaster@heaven.af.mil or root@heaven.af.mil will be delivered to Bob. hi Bob π«Ά
COMPATIBILITY WARNING: with sendmail, entries in/etc/aliasescan override usernames. with qmail, if you installfastforwardin~alias/.qmail-default, it will not see addresses that are controlled by other users. seeqmail-getpw(8). to change this, seeqmail-users(5).
COMPATIBILITY WARNING: various versions of sendmail do various strange things with circular alias definitions π seesetforward(1)for details onfastforward's behavior.
COMPATIBILITY WARNING: if there are several forwarding instructions for a single alias, sendmail will complain; fastforward will silently use the first instruction. sneakyyyy π
π WILDCARDS π
alias can have the form user@host.dom for one user at one host, @host.dom for all users at one host, or user for one user at all hosts.
COMPATIBILITY WARNING: sendmail supports onlyuser; it does not support per-host aliases. it acceptsuser@host.domifhost.domis a local host, but it then treats it the same way asuser, applying to all local hosts and virtual domains. so basically it's giving "sure I'll take it" and then doing whatever it wants π
β ADDRESS FORMATS β
addresses in /etc/aliases are parsed the same way as addresses in RFC 822 message headers. parenthesized comments and bracketed addresses are permitted:
root: bob (Bob, the postmaster)
joe: Joe Shmoe <shmoe@heaven.af.mil>
addresses with special characters must be quoted:
fred: "spaced out mailbox"@heaven.af.mil
address groups are not permitted, since colons have a different use in /etc/aliases. sorry bestie, no groups today π
any recipient address without a fully qualified domain name is fed through the defaulthost, defaultdomain, and plusdomain mechanisms described in qmail-header(5). so she'll fill in the blanks for you, queen behaviour π
COMPATIBILITY WARNING: sendmail's handling of quotes and backslashes violates RFC 821 and RFC 822, and is not supported bynewaliases. theqmail-localdelivery mechanism lets each user manage several addresses, so there is no need for a special syntax to get around forwarding.
π MULTIPLE RECIPIENTS π
an instruction may list more than one recipient address:
alias: recip1, recip2, recip3
any message sent to alias will be forwarded to all of the addresses. everybody eats π₯
a forwarding instruction may also be split across several lines. each line past the first must either (1) begin with space or tab or (2) be empty:
hostmaster:
fred,
joe
COMPATIBILITY WARNING: sendmail requires the colon to be on the first line of a multi-line forwarding instruction. newaliases doesn't care whether the colon is present at all. she's chill like that π
COMPATIBILITY WARNING: sendmail does not permit blank lines in the middle of continuations. this has the undesirable effect that a blank line behaves differently from a line containing a single space. the way that's a footgun π
π COMMENTS π
any line in /etc/aliases that begins with # is ignored:
# this is a comment
a comment may be split across several lines. each line past the first must either (1) begin with space or tab or (2) be empty.
COMPATIBILITY WARNING: sendmail does not permit continuations of comment lines. rude honestly.
π¦ PROGRAMS π¦
if a recipient address does not contain a domain name, and begins with a vertical bar, newaliases takes the rest of the address as a program to run:
weather: "|weather-server"
fastforward will run weather-server when a message arrives for weather. it's giving β¨ automation β¨
COMPATIBILITY WARNING: internet addresses can legitimately start with a slash or vertical bar.newaliasestreats anything with an unquoted@as an address. sendmail appears to have various problems coping with these addresses, and with commands that contain@signs. not our problem π
COMPATIBILITY WARNING: newaliases does not allow a vertical bar before double quotes.
π§ INCLUDE FILES π§
a recipient address of the form :include:file means "every address listed in file." (actually fastforward reads file.bin; see newinclude(1) for further details.) the lore goes deep, iykyk π€«
note that file is read by fastforward, not by newaliases, so the system administrator does not have to run newaliases every single time file changes. huge W for sysadmins everywhere π«Ά file must be world-readable and accessible to fastforward.
COMPATIBILITY WARNING: if an:include:file is unreadable or nonexistent, sendmail skips it;fastforwarddefers delivery of the message. very different vibes.
COMPATIBILITY WARNING: sendmail does not permit spaces inside the literal text:include:.newaliasesdoes. we're flexible π
COMPATIBILITY WARNING: versions of sendmail before V8 did not strip quotes from :include: filenames. ancient history bestie π
π ALIAS OWNERS π
if there is an alias for owner-list, any message forwarded through list will have its envelope sender set to owner-list, so that bounces go back to owner-list. she's responsible. she's got receipts. we stan πΈ
COMPATIBILITY WARNING: when an alias includes the same recipient both inside and outside a mailing list, fastforward sends the message twice, once with each envelope sender. sendmail sends the message only once; its choice of envelope sender for that recipient depends on the phase of the moon ππ literally. that's in the manual. we don't make the rules.
π SEE ALSO π
fastforward(1)setforward(1)newinclude(1)printforward(1)dot-qmail(5)
okay that's the whole page bestie π go forth and forward your mail, you absolute legend. this was newaliases(1) from the General Commands Manual β mwah, love u, bye πβ¨π¦
π¦ where this page comes from
- debian bookworm: fastforward 1:0.51-8+b1
- debian trixie: fastforward 1:0.51-10
- ubuntu jammy: fastforward 1:0.51-6
- ubuntu noble: fastforward 1:0.51-9
- ubuntu questing: fastforward 1:0.51-11
- ubuntu resolute: fastforward 1:0.51-11build1
- ubuntu stonking: fastforward 1:0.51-12
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms