forward problem with sendmail

I create a .forward file under one user's directory. It looks like this:
Then I restart sendmail program, and send test mail. But it seems the Solaris ignores the .forward file. The user still receive email from his previous email address, can't receive from new email address. And I have tested the new email address, it can work. I don't know why. Thank you.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

First of all, you do not have to restart the sendmail daemon when you make changes to or create a new .forward file under a user's home directory. It seems like you have tested sending email to the email address and it works, right ?? Can you send email directly to from the machine you are making changes on ?


What is needed:

version of sendmail, from /var/log/syslog
how is your mailsystem configured,
is /var/mail mounted from a mailhost ?

Can you see any mail forwarded in /var/log/syslog ?

This usually just works, henche the questions
frog77Author Commented:
yes, I mounted /var/mail from another mail server, and the version is 8.11.2. I guess the reason may be in file relay-domains. I see some "relaying denied" in log file. Because our mail server has open-relay problem early, I only create two entries in relay-domains file, one is the mail server, another is this mail client. I send test email from another domain, so I guess mail server can not forward this test email to new address. Am I right? How can I solve this problem?
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

So in that case sendmail is not started on your client.

Relay domains limits the domains from the inside that will be relayed and eventually rewritten by the the mail gateway.

This shouldnt be a problem since the sender of the mail is your internal user, the recipiant address has no bearing on this.

If you try to run a verbose test from sendmail, what happens ?

su - to-the-user-with-the-.forward-file
( or login as the user )
sendmail -v user@domain < "some dummy textfile" ( from the .forward file )

There are normally no limitations on recipiants, therfor the problem must be somewhere else.

One more thing, can you check what actually happens when a mail arrives to the user with the .forward file ?

I guess/hope the protection is ok on the .forward file.

Come back again.
check your /etc/mail/ file

do a search on "Forward"

make sure that your seach ".forward" path looks like:

O ForwardPath=$z/.forward:/var/forward/$u

O ForwardPath=$z/.forward.$w+$h:$z/.forward+$h:$z/.forward.$w:$z/.forward
#O ForwardPath=

if your "ForwardPath" is "blank", change it and then restart sendmail.

frog77Author Commented:
I try the command sendmail -v user@domain < /dev/null, it says
Host unkown(Name Server: xxx(our mailserver name):host not found)
Cannot open /home/xxx(username)/dead.letter: Persmission denied
Meanwhile, I set the user's home directory and his .forward file to be not group or world writable. Am I right and how can I solve the problem?
do a nslookup to check if your box can see your mailserver?

If not, check /etc/resolv.conf file to make sure your have the DNS server infor.

frog77Author Commented:
I have DNS server info in resolv.conf. When I check, I found such a line:
#are group-writable:include:and .forward files (un)trustworthy
#O Unsafe Groupwrites
I changed the user's home directory and his .forward file to be not group or world writable. But I did not find any include files.
And in sun's doc website, it is said increased security on .forward files requires that the default shells (as listed in /etc/passwd) of all users trying to employ a .forward file to forward mail to a program or to a file must be listed in /etc/shells for the file to be accessed.
So shall I change the /etc/shells to make forward work normally? Thank you.

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ and refund

Please leave any comments here within the next four days.


EE Cleanup Volunteer
PAQed, with points refunded (50)

Community Support Moderator

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.