DOT-FORWARD(1)
π DOT-FORWARD(1) β the dot-forward / dotforward girlies' era
okay so bestie, welcome to DOT-FORWARD(1), written by S. Varshavchik, and it's literally all about reading $HOME/.forward. no cap, that's the whole vibe. let's get into it π
β¨ NAME β¨
dot-forward, dotforward β reads $HOME/.forward. that's it. that's the girl. π
π¦ SYNOPSIS π¦
$ cat $HOME/.courier
|| dotforward
./Maildir
π DESCRIPTION π
So the dotforward program is a compatibility module β it's the one that reads your forwarding instructions in $HOME/.forward. It exists purely so you can keep the same energy as sendmail or any other mail server that uses that $HOME/.forward file. iykyk. πΈ
The dotforward program is meant to be executed from a dot-courier(5)[1] delivery instruction file. And here's the thing β your system administrator can just add it to the default set of delivery instructions, which means they've unilaterally implemented $HOME/.forward systemwide. main character admin behavior honestly π
To read forwarding instructions from $HOME/.forward, you put "|| dotforward" on the first line of $HOME/.courier*. You can also toss "|| dotforward" into the DEFAULTDELIVERY setting in the courierd configuration file. In both cases it must be followed by a newline, and the remaining delivery instructions β which will be used if $HOME/.forward does not exist β come after. periodt.
dotforward expects to be invoked from a dot-courier(5)[1] delivery instruction file via the "||" operator (or from DEFAULTDELIVERY). What it does, step by step, bestie:
- it checks its environment π§
- it reads the message from standard input
- it reconciles its environment with the contents of
$HOME/.forward - then it prints, on standard output, equivalent
dot-courier(5)[1]compatible delivery instructions β¨
Then the "||" operator reinterprets dotforward's output as additional delivery instructions, by the Courier mail server. iconic, truly.
okay but here's the real tea π β the Courier mail server and other mail servers that use $HOME/.forward (like sendmail) have different security models. Which means it is genuinely not possible to faithfully duplicate 100% of the behavior of $HOME/.forward that originated with sendmail. it's giving "we tried our best, the vibes are just different." The next section documents the behavior of the dotforward utility in the the Courier mail server mail server. yes, it says "the the" in the original and we respect the original. π
π $HOME/.forward processing π
dotforward reads the DTLINE environment variable, and the headers of the message being delivered, from standard input.
DTLINEcontains the recipient's E-mail address. π¬- The
Delivered-Toheaders list the recipients that already received this message. This is used to prevent mail loops between$HOME/.forwardfiles from different recipients, which forward mail to each other. (mutual forwarding tragedy β we don't do that here)
If $HOME/.forward does not exist, dotforward quietly terminates with a zero exit code, doing nothing. no drama, no noise. The remaining delivery instructions in $HOME/.courier are then carried out. π«Ά
If $HOME/.forward exists, it's expected to contain a list of addresses that the message should be forwarded to. An address may be an actual E-mail address, or a name of a program or a mailbox. Each line in $HOME/.forward should contain a list of comma-separated addresses.
- Use
"| /path/to/program"(including the double quotes, bestie, they matter!) to specify a delivery to a program β the message is piped to the given program. π₯ - Use
"/path/to/mailbox"or"./path/to/mailbox"(again including the double quotes) to specify a delivery to a mailbox β relative to$HOMEin the second case. π
"| /path/to/program", "/path/to/mailbox", and "./path/to/mailbox" may also be listed on a line by themselves without the double quotes. flexible queen π
All other addresses are interpreted as E-mail addresses where the mail should be forwarded. Any backslash at the beginning of an E-mail address is removed. Backslashes are used by sendmail to prevent mail loops. The Courier mail server does not need the backslashes β it uses a different mechanism to prevent mail loops. different era, different mechanism, same goal π
Every E-mail address is checked against the list of E-mail addresses found in Delivered-To headers. If the E-mail address specified in $HOME/.forward matches any address in the Delivered-To header, it is automatically removed from a list of addresses. bye bestie, you already got this one π
And now, the exit codes, because they're lowkey the whole plot:
dotforward normally terminates with the exit code set to 99. This results in the Courier mail server considering the message to be succesfully delivered, and any additional delivery instructions in the .courier file will not be carried out.
If an address read from $HOME/.forward matches the address in the DTLINE environment variable, the address is removed from the list of addresses that the message will be forwarded to, and dotforward terminates with the exit code set to 0 (after printing all the relevant delivery instructions to standard output). The messages will be forwarded, and the Courier mail server will proceed with additional delivery instructions in the .courier after finishing with the delivery instructions it reads from dotforward. slay β¨
π BUGS π
ngl, the restrictions and precautions mentioned in dot-courier(5)[1] are also applicable here. π
There is an upper limit on the maximum number of characters that are read from any process executed by ||.
Also β and this is the part where we cry a little π β if any delivery instruction fails with a transit exit code, the message will be completely redelivered at a later point, even to all the addresses it has been succesfully delivered the first time around. yes, even the ones that already ate. rip to your inbox fr fr.
π«Ά SEE ALSO π«Ά
dot-courier(5)[1]. go read her, she's the blueprint.
π AUTHOR π
Sam Varshavchik Author
π NOTES π
and that's the whole thing bestie, you made it to the end π₯Ή Courier Mail Server, dated 01/10/2026 β DOT-FORWARD(1) out. go forward some mail, you absolute icon π
π¦ where this page comes from
- ubuntu stonking: courier-mta 2.0.6-1 Β· GPL-3+~with-OpenSSL-exception
- Copyright 1999 - 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