The following list describes some situations that you can avoid or easily fix.
If mail is not being delivered to the expected address, check the user's .forward file. The user might have put the .forward file in the home directory of host1, which forwards mail to user@host2. When the mail arrives at host2, sendmail checks for user in the NIS or NIS+ aliases and sends the message back to user@host1. This routing results in a loop and more bounced mail.
To avoid security problems, never put .forward files in the root and bin accounts. If necessary, forward the mail by using the aliases file instead.
For the .forward files to be an effective part of mail delivery, ensure that the following controls (mostly permissions settings) are correctly applied.
The .forward file must be writable only by the owner of the file. This restriction prevents other users from breaking security.
The paths that lead to the home directory must be owned and writable by root only. For example, if a .forward file is in /export/home/terry, /export and /export/home must be owned and writable by root only.
The actual home directory should be writable only by the user.
The .forward file cannot be a symbolic link, and this file cannot have more than one hard link.
You can create a .forward.hostname file to redirect mail that is sent to a specific host. For example, if a user's alias has changed from email@example.com to firstname.lastname@example.org, place a .forward.phoenix file in the home directory for sandy.
% cat .forward.phoenix email@example.com "|/usr/bin/vacation sandy" % cat .vacation.msg From: firstname.lastname@example.org (via the vacation program) Subject: my alias has changed My alias has changed to email@example.com. Please use this alias in the future. The mail that I just received from you has been forwarded to my new address. Sandy
In this example, mail can be forwarded to the correct place while the sender is notified of the alias change. Because the vacation program permits only one message file, you can forward only one message at a time. However, if the message is not host specific, one vacation message file can be used by .forward files for many hosts.
Another extension to the forwarding mechanism is the .forward+detail file. The detail string can be any sequence of characters except operator characters. The operator characters are .:%&!^+. By using this type of file, you can determine if someone else is using your email address without your knowledge. For instance, if a user tells someone to use the email address firstname.lastname@example.org, the user would be able to identify any future mail that was delivered to this alias. By default, any mail that is sent to the email@example.com alias is checked against the alias and the .forward+detail files. If no matches are made, the mail falls back to delivery to firstname.lastname@example.org, but the user is able to see a change in the To: mail header.