1.\" $OpenBSD: forward.5,v 1.9 2015/03/13 22:41:54 eric Exp $ 2.\" 3.\" Copyright (c) 2012 Gilles Chehade <gilles@poolp.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: March 13 2015 $ 18.Dt FORWARD 5 19.Os 20.Sh NAME 21.Nm forward 22.Nd email forwarding information file 23.Sh DESCRIPTION 24Users may put a 25.Nm .forward 26file in their home directory. 27If this file exists, 28.Xr smtpd 8 29forwards email to the destinations specified therein. 30.Pp 31A 32.Nm .forward 33file contains a list of expansion values, as described in 34.Xr aliases 5 . 35Each expansion value should be on a line by itself. 36However, the 37.Nm .forward 38mechanism differs from the aliases mechanism in that it disallows 39file inclusion 40.Pq :include: 41and it performs expansion under the user ID of the 42.Nm .forward 43file owner. 44.Pp 45Permissions on the 46.Nm .forward 47file are very strict and expansion is rejected if the file is 48group or world-writable; 49if the home directory is group writeable; 50or if the file is not owned by the user. 51.Pp 52Users should avoid editing directly the 53.Nm .forward 54file to prevent delivery failures from occurring if a message 55arrives while the file is not fully written. 56The best option is to use a temporary file and use the 57.Xr mv 1 58command to atomically overwrite the former 59.Nm .forward . 60Alternatively, setting the 61.Xr sticky 8 62bit on the home directory will cause the 63.Nm .forward 64lookup to return a temporary failure, causing mails to be deferred. 65.Sh FILES 66.Bl -tag -width "~/.forwardXXX" -compact 67.It Pa ~/.forward 68Email forwarding information. 69.El 70.Sh EXAMPLES 71The following file forwards mail to 72.Dq user@example.com , 73and pipes the same mail to 74.Dq examplemda . 75.Bd -literal -offset indent 76# empty lines are ignored 77 78user@example.com # anything after # is ignored 79"|/path/to/examplemda" 80.Ed 81.Sh SEE ALSO 82.Xr aliases 5 , 83.Xr smtpd 8 84