Forward mail addressed to local user alice to alice@example.net.
Configure it in alice's home directory.
Which content is appropriate for ~/.forward?
Put the destination address on a line in ~/.forward. The local MTA then forwards mail delivered to that user.
Detailed explanation
alice: alice@example.netIncorrect. ~/.forward does not repeat the alias left-hand side.
Incorrect. ~/.forward does not repeat the alias left-hand side.
forward=alice@example.netIncorrect. It is not assignment syntax.
Incorrect. It is not assignment syntax.
To: alice@example.netIncorrect. It is not an email header file.
Incorrect. It is not an email header file.
alice@example.netCorrect. The destination address is written directly.
Correct. The destination address is written directly.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'alice@example.net'Expected result
alice@example.netKey points
- Per-user setting
- One destination per line
- Check ownership and permissions
Notes
- Environment: printf / ~/.forwardは作成しない
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.