'\" t .\" .\" .\" Title: dot-forward .\" Author: Sam Varshavchik .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 10/28/2020 .\" Manual: Double Precision, Inc. .\" Source: Courier Mail Server .\" Language: English .\" .TH "DOT\-FORWARD" "1" "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" dot-forward, dotforward \- Read $HOME/\&.forward .SH "SYNOPSIS" .sp .nf $ cat $HOME/\&.courier || dotforward \&./Maildir .fi .SH "DESCRIPTION" .PP The \fBdotforward\fR program is a compatibility module that reads forwarding instructions in $HOME/\&.forward\&. \fBdotforward\fR is used for compatibility with \fBsendmail\fR or other mail servers that use the $HOME/\&.forward file\&. The \fBdotforward\fR program is intended to be executed from a \m[blue]\fB\fBdot-courier\fR(5)\fR\m[]\&\s-2\u[1]\d\s+2 delivery instruction file\&. The system administrator can add it to the default set of delivery instructions, thus unilaterally implementing $HOME/\&.forward systemwide\&. To read forwarding instructions from $HOME/\&.forward, put "|| dotforward" on the first line of $HOME/\&.courier*\&. "|| dotforward" can also be added to the \fBDEFAULTDELIVERY\fR 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\&. .PP \fBdotforward\fR expects to be invoked from \m[blue]\fB\fBdot-courier\fR(5)\fR\m[]\&\s-2\u[1]\d\s+2 delivery instruction file via the "||" operator (or from \fBDEFAULTDELIVERY\fR)\&. \fBdotforward\fR checks its environment, reads the message from standard input, reconciles its environment with the contents of $HOME/\&.forward, then prints on standard output equivalent \m[blue]\fB\fBdot-courier\fR(5)\fR\m[]\&\s-2\u[1]\d\s+2 compatible delivery instructions\&. The "||" operator reinterprets \fBdotforward\fR\*(Aqs output as additional delivery instructions, by the Courier mail server\&. .PP The different security models of the Courier mail server and other mail servers that use $HOME/\&.forward, such as \fBsendmail\fR, means that it is not possible to faithfully duplicate 100% of the behavior of $HOME/\&.forward that originated with \fBsendmail\fR\&. The following section documents the behavior of the \fBdotforward\fR utility in the the Courier mail server mail server\&. .SS "$HOME/\&.forward processing" .PP \fBdotforward\fR reads the \fBDTLINE\fR environment variable, and the headers of the message being delivered, from standard input\&. \fBDTLINE\fR contains the recipient\*(Aqs E\-mail address\&. The Delivered\-To headers list the recipients that already received this message\&. This is used to prevent mail loops between $HOME/\&.forward files from different recipients, which forward mail to each other\&. .PP If $HOME/\&.forward does not exist, \fBdotforward\fR quietly terminates with a zero exit code, doing nothing\&. The remaining delivery instructions in $HOME/\&.courier are then carried out\&. .PP If $HOME/\&.forward exists, it is 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) 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 $HOME in the second case)\&. .PP "| /path/to/program", "/path/to/mailbox", and "\&./path/to/mailbox" may also be listed on a line by themselves without the double quotes\&. .PP 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 \fBsendmail\fR to prevent mail loops\&. The Courier mail server does not need the backslashes \-\- it uses a different mechanism to prevent mail loops\&. .PP 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\&. .PP \fBdotforward\fR normally terminates with the exit code set to \fB99\fR\&. 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 \fBDTLINE\fR environment variable, the address is removed from the list of addresses that the message will be forwarded to, and \fBdotforward\fR 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 \fBdotforward\fR\&. .SH "BUGS" .PP The restrictions and precautions mentioned in \m[blue]\fB\fBdot-courier\fR(5)\fR\m[]\&\s-2\u[1]\d\s+2 are also applicable here\&. There is an upper limit on the maximum number of characters that are read from any process executed by ||\&. Also 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\&. .SH "SEE ALSO" .PP \m[blue]\fB\fBdot-courier\fR(5)\fR\m[]\&\s-2\u[1]\d\s+2\&. .SH "AUTHOR" .PP \fBSam Varshavchik\fR .RS 4 Author .RE .SH "NOTES" .IP " 1." 4 \fBdot-courier\fR(5) .RS 4 \%http://www.courier-mta.org/dot-courier.html .RE