xref: /freebsd/share/man/man5/forward.5 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
13118b82aSMike Pritchard.\" Copyright (c) 1996
23118b82aSMike Pritchard.\"	Mike Pritchard <mpp@FreeBSD.org>.  All rights reserved.
33118b82aSMike Pritchard.\"
43118b82aSMike Pritchard.\" Redistribution and use in source and binary forms, with or without
53118b82aSMike Pritchard.\" modification, are permitted provided that the following conditions
63118b82aSMike Pritchard.\" are met:
73118b82aSMike Pritchard.\" 1. Redistributions of source code must retain the above copyright
83118b82aSMike Pritchard.\"    notice, this list of conditions and the following disclaimer.
93118b82aSMike Pritchard.\" 2. Redistributions in binary form must reproduce the above copyright
103118b82aSMike Pritchard.\"    notice, this list of conditions and the following disclaimer in the
113118b82aSMike Pritchard.\"    documentation and/or other materials provided with the distribution.
123118b82aSMike Pritchard.\" 3. All advertising materials mentioning features or use of this software
133118b82aSMike Pritchard.\"    must display the following acknowledgement:
143118b82aSMike Pritchard.\"	This product includes software developed by Mike Pritchard and
153118b82aSMike Pritchard.\"	contributors.
163118b82aSMike Pritchard.\" 4. Neither the name of the author nor the names of its contributors
173118b82aSMike Pritchard.\"    may be used to endorse or promote products derived from this software
183118b82aSMike Pritchard.\"    without specific prior written permission.
193118b82aSMike Pritchard.\"
203118b82aSMike Pritchard.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
213118b82aSMike Pritchard.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
223118b82aSMike Pritchard.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
233118b82aSMike Pritchard.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
243118b82aSMike Pritchard.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
253118b82aSMike Pritchard.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
263118b82aSMike Pritchard.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
273118b82aSMike Pritchard.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
283118b82aSMike Pritchard.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
293118b82aSMike Pritchard.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
303118b82aSMike Pritchard.\" SUCH DAMAGE.
313118b82aSMike Pritchard.\"
323118b82aSMike Pritchard.Dd July 2, 1996
333118b82aSMike Pritchard.Dt FORWARD 5
343118b82aSMike Pritchard.Os
353118b82aSMike Pritchard.Sh NAME
363118b82aSMike Pritchard.Nm forward
373118b82aSMike Pritchard.Nd mail forwarding instructions
383118b82aSMike Pritchard.Sh DESCRIPTION
393118b82aSMike PritchardThe
403118b82aSMike Pritchard.Nm .forward
413118b82aSMike Pritchardfile contains a list of mail addresses or programs
425203edcdSRuslan Ermilovthat the user's mail should be redirected to.
435203edcdSRuslan ErmilovIf the
443118b82aSMike Pritchardfile is not present, then no mail forwarding will be done.
453118b82aSMike PritchardMail may also be forwarded as the standard input to a program
463118b82aSMike Pritchardby prefixing the line
475203edcdSRuslan Ermilovwith the normal shell pipe symbol (|).
485203edcdSRuslan ErmilovIf arguments
493118b82aSMike Pritchardare to be passed to the command, then the entire line
505203edcdSRuslan Ermilovshould be enclosed in quotes.
515203edcdSRuslan ErmilovFor security reasons, the
523118b82aSMike Pritchard.Nm .forward
533118b82aSMike Pritchardfile must be owned by the user the mail is being sent to,
543118b82aSMike Pritchardor by root, and the user's shell must be listed in
553118b82aSMike Pritchard.Pa /etc/shells .
563118b82aSMike Pritchard.Pp
573118b82aSMike PritchardFor example, if a
583118b82aSMike Pritchard.Nm .forward
593118b82aSMike Pritchardfile contained the following lines:
603118b82aSMike Pritchard.Bd -literal -offset indent
613118b82aSMike Pritchardnobody@FreeBSD.org
623118b82aSMike Pritchard"|/usr/bin/vacation nobody"
633118b82aSMike Pritchard.Ed
643118b82aSMike Pritchard.Pp
653118b82aSMike PritchardMail would be forwarded to
66d0353b83SRuslan Ermilov.Aq nobody@FreeBSD.org
673118b82aSMike Pritchardand to the program
683118b82aSMike Pritchard.Pa /usr/bin/vacation
693118b82aSMike Pritchardwith the single argument
703118b82aSMike Pritchard.Ar nobody .
712312341fSJoseph Koshy.Pp
722312341fSJoseph KoshyIf a local user address is prefixed with a backslash
732312341fSJoseph Koshycharacter, mail is delivered directly to the user's
742312341fSJoseph Koshymail spool file, bypassing further redirection.
752312341fSJoseph Koshy.Pp
762312341fSJoseph KoshyFor example, if user chris had a
772312341fSJoseph Koshy.Nm .forward
782312341fSJoseph Koshyfile containing the following lines:
792312341fSJoseph Koshy.Bd -literal -offset indent
802312341fSJoseph Koshychris@otherhost
812312341fSJoseph Koshy\echris
822312341fSJoseph Koshy.Ed
832312341fSJoseph Koshy.Pp
842312341fSJoseph KoshyOne copy of mail would be forwarded to
852312341fSJoseph Koshy.Ar chris@otherhost
862312341fSJoseph Koshyand another copy would be retained as mail for local user chris.
873118b82aSMike Pritchard.Sh FILES
883118b82aSMike Pritchard.Bl -tag -width $HOME/.forward -compact
893118b82aSMike Pritchard.It Pa $HOME/.forward
903118b82aSMike PritchardThe user's forwarding instructions.
913118b82aSMike Pritchard.El
923118b82aSMike Pritchard.Sh SEE ALSO
932312341fSJoseph Koshy.Xr aliases 5 ,
943118b82aSMike Pritchard.Xr sendmail 8
95