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.
forward=alice@example.netIncorrect. It is not assignment syntax.
To: alice@example.netIncorrect. It is not an email header file.
alice@example.netCorrect. 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
MTA
A mail transfer agent that accepts, routes, and queues messages.
Alias and forwarding
Rules that map a local address to one or more delivery destinations.
Mail queue
Temporary storage for messages waiting to be delivered or retried.