setforward(1)
π setforward(1) β bestie edition π
okay so this is setforward, a general commands manual page situation, and honestly? it's giving database-builder energy. let's get into it π«Ά
β¨ NAME β¨
setforward β create a forwarding database π
π SYNOPSIS π
setforward cdb tmp
π DESCRIPTION π
okay so setforward reads a table of forwarding instructions from its standard input. it takes that table and converts it into a forwarding database. and that forwarding database? it can be used by fastforward. iconic teamwork fr fr β¨
setforward writes the forwarding database to tmp; then it moves tmp to cdb. and bestie, listen β tmp and cdb must be on the same filesystem. no cap, that's not negotiable.
if there's a problem creating tmp, setforward complains (as it should π
) and leaves cdb alone. your girl does not touch the database if things go sideways.
also the forwarding database format is portable across machines. so you can carry it around like it's your emotional support file π¦
π INSTRUCTION FORMAT π
a forwarding instruction has: a target, a colon, a series of commands, and a semicolon. each command is one of: a recipient address, an owner address, an external mailing list, or a program. commands get separated by commas. periodt.
for example:
root@yp.to: god@heaven.af.mil, staff@af.mil;
that says mail for root@yp.to should be forwarded to the recipient addresses god@heaven.af.mil and staff@af.mil. slay.
when setforward sees # it ignores all text from # to the end of the line:
# this is a comment
setforward ignores all other line endings, so you can totally split a forwarding instruction across lines. it also ignores spaces and tabs. exception: you can put a space (or tab or comma or whatever) into a target or command by putting a backslash in front of it. (however, NUL bytes are not permitted anywhere. not even one. don't do it π)
π― TARGETS π―
when fastforward sees the incoming address user@host.dom, it tries three targets: user@host.dom, @host.dom, and user@. it obeys the commands for the first target that it finds. target names are interpreted without regard to case.
all the commands for a single target must be listed in a single instruction. exception: an owner address can be listed in a separate instruction. she's special like that π
π RECIPIENT ADDRESSES π
if a command begins with an ampersand, setforward takes the remaining bytes in the command as a recipient address:
boss@yp.to: &god@heaven.af.mil;
fastforward sends each incoming mail message to the recipient address. the recipient address must include a fully qualified domain name. it cannot be longer than 800 bytes.
if a recipient address is itself a target in the forwarding table, fastforward will recursively handle the instructions for that target. note that @host.dom and user@ wildcards do not apply here; they apply only to the incoming address. iykyk.
if a command begins with a letter or number, setforward takes the entire command as a recipient address:
boss@yp.to: god@heaven.af.mil;
β OWNER ADDRESSES β
if a command begins with a question mark, setforward takes the remaining bytes in the command as an owner address:
sos@heaven.af.mil: ?owner-sos@heaven.af.mil;
fastforward uses that address as the envelope sender for forwarded mail, so bounces will go back to that address. (normally, if a message is forwarded to a bad address, it will bounce back to the original envelope sender. so this is you taking control of the bounce situation π)
π EXTERNAL MAILING LISTS π
if a command begins with a dot or slash, setforward takes the entire command as the name of a binary mailing list file created by setmaillist:
sos@heaven.af.mil: /etc/lists/sos.bin;
fastforward will read and obey the commands in that file. the file must be world-readable and accessible to fastforward. no private vibes allowed.
π₯οΈ PROGRAMS π₯οΈ
if a command begins with a vertical bar or exclamation point, setforward takes the rest of the command as the name of a program to run:
dew@: |dew-monitor;
for a vertical bar, fastforward feeds the message to that program. an exclamation point works the same way except that fastforward inserts $UFLINE, $RPLINE, and $DTLINE in front of the message. same energy, extra lines β¨
π DUPLICATES π
when fastforward is building the recipient list for a message, it keeps track of the recipient addresses and external mailing lists it has used. if the same command shows up again, it skips it. for example:
everybody@yp.to: programmers@yp.to, testers@yp.to;
programmers@yp.to: joe@yp.to, bob@yp.to;
testers@yp.to: joe@yp.to, fred@yp.to;
a message to everybody@yp.to will be sent to joe@yp.to only once. (this also means that addresses in an internal forwarding loop are discarded. so no infinite loop chaos, we love to see it π)
exception: if a target has an owner address, commands for that target are considered different from commands for ``outside'' targets.
π SEE ALSO π
newaliases(1), preline(1), printforward(1), setmaillist(1)
and that's the whole page bestie π this was setforward(1), from the General Commands Manual β go forth and build your forwarding database, you absolute main character πΈπ¦π
π¦ 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