Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.forward file help needed

Status
Not open for further replies.

Sunny79

MIS
Sep 11, 2001
67
US
Hi everyone, I am currently running Sendmail 8.12 on a SUN system. Our company was just bought so we are going to me making a move from the POP server to an Exchange server for emails. I wanted to place a .forward file on the SUN system to forward emails going to the old addresses. When I read the facts on .forward all it says is that I am supposed to enter a command, (echo 'user@newdomain.com' > .forward), which will make sure that all of that particular user's emails are forwarded from the POP server to the Exchange.

This leads to two questions when I was testing this out.

1. Everytime I enter the echo command for the user, there is a .forward file created on the root dir for only one user, because if I enter the same command again for a different user, the .forward file overwrites the old account I enter. How is this going to work for multiple user accounts. I have 25 that need forwarding.

2. What is the procedure for using the .forward file. If I am able to enter multiple accounts in the .forward file, how will sendmail recognize which email goes to whom. ie..

If we have a user ID in the POP server bobj and need it going to the Exchange account for the same person, but with a different userid bobjoe, then how will just placing a bobjoe@newdomain.com let sendmail know that all the emails for bobj@olddomain.com go to the new bobjoe@newdomain.com.

Currently I understand that the .forward file looks like:

bobjoe@newdomain.com
henryk@newdomain.com
 
Code:
grep '/bin/c*sh' /etc/passwd | nawk -F":" '{per=sprintf("echo %s@newdomain.com > /home/%s/.forward",$1,$1); system(per);}'
maybe :)

you might want to change 'system' to 'print' to test it first
 
It was my understanding that each user gets a .forward file placed in their ~/home/<user> directory -- that is how sendmail knows where to route the mail for each user.
 
Thank you asanchez4 and jad, since the last time I posted this question someone had suggested the use of a .forward file. And you are right about the .forward file placed in the /home/<user> directory.
All I had to do was to go to each individual user's home directory and create a .forward file, in which I added just the new email address I wanted the emails to be forwarded to. It worked like a charm.

Thank you for your all your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top